graphted-0.1.0.2: Graph indexed monads.

Copyright (c) Aaron Friel BSD-3 Aaron Friel unstable portable Safe Haskell2010

Control.Applicative.Graph

Description

Synopsis

# Documentation

class (GFunctor f, GPointed f) => GApplicative f where Source #

Graph indexed applicative functor.

Minimal complete definition

gap

Associated Types

type Apply f (i :: p) (j :: p) :: p Source #

The apply operation (<*>) on the graph index.

Default instance: Apply f i j = Combine f i j

type Then f (i :: p) (j :: p) :: p Source #

The then operation (*>) on the graph index.

Default instance: Then f i j = Apply f (Fconst f i) j

type But f (i :: p) (j :: p) :: p Source #

The but operation (<*) on the graph index.

Default instance: But f i j = Apply f (Apply f (Pure f) i) j

Methods

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

Sequential application (<*>).

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

Sequence actions, discarding the value of the first argument (*>).

Default implementation requires the default instance of Then.

gthen :: (Apply f (Fconst f i) j ~ Then f i j, Inv f (Fconst f i) j) => f i a -> f j b -> f (Then f i j) b Source #

Sequence actions, discarding the value of the first argument (*>).

Default implementation requires the default instance of Then.

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

Sequence actions, discarding values of the second argument (<*).

Default implementation requires the default instance of But.

gbut :: (Apply f (Apply f (Pure f) i) j ~ But f i j, Inv f (Pure f) i, Inv f (Apply f (Pure f) i) j) => f i a -> f j b -> f (But f i j) a Source #

Sequence actions, discarding values of the second argument (<*).

Default implementation requires the default instance of But.

Instances

 Source # Associated Typestype 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 # Methodsgap :: 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 #