open-witness-0.1: open witnesses

Data.OpenWitness

Synopsis

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.

Instances

data RealWorld Source

The s type for running OW in IO.

newIOWitness :: forall a. IO (IOWitness a)Source

Generate a new IOWitness in IO.

data OW s a Source

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.

Instances

Monad (OW s) 
Functor (OW s) 
MonadFix (OW s) 

newOpenWitnessOW :: forall s a. OW s (OpenWitness s a)Source

Generate a new OpenWitness in OW.

runOW :: forall a. (forall s. OW s a) -> aSource

Run an OW computation.

owToIO :: OW RealWorld a -> IO aSource

Run an OW computation in IO.

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.