Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Squishy s a
- runSquishy :: forall a. (forall s. Squishy s a) -> a
- data Identifier s
- data Distinct s a
- distinguish :: a -> Squishy s (Distinct s a)
- conflate :: Distinct s a -> a
- identify :: Distinct s a -> Identifier s
- data Ref s a
- newRef :: a -> Squishy s (Ref s a)
- readRef :: Ref s a -> Squishy s a
- writeRef :: Ref s a -> a -> Squishy s ()
- modifyRef :: Ref s a -> (a -> a) -> Squishy s ()
Documentation
The Squishy monad is a monad with mutable references and optional reference identity
runSquishy :: forall a. (forall s. Squishy s a) -> a Source
Runs a Squishy computation, returning a pure value
data Identifier s Source
A unique identifier. Only possible to create while making a Distinct value.
Eq (Identifier s) | |
Ord (Identifier s) |
Data with faked reference equality; the interface provided guarantees that every Distinct value has a unique Identifier.
distinguish :: a -> Squishy s (Distinct s a) Source
The only way to create a Distinct value is to generate a new identifier for it in the Squishy monad.
identify :: Distinct s a -> Identifier s Source
Extracts the unique identifier for a Distinct