open-witness-0.1.1: open witnesses

Data.OpenWitness.Exception

Synopsis

Documentation

type Exn = IOWitnessSource

A key to match exceptions. The type variable is the data the exception carries.

unsafeExnFromString :: String -> Exn eSource

In the absence of open witness declarations, an unsafe hack to generate Exn exception keys. This is safe if you use a different string each time (and hashString doesn't collide), and if e is a single type.

throw :: Exn e -> e -> aSource

catch :: IO a -> Exn e -> (e -> IO a) -> IO aSource