Module

Control.Comonad.Transformerless.Store

Package
purescript-transformerless
Repository
thimoteus/purescript-transformerless

#Store Source

data Store s a

Constructors

Instances

#runStore Source

runStore :: forall a s. Store s a -> Tuple (s -> a) s

#store Source

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

#peek Source

peek :: forall a s. s -> Store s a -> a
  1. Law: peek (pos x) x = extract x
  2. Proof:
  3. RHS := extract (f, s) = f s
  4. LHS := peek (pos (f, s)) (f, s) =
  5. peek s (f, s) =
  6. peek s (f, _) = f s

#pos Source

pos :: forall a s. Store s a -> s
  1. Law: pos (extend _ x) = pos x
  2. Proof:
  3. RHS := pos (_, s)
  4. LHS := pos (extend _ (f, s)) =
  5. pos (extend _ (_, s)) =
  6. pos (_, s)