nf-1.0.1.0: NF data type to statically enforce normal form

Copyright(c) Stanford University 2015
LicenseBSD-style (see the file LICENSE)
Maintainerezyang@cs.stanford.edu
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.NF.Internal

Description

This module provides the constructor for the type NF, allowing you to create values of type NF without any runtime overhead if you fulfill a proof obligation that the value is already in normal form.

Synopsis

Documentation

newtype NF a Source

NF is an abstract data type representing data which has been evaluated to normal form. Specifically, if a value of type NF a is in weak head normal form, then it is in reduced normal form; alternatively, it is only necessary to seq an NF a to assure that it is fully evaluated.

Constructors

UnsafeNF a

For UnsafeNF x to preserve the NF invariant, you must show that UnsafeNF x == deepseq x (UnsafeNF x).

Instances

Eq a => Eq (NF a) 
Ord a => Ord (NF a) 
NFData (NF a) 
Typeable (* -> *) NF