-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Monads of program skeleta
--   
--   Fast operational monad library
@package monad-skeleton
@version 0.1.4

module Control.Monad.Zombie.Internal
data Cat k a b
[Empty] :: Cat k a a
[Leaf] :: k a b -> Cat k a b
[Tree] :: Cat k a b -> Cat k b c -> Cat k a c
transCat :: (forall x y. j x y -> k x y) -> Cat j a b -> Cat k a b
(|>) :: Cat k a b -> k b c -> Cat k a c
viewL :: forall k a b r. Cat k a b -> ((a ~ b) => r) -> (forall x. k a x -> Cat k x b -> r) -> r
instance forall k (k1 :: k -> k -> *). Control.Category.Category (Control.Monad.Zombie.Internal.Cat k1)

module Control.Monad.Skeleton.Internal
data Cat k a b
[Leaf] :: k a b -> Cat k a b
[Tree] :: Cat k a b -> Cat k b c -> Cat k a c
transCat :: (forall x y. j x y -> k x y) -> Cat j a b -> Cat k a b
(|>) :: Cat k a b -> k b c -> Cat k a c
viewL :: forall k a b r. Cat k a b -> (k a b -> r) -> (forall x. k a x -> Cat k x b -> r) -> r
transKleisli :: (m b -> n b) -> Kleisli m a b -> Kleisli n a b

module Control.Monad.Skeleton

-- | A deconstructed action
data MonadView t m x
[Return] :: a -> MonadView t m a
[:>>=] :: !(t a) -> (a -> m b) -> MonadView t m b

-- | Transform the action and the continuation.
hoistMV :: (forall x. s x -> t x) -> (m a -> n a) -> MonadView s m a -> MonadView t n a

-- | Join <a>MonadView</a> recursively.
iterMV :: Monad m => (t a -> MonadView m t a) -> t a -> m a

-- | <tt><a>Skeleton</a> t</tt> is a monadic skeleton (operational monad)
--   made out of <tt>t</tt>. Skeletons can be fleshed out by getting
--   transformed to other monads. It provides O(1) (<a>&gt;&gt;=</a>) and
--   <a>debone</a>, the monadic reflection.
data Skeleton t a
[ReturnS] :: a -> Skeleton t a
[BindS] :: t a -> Cat (Kleisli (Skeleton t)) a b -> Skeleton t b

-- | A skeleton that has only one bone.
bone :: t a -> Skeleton t a

-- | Pick a bone from a <a>Skeleton</a>.
debone :: Skeleton t a -> MonadView t (Skeleton t) a

-- | Uncommon synonym for <a>debone</a>.

-- | <i>Deprecated: Use debone instead</i>
unbone :: Skeleton t a -> MonadView t (Skeleton t) a

-- | Re-add a bone.
boned :: MonadView t (Skeleton t) a -> Skeleton t a

-- | Lift a transformation between bones into transformation between
--   skeletons.
hoistSkeleton :: forall s t a. (forall x. s x -> t x) -> Skeleton s a -> Skeleton t a
instance GHC.Base.Functor m => GHC.Base.Functor (Control.Monad.Skeleton.MonadView t m)
instance GHC.Base.Functor (Control.Monad.Skeleton.Skeleton t)
instance GHC.Base.Applicative (Control.Monad.Skeleton.Skeleton t)
instance GHC.Base.Monad (Control.Monad.Skeleton.Skeleton t)

module Control.Monad.Zombie

-- | The spine of skeleta.
data Spine t m a
[Spine] :: MonadView t m a -> Cat (Kleisli m) a b -> Spine t m b

-- | Extend a spine.
graftSpine :: Cat (Kleisli m) a b -> Spine t m a -> Spine t m b

-- | <a>Zombie</a> is a variant of <a>Skeleton</a> which has an
--   <a>Alternative</a> instance.
newtype Zombie t a
Zombie :: [Spine t (Zombie t) a] -> Zombie t a
[unZombie] :: Zombie t a -> [Spine t (Zombie t) a]

-- | Lift a unit action
liftZ :: t a -> Zombie t a

-- | Turn a decomposed form into a composed form.
embalm :: MonadView t (Zombie t) a -> Zombie t a

-- | Decompose a zombie as a list of possibilities.
disembalm :: Zombie t a -> [MonadView t (Zombie t) a]

-- | Like <a>hoistSkeleton</a>
hoistZombie :: forall s t a. (forall x. s x -> t x) -> Zombie s a -> Zombie t a
instance GHC.Base.Functor (Control.Monad.Zombie.Zombie t)
instance GHC.Base.Applicative (Control.Monad.Zombie.Zombie t)
instance GHC.Base.Alternative (Control.Monad.Zombie.Zombie t)
instance GHC.Base.Monad (Control.Monad.Zombie.Zombie t)
instance GHC.Base.MonadPlus (Control.Monad.Zombie.Zombie t)
