Safe Haskell  None 

Language  Haskell2010 
 newtype OverlappingWhichReader m r a = OverlappingWhichReader {
 runOverlappingWhichReader :: ReaderT r m a
 newtype DistinctWhichReader m r a = DistinctWhichReader {
 runDistinctWhichReader :: ReaderT r m a
 newtype ManyReader m r a = ManyReader {
 runManyReader :: ReaderT r m a
Documentation
newtype OverlappingWhichReader m r a Source #
Given a Reader that accepts Which a
, and another Reader that accepts Which b
make a reader that accepts Which (AppendUnique a b)
and runs both readers if possible,
where the types in Which a
and Which b
may overlap,
but with the compile time constraint that all the types in (AppendUnique a b) are distinct.
Alternative m => PEmpty * (OverlappingWhichReader m) (Which ([] Type)) Source #  
Applicative m => PPointed * (OverlappingWhichReader m) (Which ([] Type)) Source #  
(Alternative m, Reinterpret b c, Reinterpret a c, (~) [Type] c (AppendUnique Type a b)) => PAlternative * (OverlappingWhichReader m) (Which a) (Which b) (Which c) Source #  
Monad m => Monad (OverlappingWhichReader m r) Source #  
Functor m => Functor (OverlappingWhichReader m r) Source #  
MonadFix m => MonadFix (OverlappingWhichReader m r) Source #  
MonadFail m => MonadFail (OverlappingWhichReader m r) Source #  
Applicative m => Applicative (OverlappingWhichReader m r) Source #  
MonadZip m => MonadZip (OverlappingWhichReader m r) Source #  
MonadIO m => MonadIO (OverlappingWhichReader m r) Source #  
Alternative m => Alternative (OverlappingWhichReader m r) Source #  
MonadPlus m => MonadPlus (OverlappingWhichReader m r) Source #  
Generic (OverlappingWhichReader m r a) Source #  
type Rep (OverlappingWhichReader m r a) Source #  
newtype DistinctWhichReader m r a Source #
Given a Reader that accepts Which a
, and another Reader that accepts Which b
make a reader that accepts Which (Append a b)
and only run one of the readers for the correct Which type,
with a compiletime contraint that the types in Which a
are distinct from the type in Which b
The advantage of DistinctWhichReader
over OverlappingWhichReader
is that pappend
doesn't
require the inner monad m
to be an Alternative
.
NB. PEmpty
still requires Alternative
but you don't need to be an instance of PEmpty
(analogous to Semigroup)
Alternative m => PEmpty * (DistinctWhichReader m) (Which ([] Type)) Source #  
Applicative m => PPointed * (DistinctWhichReader m) (Which ([] Type)) Source #  
(Reinterpret b c, (~) [Type] (Complement Type c b) a, (~) [Type] (Complement Type c a) b, (~) [Type] c (Append Type a b)) => PAlternative * (DistinctWhichReader m) (Which a) (Which b) (Which c) Source #  
Monad m => Monad (DistinctWhichReader m r) Source #  
Functor m => Functor (DistinctWhichReader m r) Source #  
MonadFix m => MonadFix (DistinctWhichReader m r) Source #  
MonadFail m => MonadFail (DistinctWhichReader m r) Source #  
Applicative m => Applicative (DistinctWhichReader m r) Source #  
MonadZip m => MonadZip (DistinctWhichReader m r) Source #  
MonadIO m => MonadIO (DistinctWhichReader m r) Source #  
Alternative m => Alternative (DistinctWhichReader m r) Source #  
MonadPlus m => MonadPlus (DistinctWhichReader m r) Source #  
Generic (DistinctWhichReader m r a) Source #  
type Rep (DistinctWhichReader m r a) Source #  
newtype ManyReader m r a Source #
Given a Reader that accepts Many a
, and another Reader that accepts Many b
make a reader that accepts Many (AppendUnique a b)
with the compile time constraint that all the types in (AppendUnique a b) are distinct.
ManyReader  
