Tainted-0.0.1: Tainted type, and associated operations

CopyrightRoss Meikleham
LicenseBSD-style
MaintainerRossMeikleham@hotmail.co.uk
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Tainted

Description

The Tainted type, and associated operations.

Synopsis

Documentation

data Tainted a Source

The Tainted type encapsulates a value. A value of type Tainted a either contains a "clean" value of type a (represented as Clean a), or it contains a "dirty" value of type a (represented as Dirty a).

The Tainted type is also a monad. Once the "dirty" state has been reached, and clean operations performed themselves create a "dirty" value.

Constructors

Dirty a 
Clean a 

isClean :: Tainted a -> Bool Source

Returns True iff its argument is of the form 'Clean _.

isDirty :: Tainted a -> Bool Source

Returns True iff its argument is of the form Dirty _.

cleans :: [Tainted a] -> [a] Source

Extracts from a list of Tainted all the Clean elements. All the Clean elements are extracted in order.

dirtys :: [Tainted a] -> [a] Source

Extracts from a list of Tainted all the Dirty elements. All the Dirty elements are extracted in order.

partitionTaints :: [Tainted a] -> ([a], [a]) Source

Partitions a list of Tainted into two lists. All the Dirty elements are extracted, in order, to the first component of the output. Similarly the Clean elements are extracted to the second component of the output.