ansible/dhall/Prelude/Map/keyValue.dhall

18 lines
471 B
Text
Raw Normal View History

2024-11-26 05:55:44 +00:00
{-|
Builds a key-value record such that a List of them will be converted to a
homogeneous record by dhall-to-json and dhall-to-yaml.
-}
let keyValue =
λ(v : Type) →
λ(key : Text) →
λ(value : v) →
{ mapKey = key, mapValue = value }
let example0 =
assert : keyValue Natural "foo" 2 ≡ { mapKey = "foo", mapValue = 2 }
let example1 =
assert : keyValue Text "bar" "baz" ≡ { mapKey = "bar", mapValue = "baz" }
in keyValue