Safe Haskell | None |
---|
- newtype Exp a = Exp {
- unExp :: forall r. CodeGenFunction r (T a)
- class Value val where
- liftM :: (forall r. T a -> CodeGenFunction r (T b)) -> Exp a -> Exp b
- liftM2 :: (forall r. T a -> T b -> CodeGenFunction r (T c)) -> Exp a -> Exp b -> Exp c
- liftM3 :: (forall r. T a -> T b -> T c -> CodeGenFunction r (T d)) -> Exp a -> Exp b -> Exp c -> Exp d
- unliftM1 :: (Exp a -> Exp b) -> T a -> CodeGenFunction r (T b)
- unliftM2 :: (Exp a -> Exp b -> Exp c) -> T a -> T b -> CodeGenFunction r (T c)
- unliftM3 :: (Exp a -> Exp b -> Exp c -> Exp d) -> T a -> T b -> T c -> CodeGenFunction r (T d)
- zip :: Value val => val a -> val b -> val (a, b)
- zip3 :: Value val => val a -> val b -> val c -> val (a, b, c)
- zip4 :: Value val => val a -> val b -> val c -> val d -> val (a, b, c, d)
- unzip :: Value val => val (a, b) -> (val a, val b)
- unzip3 :: Value val => val (a, b, c) -> (val a, val b, val c)
- unzip4 :: Value val => val (a, b, c, d) -> (val a, val b, val c, val d)
- fst :: Value val => val (a, b) -> val a
- snd :: Value val => val (a, b) -> val b
- mapFst :: (Exp a -> Exp b) -> Exp (a, c) -> Exp (b, c)
- mapSnd :: (Exp b -> Exp c) -> Exp (a, b) -> Exp (a, c)
- swap :: Value val => val (a, b) -> val (b, a)
- curry :: (Exp (a, b) -> c) -> Exp a -> Exp b -> c
- uncurry :: (Exp a -> Exp b -> c) -> Exp (a, b) -> c
- fst3 :: Value val => val (a, b, c) -> val a
- snd3 :: Value val => val (a, b, c) -> val b
- thd3 :: Value val => val (a, b, c) -> val c
- mapFst3 :: (Exp a0 -> Exp a1) -> Exp (a0, b, c) -> Exp (a1, b, c)
- mapSnd3 :: (Exp b0 -> Exp b1) -> Exp (a, b0, c) -> Exp (a, b1, c)
- mapThd3 :: (Exp c0 -> Exp c1) -> Exp (a, b, c0) -> Exp (a, b, c1)
- modifyMultiValue :: (Value val, Compose a, Decompose pattern, PatternTuple pattern ~ tuple) => pattern -> (Decomposed T pattern -> a) -> val tuple -> val (Composed a)
- modifyMultiValue2 :: (Value val, Compose a, Decompose patternA, Decompose patternB, PatternTuple patternA ~ tupleA, PatternTuple patternB ~ tupleB) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> a) -> val tupleA -> val tupleB -> val (Composed a)
- modifyMultiValueM :: (Compose a, Decompose pattern, PatternTuple pattern ~ tuple) => pattern -> (forall r. Decomposed T pattern -> CodeGenFunction r a) -> Exp tuple -> Exp (Composed a)
- modifyMultiValueM2 :: (Compose a, Decompose patternA, Decompose patternB, PatternTuple patternA ~ tupleA, PatternTuple patternB ~ tupleB) => patternA -> patternB -> (forall r. Decomposed T patternA -> Decomposed T patternB -> CodeGenFunction r a) -> Exp tupleA -> Exp tupleB -> Exp (Composed a)
- class Compose multituple where
- class Composed (Decomposed Exp pattern) ~ PatternTuple pattern => Decompose pattern where
- decompose :: pattern -> Exp (PatternTuple pattern) -> Decomposed Exp pattern
- modify :: (Compose a, Decompose pattern) => pattern -> (Decomposed Exp pattern -> a) -> Exp (PatternTuple pattern) -> Exp (Composed a)
- modify2 :: (Compose a, Decompose patternA, Decompose patternB) => patternA -> patternB -> (Decomposed Exp patternA -> Decomposed Exp patternB -> a) -> Exp (PatternTuple patternA) -> Exp (PatternTuple patternB) -> Exp (Composed a)
- consComplex :: Exp a -> Exp a -> Exp (Complex a)
- deconsComplex :: Exp (Complex a) -> (Exp a, Exp a)
- cons :: C a => a -> Exp a
- unit :: Exp ()
- zero :: C a => Exp a
- add :: Additive a => Exp a -> Exp a -> Exp a
- sub :: Additive a => Exp a -> Exp a -> Exp a
- mul :: PseudoRing a => Exp a -> Exp a -> Exp a
- sqr :: PseudoRing a => Exp a -> Exp a
- sqrt :: Algebraic a => Exp a -> Exp a
- idiv :: Integral a => Exp a -> Exp a -> Exp a
- irem :: Integral a => Exp a -> Exp a -> Exp a
- shl :: BitShift a => Exp a -> Exp a -> Exp a
- shr :: BitShift a => Exp a -> Exp a -> Exp a
- fromInteger' :: IntegerConstant a => Integer -> Exp a
- fromRational' :: RationalConstant a => Rational -> Exp a
- boolPFrom8 :: Exp Bool8 -> Exp Bool
- bool8FromP :: Exp Bool -> Exp Bool8
- intFromBool8 :: NativeInteger i ir => Exp Bool8 -> Exp i
- floatFromBool8 :: NativeFloating a ar => Exp Bool8 -> Exp a
- minBound :: Bounded a => Exp a
- maxBound :: Bounded a => Exp a
- cmp :: Comparison a => CmpPredicate -> Exp a -> Exp a -> Exp Bool
- (==*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- (<=*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- (>*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- (>=*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- (<*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- (/=*) :: Comparison a => Exp a -> Exp a -> Exp Bool
- min :: Real a => Exp a -> Exp a -> Exp a
- max :: Real a => Exp a -> Exp a -> Exp a
- true :: Exp Bool
- false :: Exp Bool
- (&&*) :: Exp Bool -> Exp Bool -> Exp Bool
- (||*) :: Exp Bool -> Exp Bool -> Exp Bool
- not :: Exp Bool -> Exp Bool
- select :: Select a => Exp Bool -> Exp a -> Exp a -> Exp a
- ifThenElse :: C a => Exp Bool -> Exp a -> Exp a -> Exp a
- complement :: Logic a => Exp a -> Exp a
- (.&.*) :: Logic a => Exp a -> Exp a -> Exp a
- (.|.*) :: Logic a => Exp a -> Exp a -> Exp a
- xor :: Logic a => Exp a -> Exp a -> Exp a
- toMaybe :: Exp Bool -> Exp a -> Exp (Maybe a)
- maybe :: C b => Exp b -> (Exp a -> Exp b) -> Exp (Maybe a) -> Exp b
Documentation
Exp | |
|
Value Exp | |
(Field a, Real a, RationalConstant a) => Fractional (Exp a) | |
(PseudoRing a, Real a, IntegerConstant a) => Num (Exp a) | |
Compose (Exp a) | |
(C a, Storable a) => Argument (Exp a) | |
(C a, Storable a) => C (Exp a) |
liftM3 :: (forall r. T a -> T b -> T c -> CodeGenFunction r (T d)) -> Exp a -> Exp b -> Exp c -> Exp dSource
unliftM3 :: (Exp a -> Exp b -> Exp c -> Exp d) -> T a -> T b -> T c -> CodeGenFunction r (T d)Source
modifyMultiValue :: (Value val, Compose a, Decompose pattern, PatternTuple pattern ~ tuple) => pattern -> (Decomposed T pattern -> a) -> val tuple -> val (Composed a)Source
modifyMultiValue2 :: (Value val, Compose a, Decompose patternA, Decompose patternB, PatternTuple patternA ~ tupleA, PatternTuple patternB ~ tupleB) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> a) -> val tupleA -> val tupleB -> val (Composed a)Source
modifyMultiValueM :: (Compose a, Decompose pattern, PatternTuple pattern ~ tuple) => pattern -> (forall r. Decomposed T pattern -> CodeGenFunction r a) -> Exp tuple -> Exp (Composed a)Source
modifyMultiValueM2 :: (Compose a, Decompose patternA, Decompose patternB, PatternTuple patternA ~ tupleA, PatternTuple patternB ~ tupleB) => patternA -> patternB -> (forall r. Decomposed T patternA -> Decomposed T patternB -> CodeGenFunction r a) -> Exp tupleA -> Exp tupleB -> Exp (Composed a)Source
class Compose multituple whereSource
Compose () | |
Compose a => Compose (Complex a) | |
Compose n => Compose (ZeroBased n) | |
(Enum enum, Bounded enum) => Compose (Enumeration enum) | |
Compose (Exp a) | |
(Compose a, Compose b) => Compose (a, b) | |
(Compose sh, ~ * (Composed sh) (T (Tag (Composed sh)) (Unwrap (Composed sh))), Compose s) => Compose (:. sh s) | |
(Compose a, Compose b, Compose c) => Compose (a, b, c) | |
(Compose a, Compose b, Compose c, Compose d) => Compose (a, b, c, d) |
class Composed (Decomposed Exp pattern) ~ PatternTuple pattern => Decompose pattern whereSource
decompose :: pattern -> Exp (PatternTuple pattern) -> Decomposed Exp patternSource
Analogous to decompose
.
Decompose () | |
Decompose p => Decompose (Complex p) | |
Decompose pn => Decompose (ZeroBased pn) | |
Decompose (Enumeration enum) | |
Decompose (Atom a) | |
(Decompose pa, Decompose pb) => Decompose (pa, pb) | |
Decompose tag sh => Decompose (T tag sh) | |
(Decompose pa, Decompose pb, Decompose pc) => Decompose (pa, pb, pc) | |
(Decompose pa, Decompose pb, Decompose pc, Decompose pd) => Decompose (pa, pb, pc, pd) |
modify :: (Compose a, Decompose pattern) => pattern -> (Decomposed Exp pattern -> a) -> Exp (PatternTuple pattern) -> Exp (Composed a)Source
Analogus to modifyMultiValue
.
modify2 :: (Compose a, Decompose patternA, Decompose patternB) => patternA -> patternB -> (Decomposed Exp patternA -> Decomposed Exp patternB -> a) -> Exp (PatternTuple patternA) -> Exp (PatternTuple patternB) -> Exp (Composed a)Source
consComplex :: Exp a -> Exp a -> Exp (Complex a)Source
You can construct complex numbers this way, but they will not make you happy, because the numeric operations require a RealFloat instance that we could only provide with lots of undefined methods (also in its superclasses). You may either define your own arithmetic or use the NumericPrelude type classes.
sqr :: PseudoRing a => Exp a -> Exp aSource
fromInteger' :: IntegerConstant a => Integer -> Exp aSource
fromRational' :: RationalConstant a => Rational -> Exp aSource
intFromBool8 :: NativeInteger i ir => Exp Bool8 -> Exp iSource
floatFromBool8 :: NativeFloating a ar => Exp Bool8 -> Exp aSource
cmp :: Comparison a => CmpPredicate -> Exp a -> Exp a -> Exp BoolSource
select :: Select a => Exp Bool -> Exp a -> Exp a -> Exp aSource
Like ifThenElse
but computes both alternative expressions
and then uses LLVM's efficient select
instruction.
complement :: Logic a => Exp a -> Exp aSource