[Haskell-cafe] usage of traversal

Kim-Ee Yeoh ky3 at atamo.com
Tue Sep 23 10:34:22 UTC 2014


> With AMP, 'fmap' and 'liftM' are identical and we use <$> instead
> recently. Likewise, 'traverse' and 'mapM' are identical.


Both Kazu and Michael are perfectly aware of the following but it's
important to set the record straight:

The function liftM is a specialization of fmap. Both functions operate the
same (which is what is meant by 'identical') on mutually admissible values,
but liftM restricts the domain of admissibility only to functors that are
also monadic.

Similarly, mapM is a specialization of traverse. Here, two functors are
involved where one is weakened and the other strengthened.

If we introduce an operator, say <:>, we can forget 'traverse' and 'mapM'


Have you considered the traditional way of using your own operators, i.e.
by spinning one's own Missing Haskell library, like John Goerzen did? The
direction you're suggesting requires familiarity with the libraries-haskell
process.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140923/48cea331/attachment.html>


More information about the Haskell-Cafe mailing list