Synopsis

# Documentation

newtype T (i :: Morph * *) a Source #

Implements Bob Atkey's 'parametric monads', and also the Control.Monad.Indexed package, by emulating indexing by morphisms

Data type of morphisms

Constructors

 T a

Instances

 Source # Associated Typestype Unit T (m :: T -> * -> *) :: k Source #type Plus T (m :: T -> * -> *) (f :: T) (g :: T) :: k Source #type Inv T (m :: T -> * -> *) (f :: T) (g :: T) :: Constraint Source # Methodsreturn :: a -> m (Unit T m) a Source #(>>=) :: Inv T m f g => m f a -> (a -> m g b) -> m (Plus T m f g) b Source #(>>) :: Inv T m f g => m f a -> m g b -> m (Plus T m f g) b Source # type Unit (Morph * *) T Source # type Unit (Morph * *) T = Id * * type Plus (Morph * *) T (Id * *) (M * * a b) Source # type Plus (Morph * *) T (Id * *) (M * * a b) = M * * a b type Plus (Morph * *) T (M * * a b) (Id * *) Source # type Plus (Morph * *) T (M * * a b) (Id * *) = M * * a b type Plus (Morph * *) T (M * * a b) (M * * c d) Source # type Plus (Morph * *) T (M * * a b) (M * * c d) = M * * a d type Inv (Morph * *) T (M * * a b) (M * * c d) Source # type Inv (Morph * *) T (M * * a b) (M * * c d) = (~) * c d

data Morph a b Source #

Data type denoting either a morphisms with source and target types, or identity

Constructors

 M a b Id

Instances

 Source # Associated Typestype Unit T (m :: T -> * -> *) :: k Source #type Plus T (m :: T -> * -> *) (f :: T) (g :: T) :: k Source #type Inv T (m :: T -> * -> *) (f :: T) (g :: T) :: Constraint Source # Methodsreturn :: a -> m (Unit T m) a Source #(>>=) :: Inv T m f g => m f a -> (a -> m g b) -> m (Plus T m f g) b Source #(>>) :: Inv T m f g => m f a -> m g b -> m (Plus T m f g) b Source # type Unit (Morph * *) T Source # type Unit (Morph * *) T = Id * * type Plus (Morph * *) T (Id * *) (M * * a b) Source # type Plus (Morph * *) T (Id * *) (M * * a b) = M * * a b type Plus (Morph * *) T (M * * a b) (Id * *) Source # type Plus (Morph * *) T (M * * a b) (Id * *) = M * * a b type Plus (Morph * *) T (M * * a b) (M * * c d) Source # type Plus (Morph * *) T (M * * a b) (M * * c d) = M * * a d type Inv (Morph * *) T (M * * a b) (M * * c d) Source # type Inv (Morph * *) T (M * * a b) (M * * c d) = (~) * c d