Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Automated effect elevator
- type Elevate f g = (Tower g, f ∈ Floors1 g)
- elevate :: Elevate f g => f a -> g a
- class Tower f where
- type Floors1 f = f : Floors f
- stairs1 :: Tower f => Gondola f :* Floors1 f
- newtype Gondola f g :: (k -> *) -> (k -> *) -> * = Gondola {
- runGondola :: forall a. g a -> f a
- rung :: (forall x. f x -> g x) -> (:*) (k -> *) (Gondola k g) fs -> (:*) (k -> *) (Gondola k g) ((:) (k -> *) f fs)
- data h :* s :: (k -> *) -> [k] -> * where
- (*++*) :: (:*) k h xs -> (:*) k h ys -> (:*) k h ((++) k xs ys)
- mapGondolas :: (forall x. m x -> n x) -> (Gondola m :* xs) -> Gondola n :* xs
- liftGondolas :: (Monad m, Tower m, MonadTrans t) => Gondola (t m) :* Floors1 m
- newtype Union xs a :: [k -> *] -> k -> * = Union {}
- reunion :: (:*) (k -> *) (Gondola k m) xs -> Union k xs a -> m a
Documentation
Construction kit
A class of types which have bases.
Nothing
Tower [] | |
Tower IO | |
Tower Maybe | |
Tower Identity | |
Tower ((->) r) | |
Tower (Either e) | |
Tower (ST s) | |
(Monad m, Tower m) => Tower (MaybeT m) | |
(Monad m, Tower m) => Tower (ListT m) | |
Generate (* -> *) xs => Tower (Union * xs) | |
(Monoid w, Monad m, Tower m) => Tower (WriterT w m) | |
(Monoid w, Monad m, Tower m) => Tower (WriterT w m) | |
(Monad m, Tower m) => Tower (StateT s m) | |
(Monad m, Tower m) => Tower (StateT s m) | |
(Monad m, Tower m) => Tower (ReaderT r m) | |
(Error e, Monad m, Tower m) => Tower (ErrorT e m) | |
(Monad m, Tower m, Monoid w) => Tower (RWST r w s m) | |
(Monad m, Tower m, Monoid w) => Tower (RWST r w s m) |
newtype Gondola f g :: (k -> *) -> (k -> *) -> *
Transformation between effects
Gondola | |
|
rung :: (forall x. f x -> g x) -> (:*) (k -> *) (Gondola k g) fs -> (:*) (k -> *) (Gondola k g) ((:) (k -> *) f fs) infixr 0
Add a new transformation.
data h :* s :: (k -> *) -> [k] -> * where
The type of extensible products.
Typeable ((k -> *) -> [k] -> *) ((:*) k) | |
WrapForall k * Eq h xs => Eq ((:*) k h xs) | |
(Eq ((:*) k h xs), WrapForall k * Ord h xs) => Ord ((:*) k h xs) | |
WrapForall k * Show h xs => Show ((:*) k h xs) | |
WrapForall k * Monoid h xs => Monoid ((:*) k h xs) | |
WrapForall k * Binary h xs => Binary ((:*) k h xs) |
liftGondolas :: (Monad m, Tower m, MonadTrans t) => Gondola (t m) :* Floors1 m Source
Open unions
newtype Union xs a :: [k -> *] -> k -> *