pandora-0.2.0: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.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 Maybe Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Maybe

Methods

(<+>) :: Maybe a -> Maybe a -> Maybe a Source #

alter :: Maybe a -> Maybe a -> Maybe a Source #

Alternative Stack Source # 
Instance details

Defined in Pandora.Paradigm.Structure.Stack

Methods

(<+>) :: Stack a -> Stack a -> Stack a Source #

alter :: Stack a -> Stack a -> Stack a Source #

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

Defined in Pandora.Paradigm.Basis.Yoneda

Methods

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

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

Alternative (Proxy :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Proxy

Methods

(<+>) :: Proxy a -> Proxy a -> Proxy a Source #

alter :: Proxy a -> Proxy a -> Proxy a Source #

Alternative t => Alternative (Free t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Free

Methods

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

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

Alternative (Validation e) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Validation

Methods

(<+>) :: Validation e a -> Validation e a -> Validation e a Source #

alter :: Validation e a -> Validation e a -> Validation e a Source #

Alternative t => Alternative (Jack t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Jack

Methods

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

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

Alternative (Conclusion e) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Conclusion

Methods

(<+>) :: Conclusion e a -> Conclusion e a -> Conclusion e a Source #

alter :: Conclusion e a -> Conclusion e a -> Conclusion e a Source #