- data OpenWitness s a
- data RealWorld
- type IOWitness = OpenWitness RealWorld
- newIOWitness :: forall a. IO (IOWitness a)
- data OW s a
- newOpenWitnessOW :: forall s a. OW s (OpenWitness s a)
- runOW :: forall a. (forall s. OW s a) -> a
- owToIO :: OW RealWorld a -> IO a
- unsafeIOWitnessFromString :: String -> IOWitness a
Documentation
data OpenWitness s a Source
A witness type that can witness to any type.
But values cannot be constructed; they can only be generated in IO
and certain other monads.
SimpleWitness (OpenWitness s) | |
Eq (OpenWitness s a) |
type IOWitness = OpenWitness RealWorldSource
An OpenWitness
for IO
.
A runnable monad in which OpenWitness
values can be generated.
The s
parameter plays the same role as it does in ST
, preventing OpenWitness
values from one run being used in another.
newOpenWitnessOW :: forall s a. OW s (OpenWitness s a)Source
Generate a new OpenWitness
in OW
.
unsafeIOWitnessFromString :: String -> IOWitness aSource
In the absence of open witness declarations, an unsafe hack to generate IOWitness
values.
This is safe if you use a different string each time (and hashString
doesn't collide), and if a
is a single type.