query
On this page

forEach

lib.lists.forEach

Docs pulled from | This Revision | about 1 hour ago


Apply the function to each element in the list. Same as map, but arguments flipped.

Inputs

xs

1. Function argument

f

2. Function argument

Type

forEach :: [a] -> (a -> b) -> [b]

Examples

lib.lists.forEach usage example

forEach [ 1 2 ] (x:
  toString x
)
=> [ "1" "2" ]

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

forEach = xs: f: map f xs;