map -package:containers -package:Cabal-syntax -package:aeson -package:insert-ordered-containers -package:invertible -package:monoidal-containers -package:blaze-html -package:basement -package:os-string -package:regex-tdfa -package:psqueues -package:ghc -package:vector -package:dlist

map f xs is the list obtained by applying f to each element of xs, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]
>>> map (+1) [1, 2, 3]
[2,3,4]
Map a function over a NonEmpty stream.
O(n) map f xs is the ByteString obtained by applying f to each element of xs.
O(n) map f xs is the ByteString obtained by applying f to each element of xs
O(n) map f xs is the ShortByteString obtained by applying f to each element of xs.
Transform the original string-like value but keep it case insensitive.
Apply a transformation to all values in a stream. Subject to fusion
Apply a transformation to all values in a stream. Subject to fusion Since 0.3.0
Apply function to every element of matrix
O(n) map f xs is the ShortByteString obtained by applying f to each element of xs.
Fold pairs into a map.
Generates a map using a Range to determine the length. This may fail to generate anything if the keys produced by the generator do not account for a large enough number of unique items to satify the required map size.
Apply a function to all values flowing downstream
map id = cat

map (g . f) = map f >-> map g
O(n) map f t is the Text obtained by applying f to each element of t. Example:
>>> let message = pack "I am not angry. Not at all."

>>> T.map (\c -> if c == '.' then '!' else c) message
"I am not angry! Not at all!"
Performs replacement on invalid scalar values.
O(n) map f xs is the Stream Char obtained by applying f to each element of xs. Properties
unstream . map f . stream = map f
O(n) map f t is the Text obtained by applying f to each element of t. Performs replacement on invalid scalar values.
Transform this map by applying a function to every value.
Transform this set by applying a function to every value. The resulting set may be smaller than the source.
>>> HashSet.map show (HashSet.fromList [1,2,3])
HashSet.fromList ["1","2","3"]
Map a function over a Stream
Type-level fmap for type-level functors. Note: this name clashes with Map from containers. FMap is provided as a synonym to avoid this.

Example

>>> data Example where Ex :: a -> Example  -- Hide the type of examples to avoid brittleness in different GHC versions

>>> data AddMul :: Nat -> Nat -> Exp Nat

>>> type instance Eval (AddMul x y) = (x TL.+ y) TL.* (x TL.+ y)

>>> :kind! Ex (Eval (Map (AddMul 2) '[0, 1, 2, 3, 4]) :: [Nat])
Ex (Eval (Map (AddMul 2) '[0, 1, 2, 3, 4]) :: [Nat]) :: Example
= Ex [4, 9, 16, 25, 36]