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

LLVM.Extra.Either

Description

LLVM counterpart to Either datatype.

Synopsis

Documentation

data T a b Source #

If isRight, then fromLeft is an undefTuple. If not isRight, then fromRight is an undefTuple. I would prefer a union type, but it was temporarily removed in LLVM-2.8 and did not return since then.

Constructors

Cons 

Fields

Instances

Instances details
(C a, C b) => C (T a b) Source # 
Instance details

Defined in LLVM.Extra.Memory

Associated Types

type Struct (T a b) Source #

Methods

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

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

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

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

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

Defined in LLVM.Extra.EitherPrivate

Methods

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

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

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

Defined in LLVM.Extra.EitherPrivate

Methods

undef :: T a b Source #

type Struct (T a b) Source # 
Instance details

Defined in LLVM.Extra.Memory

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

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

counterpart to either

mapLeft :: (a0 -> a1) -> T a0 b -> T a1 b Source #

mapRight :: (b0 -> b1) -> T a b0 -> T a b1 Source #

left :: Undefined b => a -> T a b Source #

right :: Undefined a => b -> T a b Source #