comonad-4.2: Comonads

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

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

Create a Store using an accessor function and a stored value

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

The StoreT comonad transformer

data StoreT s w a Source

Constructors

StoreT (w (s -> a)) s 

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

Re-exported modules