mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:56:48 +03:00
66 lines
1.2 KiB
Plaintext
66 lines
1.2 KiB
Plaintext
// Temporarily just a list of key/val
|
|
|
|
String.Map
|
|
: ∀(A: *) *
|
|
= (List.Map String)
|
|
|
|
String.Map.get
|
|
: ∀(A: *)
|
|
∀(key: String)
|
|
∀(map: (String.Map A))
|
|
(Maybe A)
|
|
= λA λkey λmap
|
|
(List.Map.get String A String.equal key map)
|
|
|
|
String.Map.set
|
|
: ∀(A: *)
|
|
∀(key: String)
|
|
∀(val: A)
|
|
∀(map: (String.Map A))
|
|
(String.Map A)
|
|
= λA λkey λval λmap
|
|
(List.Map.set String A key val map)
|
|
|
|
String.Map.new
|
|
: ∀(V: *)
|
|
(String.Map V)
|
|
= λV (List.Map.new String V)
|
|
|
|
// BBT Version
|
|
|
|
// String.Map
|
|
// : ∀(V: *)
|
|
// *
|
|
// = λV (BBT String V)
|
|
|
|
// String.Map.get
|
|
// : ∀(V: *)
|
|
// ∀(key: String)
|
|
// ∀(map: (String.Map V))
|
|
// (Maybe V)
|
|
// = λV λkey λmap
|
|
// (BBT.get String V String.cmp key map)
|
|
|
|
// String.Map.got
|
|
// : ∀(V: *)
|
|
// ∀(key: String)
|
|
// ∀(map: (String.Map V))
|
|
// (Pair (Maybe V) (String.Map V))
|
|
// = λV λkey λmap
|
|
// (BBT.got String V String.cmp key map)
|
|
|
|
// String.Map.set
|
|
// : ∀(V: *)
|
|
// ∀(key: String)
|
|
// ∀(val: V)
|
|
// ∀(map: (String.Map V))
|
|
// (String.Map V)
|
|
// = λV λkey λval λmap
|
|
// (BBT.set String V String.cmp key val map)
|
|
|
|
// String.Map.new
|
|
// : ∀(V: *)
|
|
// (String.Map V)
|
|
// = λV (BBT.tip String V)
|
|
|