Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data Exp a
- class Value (val :: Type -> Type)
- lift0 :: Value val => T a -> val a
- lift1 :: Value val => (T a -> T b) -> val a -> val b
- lift2 :: Value val => (T a -> T b -> T c) -> val a -> val b -> val c
- lift3 :: Value val => (T a -> T b -> T c -> T d) -> val a -> val b -> val c -> val d
- lift4 :: Value val => (T a -> T b -> T c -> T d -> T e) -> val a -> val b -> val c -> val d -> val e
- liftM :: Aggregate ae am => (forall r. am -> CodeGenFunction r (T b)) -> ae -> Exp b
- liftM2 :: (Aggregate ae am, Aggregate be bm) => (forall r. am -> bm -> CodeGenFunction r (T c)) -> ae -> be -> Exp c
- liftM3 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm) => (forall r. am -> bm -> cm -> CodeGenFunction r (T d)) -> ae -> be -> ce -> Exp d
- unliftM1 :: (Aggregate ae am, Aggregate be bm) => (ae -> be) -> am -> CodeGenFunction r bm
- unliftM2 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm) => (ae -> be -> ce) -> am -> bm -> CodeGenFunction r cm
- unliftM3 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm, Aggregate de dm) => (ae -> be -> ce -> de) -> am -> bm -> cm -> CodeGenFunction r dm
- liftReprM :: (forall r. Repr a -> CodeGenFunction r (Repr b)) -> Exp a -> Exp b
- liftReprM2 :: (forall r. Repr a -> Repr b -> CodeGenFunction r (Repr c)) -> Exp a -> Exp b -> Exp c
- liftReprM3 :: (forall r. Repr a -> Repr b -> Repr c -> CodeGenFunction r (Repr d)) -> Exp a -> Exp b -> Exp c -> Exp 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)
- mapPair :: (Exp a0 -> Exp a1, Exp b0 -> Exp b1) -> Exp (a0, b0) -> Exp (a1, b1)
- 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)
- mapTriple :: (Exp a0 -> Exp a1, Exp b0 -> Exp b1, Exp c0 -> Exp c1) -> Exp (a0, b0, c0) -> Exp (a1, b1, c1)
- tuple :: Exp tuple -> Exp (Tuple tuple)
- untuple :: Exp (Tuple tuple) -> Exp tuple
- 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
- fromFastMath :: Exp (Number flags a) -> Exp a
- toFastMath :: Exp a -> Exp (Number flags 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
Instances
Value Exp | |
(Transcendental a, Real a, RationalConstant a) => Floating (Exp a) | |
(PseudoRing a, Real a, IntegerConstant a) => Num (Exp a) | |
(Field a, Real a, RationalConstant a) => Fractional (Exp a) | |
Compose (Exp a) | |
(Real a, PseudoRing a, IntegerConstant a) => C (Exp a) | |
Additive a => C (Exp a) | We do not require a numeric prelude superclass, thus also LLVM only types like vectors are instances. |
(Transcendental a, RationalConstant a) => C (Exp a) | |
(Field a, RationalConstant a) => C (Exp a) | |
(PseudoRing a, IntegerConstant a) => C (Exp a) | |
(Transcendental a, RationalConstant a) => C (Exp a) | |
Aggregate (Exp a) (T a) | |
Defined in LLVM.DSL.Expression type MultiValuesOf (Exp a) # type ExpressionsOf (T a) # | |
(a ~ Scalar v, PseudoModule v, IntegerConstant a) => C (Exp a) (Exp v) | |
type Composed (Exp a) | |
Defined in LLVM.DSL.Expression | |
type MultiValuesOf (Exp a) | |
Defined in LLVM.DSL.Expression |
lift4 :: Value val => (T a -> T b -> T c -> T d -> T e) -> val a -> val b -> val c -> val d -> val e #
liftM2 :: (Aggregate ae am, Aggregate be bm) => (forall r. am -> bm -> CodeGenFunction r (T c)) -> ae -> be -> Exp c #
liftM3 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm) => (forall r. am -> bm -> cm -> CodeGenFunction r (T d)) -> ae -> be -> ce -> Exp d #
unliftM1 :: (Aggregate ae am, Aggregate be bm) => (ae -> be) -> am -> CodeGenFunction r bm #
unliftM2 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm) => (ae -> be -> ce) -> am -> bm -> CodeGenFunction r cm #
unliftM3 :: (Aggregate ae am, Aggregate be bm, Aggregate ce cm, Aggregate de dm) => (ae -> be -> ce -> de) -> am -> bm -> cm -> CodeGenFunction r dm #
liftReprM2 :: (forall r. Repr a -> Repr b -> CodeGenFunction r (Repr c)) -> Exp a -> Exp b -> Exp c #
liftReprM3 :: (forall r. Repr a -> Repr b -> Repr c -> CodeGenFunction r (Repr d)) -> Exp a -> Exp b -> Exp c -> Exp d #
mapTriple :: (Exp a0 -> Exp a1, Exp b0 -> Exp b1, Exp c0 -> Exp c1) -> Exp (a0, b0, c0) -> Exp (a1, b1, 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 #
Instances
Compose () | |
Compose a => Compose (Complex a) | |
Compose n => Compose (Cyclic n) Source # | |
(Enum enum, Bounded enum) => Compose (Enumeration enum) Source # | |
Defined in Data.Array.Knead.Shape.Orphan type Composed (Enumeration enum) # compose :: Enumeration enum -> Exp (Composed (Enumeration enum)) # | |
Compose n => Compose (ZeroBased n) Source # | |
Compose (Exp a) | |
Compose tuple => Compose (Tuple tuple) | |
(Compose sh, Composed sh ~ T (Tag (Composed sh)) (Rank (Composed sh)), Compose s, Composed s ~ Int) => Compose (sh :. s) Source # | |
(Compose a, Compose b) => Compose (a, b) | |
(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 where #
decompose :: pattern -> Exp (PatternTuple pattern) -> Decomposed Exp pattern #
Analogous to decompose
.
Instances
modify :: (Compose a, Decompose pattern) => pattern -> (Decomposed Exp pattern -> a) -> Exp (PatternTuple pattern) -> Exp (Composed a) #
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) #
consComplex :: Exp a -> Exp a -> Exp (Complex a) #
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 a #
fromInteger' :: IntegerConstant a => Integer -> Exp a #
fromRational' :: RationalConstant a => Rational -> Exp a #
intFromBool8 :: NativeInteger i ir => Exp Bool8 -> Exp i #
floatFromBool8 :: NativeFloating a ar => Exp Bool8 -> Exp a #
fromFastMath :: Exp (Number flags a) -> Exp a #
toFastMath :: Exp a -> Exp (Number flags a) #
cmp :: Comparison a => CmpPredicate -> Exp a -> Exp a -> Exp Bool #
select :: Select a => Exp Bool -> Exp a -> Exp a -> Exp a #
Like ifThenElse
but computes both alternative expressions
and then uses LLVM's efficient select
instruction.
complement :: Logic a => Exp a -> Exp a #