ForSyDe-3.0: ForSyDe's Haskell-embedded Domain Specific Language.Source codeContentsIndex
ForSyDe.AbsentExt
Portabilityportable
Stabilityexperimental
Maintainerforsyde-dev@ict.kth.se
Description
The AbstExt is used to extend existing data types with the value 'absent', which models the absence of a value.
Synopsis
data AbstExt a
= Abst
| Prst a
fromAbstExt :: a -> AbstExt a -> a
unsafeFromAbstExt :: AbstExt a -> a
abstExt :: a -> AbstExt a
psi :: (a -> b) -> AbstExt a -> AbstExt b
isAbsent :: AbstExt a -> Bool
isPresent :: AbstExt a -> Bool
abstExtFunc :: (a -> b) -> AbstExt a -> AbstExt b
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
show/hide Instances
Typeable1 AbstExt
Eq a => Eq (AbstExt a)
Data a => Data (AbstExt a)
Read a => Read (AbstExt a)
Show a => Show (AbstExt a)
Lift a[a9SJO] => Lift (AbstExt a[a9SJO])
ProcType a => ProcType (AbstExt a)
fromAbstExtSource
::
=> aDefault value returned if the input is Abst
-> AbstExt a
-> a
The function fromAbstExt extracts the inner value contained in AbstExt
unsafeFromAbstExt :: AbstExt a -> aSource
Similar to fromAbstExt, but without default value
abstExt :: a -> AbstExt aSource
The function abstExt converts a usual value to a present value.
psi :: (a -> b) -> AbstExt a -> AbstExt bSource
The function psi is identical to abstExtFunc and should be used in future.
isAbsent :: AbstExt a -> BoolSource
The functions isAbsent checks for the absence of a value.
isPresent :: AbstExt a -> BoolSource
The functions isPresent checks for the presence of a value.
abstExtFunc :: (a -> b) -> AbstExt a -> AbstExt bSource
The function abstExtFunc extends a function in order to process absent extended values. If the input is ("bottom"), the output will also be ("bottom").
Produced by Haddock version 2.1.0