graphted-0.1.0.2: 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 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

Methods

gbind :: Inv 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 :: Inv 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, Inv 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 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 #