comonads-fd-3.0.3: Comonad transformers using functional dependencies

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

Control.Comonad.Store

Contents

Description

 

Synopsis

ComonadStore class

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

Methods

pos :: w a -> sSource

peek :: s -> w a -> aSource

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

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

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

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

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