Hoogle Search
Within LTS Haskell 24.35 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k acontainers Data.Map.Strict.Internal Build a map from a list of key/value pairs with a combining function. See also fromAscListWithKey.
let f key new_value old_value = show key ++ ":" ++ new_value ++ "|" ++ old_value fromListWithKey f [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] == fromList [(3, "3:a|b"), (5, "5:c|5:b|a")] fromListWithKey f [] == empty
Also see the performance note on fromListWith.toAscList :: Map k a -> [(k, a)]containers Data.Map.Strict.Internal Convert the map to a list of key/value pairs where the keys are in ascending order. Subject to list fusion.
toAscList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")]
toDescList :: Map k a -> [(k, a)]containers Data.Map.Strict.Internal Convert the map to a list of key/value pairs where the keys are in descending order. Subject to list fusion.
toDescList (fromList [(5,"a"), (3,"b")]) == [(5,"a"), (3,"b")]
-
containers Data.Map.Strict.Internal Convert the map to a list of key/value pairs. Subject to list fusion.
toList (fromList [(5,"a"), (3,"b")]) == [(3,"b"), (5,"a")] toList empty == []
-
containers Data.Sequence Create a sequence from a finite list of elements. There is a function toList in the opposite direction for all instances of the Foldable class, including Seq.
-
containers Data.Sequence.Internal Create a sequence from a finite list of elements. There is a function toList in the opposite direction for all instances of the Foldable class, including Seq.
-
containers Data.Sequence.Internal.Sorting No documentation available.
-
containers Data.Sequence.Internal.Sorting No documentation available.
-
containers Data.Sequence.Internal.Sorting No documentation available.
-
containers Data.Sequence.Internal.Sorting No documentation available.