comonads-fd-3.0.1: Comonad transformers using functional dependencies

Portabilitynon-portable (fundeps, MPTCs)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellNone

Control.Comonad.Store

Contents

Description

 

Synopsis

ComonadStore class

class Comonad w => ComonadStore s w | w -> s where

Methods

pos :: w a -> s

peek :: s -> w a -> a

peeks :: (s -> s) -> w a -> a

seek :: s -> w a -> w a

seeks :: (s -> s) -> w a -> w a

experiment :: Functor f => (s -> f s) -> w a -> f a

Instances

The Store comonad

type Store s = StoreT s Identity

store :: (s -> a) -> s -> Store s a

Create a Store using an accessor function and a stored value

runStore :: Store s a -> (s -> a, s)

The StoreT comonad transformer

data StoreT s w a

Constructors

StoreT (w (s -> a)) s 

Instances

runStoreT :: StoreT s w a -> (w (s -> a), s)

Re-exported modules