Exactly. There are actually two methods for that (
each), most of the time
each should be the default choice though – the difference is handling of side effects –
each executes them immediately, while
map suspends them. So for example
[1,2,3] . each print will print all the elements, while
[1,2,3] . map print will not print anything but instead return a list of actions. So you could write e.g.
a = [1,2,3] . map print
and each of the
a.head lines will print
If you are familiar with Haskell,
map in luna corresponds to
map in haskell, while
each corresponds to
mapM. For most use cases
each will be enough.