graphted-0.3.1.0: Graph indexed monads.

Copyright(c) Aaron Friel
LicenseBSD-3
MaintainerAaron Friel <mayreply@aaronfriel.com>
Stabilityunstable | experimental | provisional | stable | frozen
Portabilityportable | non-portable (<reason>)
Safe HaskellSafe
LanguageHaskell2010

Data.Functor.Graph

Description

Synopsis

Documentation

class GFunctor f where Source #

Graph indexed functor.

Minimal complete definition

gmap

Associated Types

type Fmap f (i :: p) :: p Source #

The fmap operation (fmap) on the graph index.

Default instance: Fmap f i = i

type Replace f (i :: p) :: p Source #

The Replace operation (<$) on the graph index.

Default instance: Replace f i = Fmap f i

type EfficientReplace f :: Bool Source #

Methods

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

Map a function over over the functor (fmap).

greplace :: a -> f i b -> f (Replace f i) a Source #

Replace all values with a constant (<$).

Default implementation requires the default instance of Replace.

greplace :: Replace f i ~ Fmap f i => a -> f i b -> f (Replace f i) a Source #

Replace all values with a constant (<$).

Default implementation requires the default instance of Replace.

Instances

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

Associated Types

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

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

type EfficientReplace (GWrapped f) (f :: GWrapped f -> * -> *) :: Bool Source #

Methods

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

greplace :: a -> f i b -> f (Replace (GWrapped f) f i) a Source #

IxFunctor * * f => GFunctor (*, *) (WrappedIx f) Source # 

Associated Types

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

type Replace (WrappedIx f) (f :: WrappedIx f -> * -> *) (i :: WrappedIx f) :: p Source #

type EfficientReplace (WrappedIx f) (f :: WrappedIx f -> * -> *) :: Bool Source #

Methods

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

greplace :: a -> f i b -> f (Replace (WrappedIx f) f i) a Source #

class GFunctorReplace f Source #

This should only be implemented when the replace operation has a more efficient greplace than gmap . const.