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 ()
- boolPFrom8 :: T Bool8 -> T Bool
- bool8FromP :: T Bool -> T Bool8
- intFromBool8 :: NativeInteger i ir => T Bool8 -> CodeGenFunction r (T i)
- floatFromBool8 :: NativeFloating a ar => T Bool8 -> CodeGenFunction r (T a)
- toEnum :: Repr Value w ~ Value w => T w -> T (T w e)
- fromEnum :: Repr Value w ~ Value w => T (T w e) -> T w
- succ :: (IsArithmetic w, IntegerConstant w) => T (T w e) -> CodeGenFunction r (T (T w e))
- pred :: (IsArithmetic w, IntegerConstant w) => T (T w e) -> CodeGenFunction r (T (T w e))
- cmpEnum :: (CmpRet w, CmpResult w ~ Bool) => CmpPredicate -> T (T w a) -> T (T w a) -> CodeGenFunction r (T Bool)
- class C a => Bounded a where
- splitMaybe :: T (Maybe a) -> (T Bool, T a)
- toMaybe :: T Bool -> T a -> T (Maybe a)
- nothing :: C a => T (Maybe a)
- just :: T a -> T (Maybe a)
- 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)
- mapFstF :: Functor f => (T a0 -> f (T a1)) -> T (a0, b) -> f (T (a1, b))
- mapSndF :: Functor f => (T b0 -> f (T b1)) -> T (a, b0) -> f (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)
- mapFst3F :: Functor f => (T a0 -> f (T a1)) -> T (a0, b, c) -> f (T (a1, b, c))
- mapSnd3F :: Functor f => (T b0 -> f (T b1)) -> T (a, b0, c) -> f (T (a, b1, c))
- mapThd3F :: Functor f => (T c0 -> f (T c1)) -> T (a, b, c0) -> f (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)
- tag :: T a -> T (Tagged tag a)
- untag :: T (Tagged tag a) -> T a
- liftTaggedM :: Monad m => (T a -> m (T b)) -> T (Tagged tag a) -> m (T (Tagged tag b))
- liftTaggedM2 :: Monad m => (T a -> T b -> m (T c)) -> T (Tagged tag a) -> T (Tagged tag b) -> m (T (Tagged tag c))
- consComplex :: T a -> T a -> T (Complex a)
- deconsComplex :: T (Complex a) -> (T a, T a)
- 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
- realPart :: T (Complex a) -> T a
- imagPart :: T (Complex a) -> T 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)
- inc :: (Additive i, IntegerConstant i) => T i -> CodeGenFunction r (T i)
- dec :: (Additive i, IntegerConstant i) => T i -> CodeGenFunction r (T i)
- 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 (Repr Value i ~ Value ir, IsInteger ir, IntegerConstant ir, CmpRet ir, NumberOfElements ir ~ D1, CmpResult ir ~ Bool) => NativeInteger i ir
- class (Repr Value a ~ Value ar, IsFloating ar, RationalConstant ar, CmpRet ar, NumberOfElements ar ~ D1, CmpResult ar ~ Bool) => NativeFloating a ar
- truncateToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)
- roundToIntFast :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)
- ceilingToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)
- floorToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)
- splitFractionToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T (i, 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 C a => 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 BitShift a where
- shl :: T a -> T a -> CodeGenFunction r (T a)
- shr :: T a -> 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)
- fromIntegral :: (NativeInteger i ir, NativeFloating a ar) => T i -> 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
C Bool | |
C Double | |
C Float | |
C Int8 | |
C Int16 | |
C Int32 | |
C Int64 | |
C Word8 | |
C Word16 | |
C Word32 | |
C Word64 | |
C () | |
C Bool8 | |
C (StablePtr a) | |
IsType a => C (Ptr a) | |
IsFunction a => C (FunPtr a) | |
C a => C (Complex a) | |
C a => C (Maybe a) | |
Positive n => C (IntN n) | |
Positive n => C (WordN n) | |
(C a, C b) => C (a, b) | |
(IsInteger w, IsConst w) => C (T w i) | |
(Positive n, C a) => C (Vector n a) | |
(IsInteger w, IsConst w, Num w, Enum e) => C (T w e) | |
C a => C (Tagged tag a) | |
MultiValue a => C (Number flags a) | |
(C a, C b, C c) => C (a, b, c) | |
(C a, C b, C c, C d) => C (a, b, c, d) |
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
intFromBool8 :: NativeInteger i ir => T Bool8 -> CodeGenFunction r (T i)Source
floatFromBool8 :: NativeFloating a ar => T Bool8 -> CodeGenFunction r (T a)Source
succ :: (IsArithmetic w, IntegerConstant w) => T (T w e) -> CodeGenFunction r (T (T w e))Source
pred :: (IsArithmetic w, IntegerConstant w) => T (T w e) -> CodeGenFunction r (T (T w e))Source
cmpEnum :: (CmpRet w, CmpResult w ~ Bool) => CmpPredicate -> T (T w a) -> T (T w a) -> CodeGenFunction r (T Bool)Source
liftTaggedM2 :: Monad m => (T a -> T b -> m (T c)) -> T (Tagged tag a) -> T (Tagged tag b) -> m (T (Tagged tag c))Source
class Compose multituple whereSource
Compose () | |
Compose a => Compose (Complex a) | |
Compose (T a) | |
(Compose a, Compose b) => Compose (a, b) | |
Compose a => Compose (Tagged tag a) | |
(Flags flags, Compose a) => Compose (Number flags a) | |
(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 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)
Decompose () | |
Decompose pa => Decompose (Complex pa) | |
Decompose (Atom a) | |
(Decompose pa, Decompose pb) => Decompose (pa, pb) | |
Decompose pa => Decompose (Tagged tag pa) | |
(Flags flags, Decompose pa) => Decompose (Number flags pa) | |
(Decompose pa, Decompose pb, Decompose pc) => Decompose (pa, pb, pc) | |
(Decompose pa, Decompose pb, Decompose pc, Decompose pd) => Decompose (pa, pb, pc, pd) |
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
IntegerConstant Double | |
IntegerConstant Float | |
IntegerConstant Int8 | |
IntegerConstant Int16 | |
IntegerConstant Int32 | |
IntegerConstant Int64 | |
IntegerConstant Word8 | |
IntegerConstant Word16 | |
IntegerConstant Word32 | |
IntegerConstant Word64 | |
Positive n => IntegerConstant (IntN n) | |
Positive n => IntegerConstant (WordN n) | |
(Positive n, IntegerConstant a) => IntegerConstant (Vector n a) | |
IntegerConstant a => IntegerConstant (Tagged tag a) | |
(Flags flags, MultiValue a, IntegerConstant a) => IntegerConstant (Number flags a) |
class IntegerConstant a => RationalConstant a whereSource
fromRational' :: Rational -> T aSource
RationalConstant Double | |
RationalConstant Float | |
(Positive n, RationalConstant a) => RationalConstant (Vector n a) | |
RationalConstant a => RationalConstant (Tagged tag a) | |
(Flags flags, MultiValue a, RationalConstant a) => RationalConstant (Number flags a) |
class C a => Additive a whereSource
add :: T a -> T a -> CodeGenFunction r (T a)Source
sub :: T a -> T a -> CodeGenFunction r (T a)Source
neg :: T a -> CodeGenFunction r (T a)Source
Additive Double | |
Additive Float | |
Additive Int8 | |
Additive Int16 | |
Additive Int32 | |
Additive Int64 | |
Additive Word8 | |
Additive Word16 | |
Additive Word32 | |
Additive Word64 | |
Positive n => Additive (IntN n) | |
Positive n => Additive (WordN n) | |
(Positive n, Additive a) => Additive (Vector n a) | |
Additive a => Additive (Tagged tag a) | |
(Flags flags, MultiValue a, Additive a) => Additive (Number flags a) |
inc :: (Additive i, IntegerConstant i) => T i -> CodeGenFunction r (T i)Source
dec :: (Additive i, IntegerConstant i) => T i -> CodeGenFunction r (T i)Source
class Additive a => PseudoRing a whereSource
PseudoRing Double | |
PseudoRing Float | |
PseudoRing Int8 | |
PseudoRing Int16 | |
PseudoRing Int32 | |
PseudoRing Int64 | |
PseudoRing Word8 | |
PseudoRing Word16 | |
PseudoRing Word32 | |
PseudoRing Word64 | |
PseudoRing a => PseudoRing (Tagged tag a) | |
(Flags flags, MultiValue a, PseudoRing a) => PseudoRing (Number flags a) |
class PseudoRing a => Field a whereSource
class (PseudoRing (Scalar v), Additive v) => PseudoModule v whereSource
PseudoModule Double | |
PseudoModule Float | |
PseudoModule a => PseudoModule (Tagged tag a) | |
(Flags flags, MultiValue a, ~ * a (Scalar v), MultiValue v, PseudoModule v) => PseudoModule (Number flags v) |
class Real a => Fraction a whereSource
truncate :: T a -> CodeGenFunction r (T a)Source
fraction :: T a -> CodeGenFunction r (T a)Source
class (Repr Value i ~ Value ir, IsInteger ir, IntegerConstant ir, CmpRet ir, NumberOfElements ir ~ D1, CmpResult ir ~ Bool) => NativeInteger i ir Source
class (Repr Value a ~ Value ar, IsFloating ar, RationalConstant ar, CmpRet ar, NumberOfElements ar ~ D1, CmpResult ar ~ Bool) => NativeFloating a ar Source
truncateToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)Source
roundToIntFast :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)Source
ceilingToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)Source
floorToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T i)Source
splitFractionToInt :: (NativeInteger i ir, NativeFloating a ar) => T a -> CodeGenFunction r (T (i, a))Source
class Algebraic a => Transcendental a whereSource
Transcendental Double | |
Transcendental Float | |
Transcendental a => Transcendental (Tagged tag a) | |
(Flags flags, MultiValue a, Transcendental a) => Transcendental (Number flags a) |
class C a => Select a whereSource
Select Bool | |
Select Double | |
Select Float | |
Select Int8 | |
Select Int16 | |
Select Int32 | |
Select Int64 | |
Select Word8 | |
Select Word16 | |
Select Word32 | |
Select Word64 | |
Select Bool8 | |
(Select a, Select b) => Select (a, b) | |
Select a => Select (Tagged tag a) | |
(Flags flags, MultiValue a, Select a) => Select (Number flags a) | |
(Select a, Select b, Select c) => Select (a, b, c) |
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
Comparison Double | |
Comparison Float | |
Comparison Int8 | |
Comparison Int16 | |
Comparison Int32 | |
Comparison Int64 | |
Comparison Word8 | |
Comparison Word16 | |
Comparison Word32 | |
Comparison Word64 | |
Positive n => Comparison (IntN n) | |
Positive n => Comparison (WordN n) | |
Comparison a => Comparison (Tagged tag a) | |
(Flags flags, MultiValue a, Comparison a) => Comparison (Number flags a) |
class Comparison a => FloatingComparison a whereSource
fcmp :: FPPredicate -> T a -> T a -> CodeGenFunction r (T Bool)Source
FloatingComparison Float | |
FloatingComparison a => FloatingComparison (Tagged tag a) | |
(Flags flags, MultiValue a, FloatingComparison a) => FloatingComparison (Number flags a) |
class PseudoRing a => Integral a whereSource
fromIntegral :: (NativeInteger i ir, NativeFloating a ar) => T i -> CodeGenFunction r (T a)Source