Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Utility functions for Kleisli arrows
- foreverK :: Monad m => (a -> m a) -> a -> m b
- replicateK :: Monad m => Int -> (a -> m a) -> a -> m a
- liftK :: (Monad m, MonadTrans t) => (a -> m b) -> a -> t m b
- hoistK :: (Monad m, MFunctor t) => (forall a. m a -> n a) -> (b' -> t m b) -> b' -> t n b
- raiseK :: (Monad m, MFunctor t1, MonadTrans t2) => (q -> t1 m r) -> q -> t1 (t2 m) r
Core utility functions
replicateK :: Monad m => Int -> (a -> m a) -> a -> m a Source #
Repeat a 'K
'leisli arrow multiple times
liftK :: (Monad m, MonadTrans t) => (a -> m b) -> a -> t m b Source #
Convenience function equivalent to (lift .)
liftK f >=> liftK g = liftK (f >=> g) liftK return = return
hoistK :: (Monad m, MFunctor t) => (forall a. m a -> n a) -> (b' -> t m b) -> b' -> t n b Source #
Convenience function equivalent to (hoist f .)
hoistK f p1 >-> hoistK f p2 = hoistK f (p1 >-> p2) hoistK f idT = idT
hoistK f p1 >=> hoistK f p2 = hoistK f (p1 >=> p2) hoistK f return = return
hoistK f . hoistK g = hoistK (f . g) hoistK id = id