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

LLVM.Extra.Iterator

Synopsis

Documentation

data T r a Source #

Simulates a non-strict list.

Instances

Instances details
Applicative (T r) Source #

ZipList semantics

Instance details

Defined in LLVM.Extra.Iterator

Methods

pure :: a -> T r a #

(<*>) :: T r (a -> b) -> T r a -> T r b #

liftA2 :: (a -> b -> c) -> T r a -> T r b -> T r c #

(*>) :: T r a -> T r b -> T r b #

(<*) :: T r a -> T r b -> T r a #

Functor (T r) Source # 
Instance details

Defined in LLVM.Extra.Iterator

Methods

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

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

consumers

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

mapState_ :: Phi t => (a -> t -> CodeGenFunction r t) -> T r a -> t -> CodeGenFunction r t Source #

mapStateM_ :: Phi t => (a -> StateT t (CodeGenFunction r) ()) -> T r a -> StateT t (CodeGenFunction r) () Source #

mapWhileState_ :: Phi t => (a -> t -> CodeGenFunction r (Value Bool, t)) -> T r a -> t -> CodeGenFunction r t Source #

producers

empty :: T r a Source #

singleton :: a -> T r a Source #

cons :: (Phi a, Undefined a) => a -> T r a -> T r a Source #

iterate :: (Phi a, Undefined a) => (a -> CodeGenFunction r a) -> a -> T r a Source #

Attention: This always performs one function call more than necessary. I.e. if f reads from or writes to memory make sure that accessing one more pointer is legal.

countDown :: (Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> T r (Value i) Source #

arrayPtrs :: IsType a => Value (Ptr a) -> T r (Value (Ptr a)) Source #

storableArrayPtrs :: C a => Value (Ptr a) -> T r (Value (Ptr a)) Source #

modifiers

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

mapMaybe :: (Phi b, Undefined b) => (a -> CodeGenFunction r (T b)) -> T r a -> T r b Source #

catMaybes :: (Phi a, Undefined a) => T r (T a) -> T r a Source #

takeWhileJust :: T r (T a) -> T r a Source #

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

cartesian :: (Phi a, Phi b, Undefined a, Undefined b) => T r a -> T r b -> T r (a, b) Source #

take :: (Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> T r a -> T r a Source #

application examples

fixedLengthLoop :: (Phi s, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> s -> (s -> CodeGenFunction r s) -> CodeGenFunction r s Source #

arrayLoop :: (Phi a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr b) -> a -> (Value (Ptr b) -> a -> CodeGenFunction r a) -> CodeGenFunction r a Source #

arrayLoopWithExit :: (Phi s, IsType a, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> s -> (Value (Ptr a) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s) Source #

arrayLoop2 :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, IsPrimitive i) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r s) -> CodeGenFunction r s Source #