llvm-extra-0.7.3: Utility functions for the llvm interface

Safe HaskellNone

LLVM.Extra.Maybe

Description

LLVM counterpart to Maybe datatype.

Synopsis

Documentation

data T a Source

If isJust = False, then fromJust is an undefTuple.

Constructors

Cons 

Fields

isJust :: Value Bool
 
fromJust :: a
 

Instances

Functor T 
Phi a => Phi (T a) 
Undefined a => Undefined (T a) 
C a => C (T a) 

run :: Phi b => T a -> CodeGenFunction r b -> (a -> CodeGenFunction r b) -> CodeGenFunction r bSource

counterpart to maybe

for :: T a -> (a -> CodeGenFunction r ()) -> CodeGenFunction r ()Source

select :: Select a => T a -> a -> CodeGenFunction r aSource

counterpart to fromMaybe with swapped arguments

alternative :: Select a => T a -> T a -> CodeGenFunction r (T a)Source

fromBool :: Value Bool -> a -> T aSource

counterpart to Data.Maybe.HT.toMaybe

toBool :: T a -> (Value Bool, a)Source

getIsNothing :: T a -> CodeGenFunction r (Value Bool)Source

just :: a -> T aSource

sequence :: T (CodeGenFunction r a) -> CodeGenFunction r (T a)Source

traverse :: (a -> CodeGenFunction r b) -> T a -> CodeGenFunction r (T b)Source

lift2 :: (a -> b -> c) -> T a -> T b -> CodeGenFunction r (T c)Source

liftM2 :: (a -> b -> CodeGenFunction r c) -> T a -> T b -> CodeGenFunction r (T c)Source

loopWithExit :: Phi a => a -> (a -> CodeGenFunction r (T c, b)) -> ((c, b) -> CodeGenFunction r a) -> CodeGenFunction r bSource