Safe Haskell  None 

Language  Haskell2010 
Validated values
Validated
is similar to Option
, with the difference that
Validated
does not guarantee that invalid values are not evaluated.
Therefore, Validated
should not be used to guard operations from illegal
use (e.g. array bounds checking).
Still, the operations try to defer evaluation of invalid values as much as possible.
Synopsis
 data Validated a = Validated (Data Bool) a
 validWhen :: Data Bool > a > Validated a
 invalid :: Syntax a => Validated a
 validated :: Syntax b => b > (a > b) > Validated a > b
 caseValidated :: Syntax b => Validated a > b > (a > b) > b
 fromValidated :: Syntax a => Validated a > a > a
 validatedM :: MonadComp m => m () > (a > m ()) > Validated a > m ()
 caseValidatedM :: MonadComp m => Validated a > m () > (a > m ()) > m ()
Documentation
A value that can be valid or invalid
Instances
Monad Validated Source #  
Functor Validated Source #  
Applicative Validated Source #  
Syntax a => Syntactic (Validated a) Source #  
Forcible a => Forcible (Validated a) Source # 

type Internal (Validated a) Source #  
Defined in Feldspar.Data.Validated  
type Domain (Validated a) Source #  
Defined in Feldspar.Data.Validated  
type ValueRep (Validated a) Source #  
validWhen :: Data Bool > a > Validated a Source #
Create a validated value. Note that the value may get evaluated even if the condition is false.
Deconstruct an Validated
value
Deconstruct an Validated
value
Deconstruct an Validated
value