feldspar-language-0.6.0.2: A functional embedded language for DSP and parallelism

Safe HaskellNone

Feldspar.Option

Contents

Synopsis

Documentation

data Option a Source

Constructors

Option 

Fields

isSome :: Data Bool
 
fromSome :: a
 

Instances

desugarOption :: Type a => Option (Data a) -> Data (Bool, a)Source

One-layer desugaring of Option

sugarOption :: Type a => Data (Bool, a) -> Option (Data a)Source

One-layer sugaring of Option

some :: a -> Option aSource

option :: Syntax b => b -> (a -> b) -> Option a -> bSource

oplus :: Syntax a => Option a -> Option a -> Option aSource

Conditional choice operator

(?>) :: Data Bool -> a -> Option aSource

Conditional choice operator. Can be used together with <? to write guarded choices as follows:

 prog :: Data Index -> Data Index
 prog a
     =  a+1 <? a==0
     ?> a+2 <? a==1
     ?> a+3 <? a==2
     ?> a+4 <? a==3
     ?> a+5

(<?) :: Syntax a => a -> Option a -> aSource