compdata-0.3: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
MaintainerTom Hvitved <>



This module defines traversable difunctors.



class (Difunctor f, Monad m) => Ditraversable f m a whereSource

Difunctors representing data structures that can be traversed from left to right.


dimapM :: (b -> m c) -> f a b -> m (f a c)Source

disequence :: f a (m b) -> m (f a b)Source


Ditraversable (->) [] Any 
Ditraversable (->) Gen a 
Ditraversable (->) Maybe Any

Functions of the type Any -> Maybe a can be turned into functions of type Maybe (Any -> a). The empty type Any ensures that the function is parametric in the input, and hence the Maybe monad can be pulled out.

Ditraversable (->) Identity a 
Ditraversable (->) (Either e) Any 
Ditraversable (->) m Any => Ditraversable (->) (ListT m) Any 
(Error e, Ditraversable (->) m Any) => Ditraversable (->) (ErrorT e m) Any 
Ditraversable (->) m a => Ditraversable (->) (ReaderT r m) a 
Ditraversable (->) m Any => Ditraversable (->) (StateT s m) Any 
(Monoid w, Ditraversable (->) m Any) => Ditraversable (->) (WriterT w m) Any 
(Monoid w, Ditraversable (->) m Any) => Ditraversable (->) (RWST r w s m) Any 
Ditraversable f m a => Ditraversable (:&: f p) m a 
(Ditraversable f m a, Ditraversable g m a) => Ditraversable (:+: f g) m a