Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
LLVM counterpart to Either
datatype.
Synopsis
- data T a b = Cons {}
- run :: Phi c => T a b -> (a -> CodeGenFunction r c) -> (b -> CodeGenFunction r c) -> CodeGenFunction r c
- getIsLeft :: T a b -> CodeGenFunction r (Value Bool)
- mapLeft :: (a0 -> a1) -> T a0 b -> T a1 b
- mapRight :: (b0 -> b1) -> T a b0 -> T a b1
- left :: Undefined b => a -> T a b
- right :: Undefined a => b -> T a b
Documentation
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.
Instances
(C a, C b) => C (T a b) Source # | |
Defined in LLVM.Extra.Memory | |
(Phi a, Phi b) => Phi (T a b) Source # | |
Defined in LLVM.Extra.EitherPrivate 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 # | |
Defined in LLVM.Extra.EitherPrivate | |
type Struct (T a b) Source # | |
run :: Phi c => T a b -> (a -> CodeGenFunction r c) -> (b -> CodeGenFunction r c) -> CodeGenFunction r c Source #
counterpart to either