graphted-0.3.0.0: Graph indexed monads.

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

Data.Pointed.Graph

Description

 

Synopsis

Documentation

class GPointed f where Source #

Graph indexed pointed functor.

Minimal complete definition

gpure'

Associated Types

type Pure f :: p Source #

The pure element of the graph index.

type PureCxt f (i :: p) :: Constraint Source #

A constraint on generating a pure index from a free variable. Default is empty.

Methods

gpure :: forall a. a -> f (Pure f) a Source #

Return a pointed functor indexed by the Pure type instance (pure).

>>> :t gpure @_ @(GWrapped Maybe) "Hello, World"
:: GWrapped Maybe () [Char]

gpure :: PureCxt f (Pure f) => a -> f (Pure f) a Source #

Return a pointed functor indexed by the Pure type instance (pure).

>>> :t gpure @_ @(GWrapped Maybe) "Hello, World"
:: GWrapped Maybe () [Char]

gpure' :: forall t a. PureCxt f t => a -> f t a Source #

Return a pointed functor indexed by a type t in the domain of p.

Accessible with type applications, e.g.:

>>> :t gpure' @_ @(GWrapped Maybe) @Int
gpure' @_ @(GWrapped Maybe) @Int :: a -> GWrapped Maybe Int a

Instances

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

Associated Types

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

type PureCxt (GWrapped f) (f :: GWrapped f -> * -> *) (i :: GWrapped f) :: Constraint Source #

Methods

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

gpure' :: PureCxt (GWrapped f) f t => a -> f t a Source #

IxPointed * f => GPointed (*, *) (WrappedIx f) Source # 

Associated Types

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

type PureCxt (WrappedIx f) (f :: WrappedIx f -> * -> *) (i :: WrappedIx f) :: Constraint Source #

Methods

gpure :: a -> f (Pure (WrappedIx f) f) a Source #

gpure' :: PureCxt (WrappedIx f) f t => a -> f t a Source #

gpureAt :: forall t a f. (GPointed f, PureCxt f t) => a -> f t a Source #

Return a pointed functor with a given type in the index.

Accessible with type applications, e.g.:

>>> :t gpureAt @Int
gpureAt @Int :: (GPointed f, PureCxt f Int) => a -> f Int a