forsyde-shallow-3.4.0.0: ForSyDe's Haskell-embedded Domain Specific Language.

Copyright(c) ForSyDe Group KTH 2007-2008
LicenseBSD-style (see the file LICENSE)
Maintainerforsyde-dev@ict.kth.se
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

ForSyDe.Shallow.Core.AbsentExt

Description

The AbstExt is used to extend existing data types with the value 'absent', which models the absence of a value.

Synopsis

Documentation

data AbstExt a Source #

The data type AbstExt has two constructors. The constructor Abst is used to model the absence of a value, while the constructor Prst is used to model present values.

Constructors

Abst 
Prst a 
Instances
Functor AbstExt Source # 
Instance details

Defined in ForSyDe.Shallow.Core.AbsentExt

Methods

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

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

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

Defined in ForSyDe.Shallow.Core.AbsentExt

Methods

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

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

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

Defined in ForSyDe.Shallow.Core.AbsentExt

Show a => Show (AbstExt a) Source #

The data type AbstExt is defined as an instance of Show and Read. '_' represents the value Abst while a present value is represented with its value, e.g. Prst 1 is represented as '1'.

Instance details

Defined in ForSyDe.Shallow.Core.AbsentExt

Methods

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

show :: AbstExt a -> String #

showList :: [AbstExt a] -> ShowS #

fromAbstExt :: a -> AbstExt a -> a Source #

The function fromAbstExt converts a value from a extended value.

abstExt :: a -> AbstExt a Source #

The function abstExt converts a usual value to a present value.

psi :: (a -> b) -> AbstExt a -> AbstExt b Source #

The function psi is identical to abstExtFunc and should be used in future.

isAbsent :: AbstExt a -> Bool Source #

The functions isAbsent checks for the absence of a value.

isPresent :: AbstExt a -> Bool Source #

The functions isPresent checks for the presence of a value.

abstExtFunc :: (a -> b) -> AbstExt a -> AbstExt b Source #

The function abstExtFunc extends a function in order to process absent extended values. If the input is ("bottom"), the output will also be ("bottom").