Safe Haskell | None |
---|
- newtype T a = Cons (Repr Value a)
- class C a where
- type Repr f a :: *
- cons :: a -> T a
- undef :: T a
- zero :: T a
- phis :: BasicBlock -> T a -> CodeGenFunction r (T a)
- addPhis :: BasicBlock -> T a -> T a -> CodeGenFunction r ()
- consPrimitive :: (IsConst al, Value al ~ Repr Value a) => al -> T a
- undefPrimitive :: (IsType al, Value al ~ Repr Value a) => T a
- zeroPrimitive :: (IsType al, Value al ~ Repr Value a) => T a
- phisPrimitive :: (IsFirstClass al, Value al ~ Repr Value a) => BasicBlock -> T a -> CodeGenFunction r (T a)
- addPhisPrimitive :: (IsFirstClass al, Value al ~ Repr Value a) => BasicBlock -> T a -> T a -> CodeGenFunction r ()
- consUnit :: Repr Value a ~ () => a -> T a
- undefUnit :: Repr Value a ~ () => T a
- zeroUnit :: Repr Value a ~ () => T a
- phisUnit :: Repr Value a ~ () => BasicBlock -> T a -> CodeGenFunction r (T a)
- addPhisUnit :: Repr Value a ~ () => BasicBlock -> T a -> T a -> CodeGenFunction r ()
- fst :: T (a, b) -> T a
- snd :: T (a, b) -> T b
- curry :: (T (a, b) -> c) -> T a -> T b -> c
- uncurry :: (T a -> T b -> c) -> T (a, b) -> c
- mapFst :: (T a0 -> T a1) -> T (a0, b) -> T (a1, b)
- mapSnd :: (T b0 -> T b1) -> T (a, b0) -> T (a, b1)
- swap :: T (a, b) -> T (b, a)
- fst3 :: T (a, b, c) -> T a
- snd3 :: T (a, b, c) -> T b
- thd3 :: T (a, b, c) -> T c
- mapFst3 :: (T a0 -> T a1) -> T (a0, b, c) -> T (a1, b, c)
- mapSnd3 :: (T b0 -> T b1) -> T (a, b0, c) -> T (a, b1, c)
- mapThd3 :: (T c0 -> T c1) -> T (a, b, c0) -> T (a, b, c1)
- zip :: T a -> T b -> T (a, b)
- zip3 :: T a -> T b -> T c -> T (a, b, c)
- zip4 :: T a -> T b -> T c -> T d -> T (a, b, c, d)
- unzip :: T (a, b) -> (T a, T b)
- unzip3 :: T (a, b, c) -> (T a, T b, T c)
- unzip4 :: T (a, b, c, d) -> (T a, T b, T c, T d)
- class Compose multituple where
- class Composed (Decomposed T pattern) ~ PatternTuple pattern => Decompose pattern where
- decompose :: pattern -> T (PatternTuple pattern) -> Decomposed T pattern
- type family Decomposed f pattern
- type family PatternTuple pattern
- modify :: (Compose a, Decompose pattern) => pattern -> (Decomposed T pattern -> a) -> T (PatternTuple pattern) -> T (Composed a)
- modify2 :: (Compose a, Decompose patternA, Decompose patternB) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> a) -> T (PatternTuple patternA) -> T (PatternTuple patternB) -> T (Composed a)
- modifyF :: (Compose a, Decompose pattern, Functor f) => pattern -> (Decomposed T pattern -> f a) -> T (PatternTuple pattern) -> f (T (Composed a))
- modifyF2 :: (Compose a, Decompose patternA, Decompose patternB, Functor f) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> f a) -> T (PatternTuple patternA) -> T (PatternTuple patternB) -> f (T (Composed a))
- data Atom a = Atom
- atom :: Atom a
- lift1 :: (Repr Value a -> Repr Value b) -> T a -> T b
- liftM0 :: Monad m => m (Repr Value a) -> m (T a)
- liftM :: Monad m => (Repr Value a -> m (Repr Value b)) -> T a -> m (T b)
- liftM2 :: Monad m => (Repr Value a -> Repr Value b -> m (Repr Value c)) -> T a -> T b -> m (T c)
- liftM3 :: Monad m => (Repr Value a -> Repr Value b -> Repr Value c -> m (Repr Value d)) -> T a -> T b -> T c -> m (T d)
- class C a => IntegerConstant a where
- fromInteger' :: Integer -> T a
- class IntegerConstant a => RationalConstant a where
- fromRational' :: Rational -> T a
- class C a => Additive a where
- add :: T a -> T a -> CodeGenFunction r (T a)
- sub :: T a -> T a -> CodeGenFunction r (T a)
- neg :: T a -> CodeGenFunction r (T a)
- class Additive a => PseudoRing a where
- mul :: T a -> T a -> CodeGenFunction r (T a)
- class PseudoRing a => Field a where
- fdiv :: T a -> T a -> CodeGenFunction r (T a)
- type family Scalar vector :: *
- class (PseudoRing (Scalar v), Additive v) => PseudoModule v where
- class Additive a => Real a where
- min :: T a -> T a -> CodeGenFunction r (T a)
- max :: T a -> T a -> CodeGenFunction r (T a)
- abs :: T a -> CodeGenFunction r (T a)
- signum :: T a -> CodeGenFunction r (T a)
- class Real a => Fraction a where
- truncate :: T a -> CodeGenFunction r (T a)
- fraction :: T a -> CodeGenFunction r (T a)
- class Field a => Algebraic a where
- sqrt :: T a -> CodeGenFunction r (T a)
- class Algebraic a => Transcendental a where
- pi :: CodeGenFunction r (T a)
- sin, log, exp, cos :: T a -> CodeGenFunction r (T a)
- pow :: T a -> T a -> CodeGenFunction r (T a)
- class C a => Select a where
- class Real a => Comparison a where
- cmp :: CmpPredicate -> T a -> T a -> CodeGenFunction r (T Bool)
- class Comparison a => FloatingComparison a where
- fcmp :: FPPredicate -> T a -> T a -> CodeGenFunction r (T Bool)
- class Logic a where
- and :: T a -> T a -> CodeGenFunction r (T a)
- or :: T a -> T a -> CodeGenFunction r (T a)
- xor :: T a -> T a -> CodeGenFunction r (T a)
- inv :: T a -> CodeGenFunction r (T a)
- class PseudoRing a => Integral a where
- idiv :: T a -> T a -> CodeGenFunction r (T a)
- irem :: T a -> T a -> CodeGenFunction r (T a)
Documentation
C T | |
C a => Phi (T a) | |
Select a => Select (T a) | |
C a => Zero (T a) | |
C a => Undefined (T a) | |
Transcendental a => Transcendental (T a) | |
Algebraic a => Algebraic (T a) | |
Logic a => Logic (T a) | |
FloatingComparison a => FloatingComparison (T a) | |
Comparison a => Comparison (T a) | |
Fraction a => Fraction (T a) | |
Real a => Real (T a) | |
RationalConstant a => RationalConstant (T a) | |
Field a => Field (T a) | |
IntegerConstant a => IntegerConstant (T a) | |
PseudoModule a => PseudoModule (T a) | |
PseudoRing a => PseudoRing (T a) | |
Additive a => Additive (T a) | |
Compose (T a) | |
C a => C (T a) |
phis :: BasicBlock -> T a -> CodeGenFunction r (T a)Source
addPhis :: BasicBlock -> T a -> T a -> CodeGenFunction r ()Source
phisPrimitive :: (IsFirstClass al, Value al ~ Repr Value a) => BasicBlock -> T a -> CodeGenFunction r (T a)Source
addPhisPrimitive :: (IsFirstClass al, Value al ~ Repr Value a) => BasicBlock -> T a -> T a -> CodeGenFunction r ()Source
phisUnit :: Repr Value a ~ () => BasicBlock -> T a -> CodeGenFunction r (T a)Source
addPhisUnit :: Repr Value a ~ () => BasicBlock -> T a -> T a -> CodeGenFunction r ()Source
class Composed (Decomposed T pattern) ~ PatternTuple pattern => Decompose pattern whereSource
decompose :: pattern -> T (PatternTuple pattern) -> Decomposed T patternSource
A nested unzip
.
Since it is not obvious how deep to decompose nested tuples,
you must provide a pattern of the decomposed tuple.
E.g.
f :: MultiValue ((a,b),(c,d)) -> ((MultiValue a, MultiValue b), MultiValue (c,d)) f = decompose ((atom,atom),atom)
type family Decomposed f pattern Source
type family PatternTuple pattern Source
modify :: (Compose a, Decompose pattern) => pattern -> (Decomposed T pattern -> a) -> T (PatternTuple pattern) -> T (Composed a)Source
modify2 :: (Compose a, Decompose patternA, Decompose patternB) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> a) -> T (PatternTuple patternA) -> T (PatternTuple patternB) -> T (Composed a)Source
modifyF :: (Compose a, Decompose pattern, Functor f) => pattern -> (Decomposed T pattern -> f a) -> T (PatternTuple pattern) -> f (T (Composed a))Source
modifyF2 :: (Compose a, Decompose patternA, Decompose patternB, Functor f) => patternA -> patternB -> (Decomposed T patternA -> Decomposed T patternB -> f a) -> T (PatternTuple patternA) -> T (PatternTuple patternB) -> f (T (Composed a))Source
liftM2 :: Monad m => (Repr Value a -> Repr Value b -> m (Repr Value c)) -> T a -> T b -> m (T c)Source
liftM3 :: Monad m => (Repr Value a -> Repr Value b -> Repr Value c -> m (Repr Value d)) -> T a -> T b -> T c -> m (T d)Source
class C a => IntegerConstant a whereSource
fromInteger' :: Integer -> T aSource
class IntegerConstant a => RationalConstant a whereSource
fromRational' :: Rational -> T aSource
class Additive a => PseudoRing a whereSource
class PseudoRing a => Field a whereSource
class (PseudoRing (Scalar v), Additive v) => PseudoModule v whereSource
class Real a => Fraction a whereSource
truncate :: T a -> CodeGenFunction r (T a)Source
fraction :: T a -> CodeGenFunction r (T a)Source
class Algebraic a => Transcendental a whereSource
class Real a => Comparison a whereSource
cmp :: CmpPredicate -> T a -> T a -> CodeGenFunction r (T Bool)Source
It must hold
max x y == do gt <- cmp CmpGT x y; select gt x y
class Comparison a => FloatingComparison a whereSource
fcmp :: FPPredicate -> T a -> T a -> CodeGenFunction r (T Bool)Source