spork-0.4.0: Catch errors from pure computations in a Maybe/Either
Copyright© 2009 Matt Morrow & Dan Peebles © 2013 Liyang HU © 2020 Kiara Grouwstra
Licensesee LICENSE
Maintainertycho01@pm.me
Stabilityexperimental
Portabilitynon-portable (Scoped Type Variables)
Safe HaskellNone
LanguageHaskell2010

Control.Spork

Description

Two functions for catching pureish exceptions in pure values. This library considers pureish to be any error call or undefined, failed pattern matches, arithmetic exceptions, and array bounds exceptions.

Synopsis

Documentation

spork :: NFData a => a -> Either String a Source #

Evaluate a value to normal form and return Left if any exceptions are thrown during evaluation. For any error-free value, spork = Right.

sporkWithHandles :: NFData a => Handles a -> a -> Either String a Source #

Evaluate a value to normal form and return Left if any exceptions are thrown during evaluation. For any error-free value, spork = Right.

teaspork :: a -> Either String a Source #

Like spork, but only evaluates to WHNF.