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.
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 compile-time 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)
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 | |
|