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

Minimal complete definition

pos, peek

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 

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

Re-exported modules