comonad-4.2.7.2: Comonads

Copyright(C) 2008-2014 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable (fundeps, MPTCs)
Safe HaskellSafe
LanguageHaskell2010

Control.Comonad.Store

Contents

Description

 

Synopsis

ComonadStore class

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

Minimal complete definition

pos, peek

Methods

pos :: w a -> s Source

peek :: s -> w a -> a Source

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

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

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

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

Instances

The Store comonad

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

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 

Instances

ComonadEnv e w => ComonadEnv e (StoreT t w) 
Comonad w => ComonadStore s (StoreT s w) 
ComonadTraced m w => ComonadTraced m (StoreT s w) 
ComonadTrans (StoreT s) 
ComonadHoist (StoreT s) 
Functor w => Functor (StoreT s w) 
(Applicative w, Monoid s) => Applicative (StoreT s w) 
(ComonadApply w, Semigroup s) => ComonadApply (StoreT s w) 
Comonad w => Comonad (StoreT s w) 
Typeable (* -> (* -> *) -> * -> *) StoreT 

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

Re-exported modules