llvm-extra-0.12.0.1: Utility functions for the llvm interface
Safe HaskellSafe-Inferred
LanguageHaskell98

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

Instances

Instances details
Functor T Source # 
Instance details

Defined in LLVM.Extra.MaybePrivate

Methods

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

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

C a => C (T a) Source # 
Instance details

Defined in LLVM.Extra.Memory

Associated Types

type Struct (T a) Source #

Methods

load :: Value (Ptr (Struct (T a))) -> CodeGenFunction r (T a) Source #

store :: T a -> Value (Ptr (Struct (T a))) -> CodeGenFunction r () Source #

decompose :: Value (Struct (T a)) -> CodeGenFunction r (T a) Source #

compose :: T a -> CodeGenFunction r (Value (Struct (T a))) Source #

Phi a => Phi (T a) Source # 
Instance details

Defined in LLVM.Extra.MaybePrivate

Methods

phi :: BasicBlock -> T a -> CodeGenFunction r (T a) Source #

addPhi :: BasicBlock -> T a -> T a -> CodeGenFunction r () Source #

Undefined a => Undefined (T a) Source # 
Instance details

Defined in LLVM.Extra.MaybePrivate

Methods

undef :: T a Source #

type Struct (T a) Source # 
Instance details

Defined in LLVM.Extra.Memory

type Struct (T a) = Struct (Bool, (Struct a, ()))

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

counterpart to maybe

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

select :: Select a => T a -> a -> CodeGenFunction r a Source #

counterpart to fromMaybe with swapped arguments

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

fromBool :: Value Bool -> a -> T a Source #

counterpart to Data.Maybe.HT.toMaybe

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

just :: a -> 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 b Source #