Hoogle Search
Within LTS Haskell 24.31 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromList :: (Ord k, MonoidNull v) => [(k, v)] -> MonoidMap k vmonoidmap-internal Data.MonoidMap.Internal Constructs a MonoidMap from a list of key-value pairs. If the list contains more than one value for the same key, values are combined together in the order that they appear with the (<>) operator. Satisfies the following property for all possible keys k:
get k (fromList kvs) == foldMap snd (filter ((== k) . fst) kvs)
Satisfies the following round-trip property:fromList (toList m) == m
Examples
With String values:>>> fromList [(1,"a"), (2,"x"), (1,"b"), (2,"y"), (1,"c"), (2,"z")] fromList [(1,"abc"), (2,"xyz")]
fromList :: Ord k => [(k, v)] -> Map k vmonoidmap-internal Data.MonoidMap.Internal.RecoveredMap No documentation available.
fromList :: [Int] -> IntMultiSetmultiset Data.IntMultiSet O(t*min(n,W)). Create a multiset from a list of elements.
fromList :: Ord a => [a] -> MultiSet amultiset Data.MultiSet O(t*log t). Create a multiset from a list of elements.
fromList :: HeadedParsec Void Text FromClausepostgresql-syntax PostgresqlSyntax.Parsing No documentation available.
fromList :: FromClause -> TextBuilderpostgresql-syntax PostgresqlSyntax.Rendering No documentation available.
fromList :: MonadMoment m => [a] -> Event time -> m (Event a)reactive-midyim Reactive.Banana.MIDI.Pattern No documentation available.
fromList :: (SExpr t -> Either String a) -> SExpr t -> Either String [a]s-cargot Data.SCargot.Repr.Basic Utility function for parsing a list of things.
fromList :: (RichSExpr t -> Either String a) -> RichSExpr t -> Either String [a]s-cargot Data.SCargot.Repr.Rich Utility function for parsing a proper list of things.
>>> fromList fromAtom (L [A "this", A "that", A "the-other"]) Right ["this","that","the-other"] >>> fromList fromAtom (DL [A "this", A "that"] "the-other"]) Left "asList: expected proper list; found dotted list"
fromList :: (WellFormedSExpr t -> Either String a) -> WellFormedSExpr t -> Either String [a]s-cargot Data.SCargot.Repr.WellFormed Utility function for parsing a list of things.
>>> fromList fromAtom (L [A "this", A "that", A "the-other"]) Right ["this","that","the-other"] >>> fromList fromAtom (A "pachyderm") Left "asList: expected proper list; found dotted list"