Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
bimapM :: (Monad m, Ord k') => (k -> v -> m (k', v')) -> Map k v -> m (Map k' v')dbus DBus.Internal.Types No documentation available.
ToMap :: Expr s a -> Maybe (Expr s a) -> Expr s adhall Dhall.Core ToMap x (Just t) ~ toMap x : t ToMap x Nothing ~ toMap x
useToMap :: Expr s a -> Maybe (Expr s a)dhall Dhall.Lint This replaces a record of key-value pairs with the equivalent use of toMap This is currently not used by dhall lint because this would sort Map keys, which is not necessarily a behavior-preserving change, but is still made available as a convenient rewrite rule. For example, {json,yaml}-to-dhall use this rewrite to simplify their output.
foldMapWithKey :: (Monoid m, Ord k) => (k -> a -> m) -> Map k a -> mdhall Dhall.Map Fold all of the key-value pairs in a Map, in their original order
>>> foldMapWithKey (,) (fromList [("B",[1]),("A",[2])]) ("BA",[1,2])-
dhall Dhall.Map Create a Map from a Data.Map.Strict.Map
-
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