Tainted-0.1.0.2: Tainted type, and associated operations
CopyrightRoss Meikleham
LicenseBSD-style
MaintainerRossMeikleham@hotmail.co.uk
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
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 

Instances

Instances details
Applicative Tainted Source # 
Instance details

Defined in Data.Tainted

Methods

pure :: a -> Tainted a #

(<*>) :: Tainted (a -> b) -> Tainted a -> Tainted b #

liftA2 :: (a -> b -> c) -> Tainted a -> Tainted b -> Tainted c #

(*>) :: Tainted a -> Tainted b -> Tainted b #

(<*) :: Tainted a -> Tainted b -> Tainted a #

Functor Tainted Source # 
Instance details

Defined in Data.Tainted

Methods

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

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

Monad Tainted Source # 
Instance details

Defined in Data.Tainted

Methods

(>>=) :: Tainted a -> (a -> Tainted b) -> Tainted b #

(>>) :: Tainted a -> Tainted b -> Tainted b #

return :: a -> Tainted a #

Read a => Read (Tainted a) Source # 
Instance details

Defined in Data.Tainted

Show a => Show (Tainted a) Source # 
Instance details

Defined in Data.Tainted

Methods

showsPrec :: Int -> Tainted a -> ShowS #

show :: Tainted a -> String #

showList :: [Tainted a] -> ShowS #

Eq a => Eq (Tainted a) Source # 
Instance details

Defined in Data.Tainted

Methods

(==) :: Tainted a -> Tainted a -> Bool #

(/=) :: Tainted a -> Tainted a -> Bool #

Ord a => Ord (Tainted a) Source # 
Instance details

Defined in Data.Tainted

Methods

compare :: Tainted a -> Tainted a -> Ordering #

(<) :: Tainted a -> Tainted a -> Bool #

(<=) :: Tainted a -> Tainted a -> Bool #

(>) :: Tainted a -> Tainted a -> Bool #

(>=) :: Tainted a -> Tainted a -> Bool #

max :: Tainted a -> Tainted a -> Tainted a #

min :: Tainted a -> Tainted a -> Tainted 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.