graphted-0.3.1.0: Graph indexed monads.

Copyright(c) Aaron Friel
LicenseBSD-3
MaintainerAaron Friel <mayreply@aaronfriel.com>
Stabilityunstable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Graph

Description

 

Synopsis

Documentation

class GApplicative m => GMonad m where Source #

Graph indexed monad.

Minimal complete definition

gbind

Associated Types

type Bind m (i :: p) (j :: p) :: p Source #

The apply operation (>>=) on the graph index.

Default instance: Bind m i j = Combine m i j

type BindInv m (i :: p) (j :: p) :: Constraint Source #

An invariant on the indexes of Bind.

Default instance: BindInv m i j = Inv m i j

type Join m (i :: p) (j :: p) :: p Source #

The join operation (join) on the graph index.

Default instance: Join m i j = Bind m i j

type JoinInv m (i :: p) (j :: p) :: Constraint Source #

An invariant on the indexes of Join.

Default instance: JoinInv m i j = BindInv m i j

Methods

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

Sequentially compose two actions, with the second dependent on the first.

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

Remove one level of nested structure.

Default implementation requires the default instance of Join.

gjoin :: (Bind m i j ~ Join m i j, BindInv m i j) => m i (m j b) -> m (Join m i j) b Source #

Remove one level of nested structure.

Default implementation requires the default instance of Join.

Instances

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

Associated Types

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

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

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

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

Methods

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

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

IxMonad * m => GMonad (*, *) (WrappedIx m) Source # 

Associated Types

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

type BindInv (WrappedIx m) (m :: WrappedIx m -> * -> *) (i :: WrappedIx m) (j :: WrappedIx m) :: Constraint Source #

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

type JoinInv (WrappedIx m) (m :: WrappedIx m -> * -> *) (i :: WrappedIx m) (j :: WrappedIx m) :: Constraint Source #

Methods

gbind :: BindInv (WrappedIx m) m i j => m i a -> (a -> m j b) -> m (Bind (WrappedIx m) m i j) b Source #

gjoin :: JoinInv (WrappedIx m) m i j => m i (m j b) -> m (Join (WrappedIx m) m i j) b Source #