Safe Haskell | None |
---|---|
Language | Haskell2010 |
WARNING: This module is an experiment to see how Alternative
may be encoded.
The authors are not aware of any generalized applicatives that make use of Alternative
.
Hence, we do not know if this encoding of it is sufficient.
Therefore, the encoding is not in its final form and may change in the future.
- class Functor f => AlternativeEmpty f where
- type AlternativeEmptyCts f a :: Constraint
- class (Functor f, Functor g, Functor h) => AlternativeAlt f g h where
- type AlternativeAltCts f g h a :: Constraint
Documentation
class Functor f => AlternativeEmpty f where Source #
The encoding of the empty
operation.
Return
is not a superclass, because the indices or constraints involved
in an AlternativeEmpty
instance may differ from those involved with the Return
instance.
WARNING: This module is an experiment to see how Alternative
may be encoded.
The authors are not aware of any generalized applicatives that make use of Alternative
.
Hence, we do not know if this encoding of it is sufficient.
Therefore, the encoding is not in its final form and may change in the future.
type AlternativeEmptyCts f a :: Constraint Source #
empty :: AlternativeEmptyCts f a => f a Source #
AlternativeEmpty [] Source # | |
AlternativeEmpty Maybe Source # | |
AlternativeEmpty IO Source # | |
AlternativeEmpty Option Source # | |
AlternativeEmpty STM Source # | |
AlternativeEmpty ReadPrec Source # | |
AlternativeEmpty ReadP Source # | |
AlternativeEmpty (U1 *) Source # | |
AlternativeEmpty (Proxy *) Source # | |
AlternativeEmpty f => AlternativeEmpty (Rec1 * f) Source # | |
AlternativeEmpty f => AlternativeEmpty (Alt * f) Source # | |
(AlternativeEmpty f, AlternativeEmpty g) => AlternativeEmpty ((:*:) * f g) Source # | |
(AlternativeEmpty f, AlternativeEmpty f') => AlternativeEmpty (Product * f f') Source # | |
AlternativeEmpty f => AlternativeEmpty (M1 * i c f) Source # | |
(AlternativeEmpty f, AlternativeEmpty g) => AlternativeEmpty ((:.:) * * f g) Source # | |
(AlternativeEmpty f, AlternativeEmpty f') => AlternativeEmpty (Compose * * f f') Source # | |
class (Functor f, Functor g, Functor h) => AlternativeAlt f g h where Source #
The encoding of the <|>
operation.
Applicative
is not a superclass, because the indices or constraints involved
in an Alternative
instance may differ from those involved with the Applicative
instance.
WARNING: This module is an experiment to see how Alternative
may be encoded.
The authors are not aware of any generalized applicatives that make use of Alternative
.
Hence, we do not know if this encoding of it is sufficient.
Therefore, the encoding is not in its final form and may change in the future.
type AlternativeAltCts f g h a :: Constraint Source #
(<|>) :: AlternativeAltCts f g h a => f a -> g a -> h a Source #