Safe Haskell | None |
---|
- data T r a = forall s . Phi s => Cons s (forall z. Phi z => s -> T r z (a, s))
- mapM_ :: (a -> CodeGenFunction r ()) -> T r a -> CodeGenFunction r ()
- mapState_ :: Phi t => (a -> t -> CodeGenFunction r t) -> T r a -> t -> CodeGenFunction r t
- mapStateM_ :: Phi t => (a -> StateT t (CodeGenFunction r) ()) -> T r a -> StateT t (CodeGenFunction r) ()
- mapWhileState_ :: Phi t => (a -> t -> CodeGenFunction r (Value Bool, t)) -> T r a -> t -> CodeGenFunction r t
- empty :: T r a
- singleton :: a -> T r a
- mapM :: (a -> CodeGenFunction r b) -> T r a -> T r b
- mapMaybe :: (Phi b, Undefined b) => (a -> CodeGenFunction r (T b)) -> T r a -> T r b
- catMaybes :: (Phi a, Undefined a) => T r (T a) -> T r a
- takeWhile :: (a -> CodeGenFunction r (Value Bool)) -> T r a -> T r a
- iterate :: Phi a => (a -> CodeGenFunction r a) -> a -> T r a
- maybeFromCont :: a -> T r (T a) a -> CodeGenFunction r (T a)
- cartesianAux :: (Phi a, Phi b, Undefined a, Undefined b) => T r a -> T r b -> T r (T (a, b))
- cartesian :: (Phi a, Phi b, Undefined a, Undefined b) => T r a -> T r b -> T r (a, b)
- countDown :: (Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> T r (Value i)
- take :: (Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> T r a -> T r a
- arrayPtrs :: IsType a => Value (Ptr a) -> T r (Value (Ptr a))
- fixedLengthLoop :: (Phi s, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> s -> (s -> CodeGenFunction r s) -> CodeGenFunction r s
- arrayLoop :: (Phi a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> Value (Ptr b) -> a -> (Value (Ptr b) -> a -> CodeGenFunction r a) -> CodeGenFunction r a
- arrayLoopWithExit :: (Phi s, IsType a, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> Value (Ptr a) -> s -> (Value (Ptr a) -> s -> CodeGenFunction r (Value Bool, s)) -> CodeGenFunction r (Value i, s)
- arrayLoop2 :: (Phi s, IsType a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> Value (Ptr a) -> Value (Ptr b) -> s -> (Value (Ptr a) -> Value (Ptr b) -> s -> CodeGenFunction r s) -> CodeGenFunction r s
Documentation
Simulates a non-strict list.
Functor (T r) | |
Applicative (T r) |
|
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 tSource
iterate :: Phi a => (a -> CodeGenFunction r a) -> a -> T r aSource
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.
maybeFromCont :: a -> T r (T a) a -> CodeGenFunction r (T a)Source
This is MaybeCont.toMaybe' where (
constraint
is replaced by a custom value.
This way, we do not need Undefined
a)Undefined
constraint in T
.
On the other hand, an LLVM-undefined value would enable more LLVM optimizations.
helper functions
countDown :: (Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> T r (Value i)Source
take :: (Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> T r a -> T r aSource
examples
fixedLengthLoop :: (Phi s, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> s -> (s -> CodeGenFunction r s) -> CodeGenFunction r sSource
arrayLoop :: (Phi a, IsType b, Num i, IsConst i, IsInteger i, CmpRet i, CmpResult i ~ Bool) => Value i -> Value (Ptr b) -> a -> (Value (Ptr b) -> a -> CodeGenFunction r a) -> CodeGenFunction r aSource