This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace crap | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.SqlClient; | |
public class PartialAppPlayground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Checkout do | |
defstruct [ | |
basket: %{A: 0, B: 0, C: 0, D: 0} | |
] | |
def scan(checkout, code) do | |
new_value = checkout.basket[code] + 1 | |
%{checkout | basket: Map.put(checkout.basket, code, new_value)} | |
end |