morphisms-functors-0.1.7: Functors, theirs compositions and transformations

Safe HaskellSafe
LanguageHaskell2010

Control.Functor.Covariant.Alternative

Synopsis

Documentation

class Covariant t => Alternative t where Source #

When providing a new instance, you should ensure it satisfies the two laws:
* Associativity of <+>: (x <+> y) <+> z ≡ x <+> (y <+> z)
* Left-distributes <$> over <+>: f <$> (x <+> y) ≡ (f <$> x) <+> (f <$> y)

Minimal complete definition

(<+>)

Methods

(<+>) :: t a -> t a -> t a infixl 3 Source #

Infix version of alter

alter :: t a -> t a -> t a Source #

Prefix version of <+>

Instances
Alternative t => Alternative (Yoneda t) Source # 
Instance details

Defined in Data.Functor.Yoneda

Methods

(<+>) :: Yoneda t a -> Yoneda t a -> Yoneda t a Source #

alter :: Yoneda t a -> Yoneda t a -> Yoneda t a Source #

(Alternative t, Covariant u) => Alternative (T Co Co t u) Source # 
Instance details

Defined in Data.Functor.Composition.T

Methods

(<+>) :: T Co Co t u a -> T Co Co t u a -> T Co Co t u a Source #

alter :: T Co Co t u a -> T Co Co t u a -> T Co Co t u a Source #

(Alternative t, Covariant u, Covariant v) => Alternative (TT Co Co Co t u v) Source # 
Instance details

Defined in Data.Functor.Composition.TT

Methods

(<+>) :: TT Co Co Co t u v a -> TT Co Co Co t u v a -> TT Co Co Co t u v a Source #

alter :: TT Co Co Co t u v a -> TT Co Co Co t u v a -> TT Co Co Co t u v a Source #

(Alternative t, Covariant u, Covariant v, Covariant w) => Alternative (TTT Co Co Co Co t u v w) Source # 
Instance details

Defined in Data.Functor.Composition.TTT

Methods

(<+>) :: TTT Co Co Co Co t u v w a -> TTT Co Co Co Co t u v w a -> TTT Co Co Co Co t u v w a Source #

alter :: TTT Co Co Co Co t u v w a -> TTT Co Co Co Co t u v w a -> TTT Co Co Co Co t u v w a Source #