|
|
|
|
|
by sfvisser
510 days ago
|
|
The generalized version of ‘traverse/mapM’ that doesn’t just work for lists, but any ‘Traversable’ type is absolutely amazing and is useful in so many cases. ‘traverse :: Applicative f => (a -> f b) -> t a -> f (t b)’ And you can derive it for free for your own datatypes! The amount of code I’ve manually written in other languages to get a similar effect is painfully large. |
|