module Control.Functor.Covariant.Composition.Traversable (Traversable (..)) where
import "morphisms" Control.Morphism ((.), identity)
import Control.Functor.Covariant (Covariant)
import Control.Functor.Covariant.Applicative (Applicative)
import Control.Functor.Covariant.Pointable (Pointable)
import Control.Variance ((:.:))
class Covariant t => Traversable t where
{-# MINIMAL (->>) #-}
(->>) :: (Pointable u, Applicative u) => t a -> (a -> u b) -> (u :.: t) b
traverse :: (Pointable u, Applicative u) => (a -> u b) -> t a -> (u :.: t) b
traverse f t = t ->> f
sequence :: (Pointable u, Applicative u) => (t :.: u) a -> (u :.: t) a
sequence t = t ->> identity