oalg-base-1.1.4.0: Algebraic structures on oriented entities and limits as a tool kit to solve algebraic problems.
Copyright(c) Erich Gut
LicenseBSD3
Maintainerzerich.gut@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

OAlg.Control.HNFData

Description

reducing a value to head normal form. This is much weaker then Control.DeepSeq.

Synopsis

Documentation

data HNFValue x Source #

values in head normal form.

Constructors

HNFValue x 
forall e.Exception e => Failure e 

Instances

Instances details
Functor HNFValue Source # 
Instance details

Defined in OAlg.Control.HNFData

Methods

fmap :: (a -> b) -> HNFValue a -> HNFValue b #

(<$) :: a -> HNFValue b -> HNFValue a #

Show x => Show (HNFValue x) Source # 
Instance details

Defined in OAlg.Control.HNFData

Methods

showsPrec :: Int -> HNFValue x -> ShowS #

show :: HNFValue x -> String #

showList :: [HNFValue x] -> ShowS #

fromHNFValue :: HNFValue x -> x Source #

from head normal form.

Property Let x' be in HNFValue x then holds:

  1. If x' matches HNFValue x then the result of fromHNFValue x' is x.
  2. If x' matches Failure e then evaluation fromHNFValue x' will end up in a throwing e.

class HNFData x where Source #

data reducible to head normal form.

Methods

rhnf :: x -> () Source #

tries to reduce a value to its head normal form, throwing an Exception for undefined values.

Instances

Instances details
HNFData Statement Source # 
Instance details

Defined in OAlg.Data.Statement.Definition

Methods

rhnf :: Statement -> () Source #

HNFData () Source # 
Instance details

Defined in OAlg.Control.HNFData

Methods

rhnf :: () -> () Source #

HNFData Bool Source # 
Instance details

Defined in OAlg.Control.HNFData

Methods

rhnf :: Bool -> () Source #

HNFData (X x) Source # 
Instance details

Defined in OAlg.Data.X

Methods

rhnf :: X x -> () Source #

HNFData [x] Source # 
Instance details

Defined in OAlg.Control.HNFData

Methods

rhnf :: [x] -> () Source #

hnfValue :: HNFData x => x -> IO (HNFValue x) Source #

tries to reduce a value x to its head normal form. If the reduction ends up in a SomeException e then this will be catched and Failure e will be returned, otherwise @HNFValue will be returned.