graphted-0.1.0.1: Graph indexed monads.

LicenseBSD-3
MaintainerAaron Friel <mayreply@aaronfriel.com>
Stabilityunstable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.GWrapped

Description

 

Documentation

newtype GWrapped m p a Source #

Constructors

GWrapped 

Fields

Instances

Functor f => GFunctor * (GWrapped f) Source # 

Associated Types

type Fmap (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) :: p Source #

type Fconst (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) :: p Source #

Methods

gmap :: (a -> b) -> f i a -> f (Fmap (GWrapped f) f i) b Source #

gconst :: a -> f i b -> f (Fconst (GWrapped f) f i) a Source #

Graphted * (GWrapped m) Source # 

Associated Types

type Unit (GWrapped m) (f :: GWrapped m -> * -> *) :: p Source #

type Inv (GWrapped m) (f :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: Constraint Source #

type Combine (GWrapped m) (f :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: p Source #

Applicative f => GPointed * (GWrapped f) Source # 

Associated Types

type Pure (GWrapped f) (f :: GWrapped f -> * -> *) :: p Source #

Methods

gpoint' :: a -> f t a Source #

gpoint :: a -> f (Pure (GWrapped f) f) a Source #

Applicative f => GApplicative * (GWrapped f) Source # 

Associated Types

type Apply (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) (j :: GWrapped f) :: p Source #

type Then (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) (j :: GWrapped f) :: p Source #

type But (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) (j :: GWrapped f) :: p Source #

Methods

gap :: Inv (GWrapped f) f i j => f i (a -> b) -> f j a -> f (Apply (GWrapped f) f i j) b Source #

gthen :: Inv (GWrapped f) f i j => f i a -> f j b -> f (Then (GWrapped f) f i j) b Source #

gbut :: Inv (GWrapped f) f i j => f i a -> f j b -> f (But (GWrapped f) f i j) a Source #

Monad m => GMonad * (GWrapped m) Source # 

Associated Types

type Bind (GWrapped m) (m :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: p Source #

type Join (GWrapped m) (m :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: p Source #

Methods

gbind :: Inv (GWrapped m) m i j => m i a -> (a -> m j b) -> m (Bind (GWrapped m) m i j) b Source #

gjoin :: Inv (GWrapped m) m i j => m i (m j b) -> m (Join (GWrapped m) m i j) b Source #

MonadPlus m => GMonadZero * (GWrapped m) Source # 

Associated Types

type Zero (GWrapped m) (m :: GWrapped m -> * -> *) :: p Source #

Methods

gzero :: m (Zero (GWrapped m) m) a Source #

Monad m => GMonadFail * (GWrapped m) Source # 

Associated Types

type Fail (GWrapped m) (m :: GWrapped m -> * -> *) :: p Source #

Methods

gfail :: String -> m (Fail (GWrapped m) m) a Source #

(Alternative m, MonadPlus m) => GMonadOr * (GWrapped m) Source # 

Associated Types

type Or (GWrapped m) (m :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: p Source #

Methods

gorelse :: m i a -> m j a -> m (Or (GWrapped m) m i j) a Source #

MonadPlus m => GMonadPlus * (GWrapped m) Source # 

Associated Types

type Plus (GWrapped m) (m :: GWrapped m -> * -> *) (i :: GWrapped m) (j :: GWrapped m) :: p Source #

Methods

gplus :: m i a -> m j a -> m (Plus (GWrapped m) m i j) a Source #

type Unit * (GWrapped _) Source # 
type Unit * (GWrapped _) = ()
type Pure * (GWrapped f) Source # 
type Pure * (GWrapped f) = Unit * (GWrapped f)
type Zero * (GWrapped m) Source # 
type Zero * (GWrapped m) = Unit * (GWrapped m)
type Fail * (GWrapped m) Source # 
type Fail * (GWrapped m) = Unit * (GWrapped m)
type Fmap * (GWrapped f) i Source # 
type Fmap * (GWrapped f) i = i
type Fconst * (GWrapped f) i Source # 
type Fconst * (GWrapped f) i = Fmap * (GWrapped f) i
type Inv * (GWrapped _) i j Source # 
type Inv * (GWrapped _) i j = (~~) * * i j
type Combine * (GWrapped _) i j Source # 
type Combine * (GWrapped _) i j = i
type Apply * (GWrapped f) i j Source # 
type Apply * (GWrapped f) i j = Combine * (GWrapped f) i j
type Then * (GWrapped f) i j Source # 
type Then * (GWrapped f) i j = Apply * (GWrapped f) (Fconst * (GWrapped f) i) j
type But * (GWrapped f) i j Source # 
type But * (GWrapped f) i j = Apply * (GWrapped f) (Apply * (GWrapped f) (Pure * (GWrapped f)) i) j
type Bind * (GWrapped m) i j Source # 
type Bind * (GWrapped m) i j = Combine * (GWrapped m) i j
type Join * (GWrapped m) i j Source # 
type Join * (GWrapped m) i j = Bind * (GWrapped m) i j
type Or * (GWrapped m) i j Source # 
type Or * (GWrapped m) i j = Combine * (GWrapped m) i j
type Plus * (GWrapped m) i j Source # 
type Plus * (GWrapped m) i j = Combine * (GWrapped m) i j

unM :: GWrapped m p a -> m a Source #

liftG :: m a -> GWrapped m () a Source #