module Pandora.Pattern.Functor.Traversable (Traversable (..)) where
import Pandora.Core.Functor (type (:.:))
import Pandora.Core.Morphism (identity)
import Pandora.Pattern.Functor.Covariant (Covariant)
import Pandora.Pattern.Functor.Applicative (Applicative)
import Pandora.Pattern.Functor.Pointable (Pointable)
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