Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
dhall Dhall.Map Convert a Dhall.Map.Map to a Data.Map.Strict.Map
>>> toMap (fromList [("B",1),("A",2)]) -- Order is lost upon conversion fromList [("A",2),("B",1)] hashMap :: (Eq k, Hashable k) => Decoder k -> Decoder v -> Decoder (HashMap k v)dhall Dhall.Marshal.Decode Decode a HashMap from a toMap expression or generally a Prelude.Map.Type.
>>> fmap (List.sort . HashMap.toList) (input (Dhall.hashMap strictText bool) "toMap { a = True, b = False }") [("a",True),("b",False)] >>> fmap (List.sort . HashMap.toList) (input (Dhall.hashMap strictText bool) "[ { mapKey = \"foo\", mapValue = True } ]") [("foo",True)]If there are duplicate mapKeys, later mapValues take precedence:>>> let expr = "[ { mapKey = 1, mapValue = True }, { mapKey = 1, mapValue = False } ]" >>> input (Dhall.hashMap natural bool) expr fromList [(1,False)]pairFromMapEntry :: Decoder k -> Decoder v -> Decoder (k, v)dhall Dhall.Marshal.Decode Decode a tuple from a Prelude.Map.Entry record.
>>> input (pairFromMapEntry strictText natural) "{ mapKey = \"foo\", mapValue = 3 }" ("foo",3)NakedMergeOrSomeOrToMap :: ApplicationExprInfodhall Dhall.Parser.Expression merge x y, Some x or toMap x, unparenthesized.
-
dhall Dhall.Parser.Token Parse the toMap keyword This corresponds to the toMap rule from the official grammar
HeterogenousRecordToMap :: Expr s a -> Expr s a -> Expr s a -> TypeMessage s adhall Dhall.TypeCheck No documentation available.
InvalidToMapRecordKind :: Expr s a -> Expr s a -> TypeMessage s adhall Dhall.TypeCheck No documentation available.
InvalidToMapType :: Expr s a -> TypeMessage s adhall Dhall.TypeCheck No documentation available.
MissingToMapType :: TypeMessage s adhall Dhall.TypeCheck No documentation available.
MustMapARecord :: Expr s a -> Expr s a -> TypeMessage s adhall Dhall.TypeCheck No documentation available.