Copyright | (c) 2011 Patrick Bahr, Tom Hvitved |
---|---|
License | BSD3 |
Maintainer | Tom Hvitved <hvitved@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell98 |
This module defines traversable higher-order difunctors.
- class HDifunctor f => HDitraversable f where
- class HFoldable t => HTraversable t where
Documentation
class HDifunctor f => HDitraversable f where Source
HDifunctors representing data structures that can be traversed from left to right.
HDitraversable f => HDitraversable ((:&:) f p) | |
(HDitraversable f, HDitraversable g) => HDitraversable ((:+:) f g) |
class HFoldable t => HTraversable t where
hmapM :: Monad m => NatM m a b -> NatM m (t a) (t b)
Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results.
Alternative type in terms of natural transformations using
functor composition :.:
:
hmapM :: Monad m => (a :-> m :.: b) -> t a :-> m :.: (t b)
htraverse :: Applicative f => NatM f a b -> NatM f (t a) (t b)