Synopsis

# Documentation

newtype Ix (m :: Type -> Type) i j a Source #

The free indexed monad generated from a monad m. Users are not expected to use Ix directly, but to newtype over it, specializing the kinds of i and j as necessary.

GeneralizedNewtypeDeriving can be used to get the instances of IxFunctor, IxPointed, IxApplicative, IxMonad, IxMonadZero and IxMonadPlus for free.

Constructors

 Ix FieldsrunIx :: m a
Instances
 Functor m => IxFunctor (Ix m :: k -> k1 -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsimap :: (a -> b) -> Ix m j k2 a -> Ix m j k2 b # Monad m => IxMonad (Ix m :: k -> k -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsibind :: (a -> Ix m j k1 b) -> Ix m i j a -> Ix m i k1 b # MonadPlus m => IxMonadZero (Ix m :: k -> k -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsimzero :: Ix m i j a # MonadPlus m => IxMonadPlus (Ix m :: k -> k -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsimplus :: Ix m i j a -> Ix m i j a -> Ix m i j a # Applicative m => IxApplicative (Ix m :: k -> k -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsiap :: Ix m i j (a -> b) -> Ix m j k1 a -> Ix m i k1 b # Applicative m => IxPointed (Ix m :: k -> k -> Type -> *) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsireturn :: a -> Ix m i i a # Monad m => Monad (Ix m i j) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methods(>>=) :: Ix m i j a -> (a -> Ix m i j b) -> Ix m i j b #(>>) :: Ix m i j a -> Ix m i j b -> Ix m i j b #return :: a -> Ix m i j a #fail :: String -> Ix m i j a # Functor m => Functor (Ix m i j) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodsfmap :: (a -> b) -> Ix m i j a -> Ix m i j b #(<\$) :: a -> Ix m i j b -> Ix m i j a # Applicative m => Applicative (Ix m i j) Source # Instance detailsDefined in Control.Monad.Trans.Ix Methodspure :: a -> Ix m i j a #(<*>) :: Ix m i j (a -> b) -> Ix m i j a -> Ix m i j b #liftA2 :: (a -> b -> c) -> Ix m i j a -> Ix m i j b -> Ix m i j c #(*>) :: Ix m i j a -> Ix m i j b -> Ix m i j b #(<*) :: Ix m i j a -> Ix m i j b -> Ix m i j a #

liftIx :: m a -> Ix m i i a Source #

Lift an m action into 'Ix m', maintaining the current index.

unsafeLiftIx :: m a -> Ix m i j a Source #

Lift an m action into 'Ix m', changing the current index. unsafeLiftIx is obviously unsafe due to the fact that it can arbitrarily change the index.