{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module AERN2.Real.FieldTH
(
)
where
import MixedTypesNumPrelude
import AERN2.MP.Dyadic
import AERN2.Real.Type
import AERN2.Real.Comparisons ()
$(declForTypes
[[t| Integer |], [t| Int |], [t| Rational |]]
(\ e -> [d|
instance
(CanPow b $e, HasOrderCertainly b Integer, HasEqCertainly b Integer, CanTestIsIntegerType b)
=>
CanPow (CSequence b) $e
where
type PowType (CSequence b) $e = CSequence (PowType b $e)
pow = lift1T pow
type PPowType (CSequence b) $e = CSequence (PPowType b $e)
ppow = lift1T ppow
|]))
$(declForTypes
[[t| Integer |], [t| Int |], [t| Rational |]]
(\ b -> [d|
instance
(CanPow $b e, HasOrderCertainly e Integer, CanTestIsIntegerType e, CanTestInteger e)
=>
CanPow $b (CSequence e)
where
type PowType $b (CSequence e) = CSequence (PowType $b e)
pow = liftT1 pow
type PPowType $b (CSequence e) = CSequence (PPowType $b e)
ppow = liftT1 ppow
|]))
$(declForTypes
[[t| Integer |], [t| Int |], [t| Rational |], [t| Dyadic |]]
(\ t -> [d|
instance
(CanAddAsymmetric a $t)
=>
CanAddAsymmetric (CSequence a) $t
where
type AddType (CSequence a) $t = CSequence (AddType a $t)
add = lift1T add
instance
(CanAddAsymmetric a $t)
=>
CanAddAsymmetric (CSequence a) (CN $t)
where
type AddType (CSequence a) (CN $t) = CSequence (AddType a $t)
add = lift1T add
instance
(CanAddAsymmetric $t a)
=>
CanAddAsymmetric $t (CSequence a)
where
type AddType $t (CSequence a) = CSequence (AddType $t a)
add = liftT1 add
instance
(CanAddAsymmetric $t a)
=>
CanAddAsymmetric (CN $t) (CSequence a)
where
type AddType (CN $t) (CSequence a) = CSequence (AddType $t a)
add = liftT1 add
instance
(CanSub a $t)
=>
CanSub (CSequence a) $t
where
type SubType (CSequence a) $t = CSequence (SubType a $t)
sub = lift1T sub
instance
(CanSub a $t)
=>
CanSub (CSequence a) (CN $t)
where
type SubType (CSequence a) (CN $t) = CSequence (SubType a $t)
sub = lift1T sub
instance
(CanSub $t a)
=>
CanSub $t (CSequence a)
where
type SubType $t (CSequence a) = CSequence (SubType $t a)
sub = liftT1 sub
instance
(CanSub $t a)
=>
CanSub (CN $t) (CSequence a)
where
type SubType (CN $t) (CSequence a) = CSequence (SubType $t a)
sub = liftT1 sub
instance
(CanMulAsymmetric a $t, CanGiveUpIfVeryInaccurate (MulType a $t))
=>
CanMulAsymmetric (CSequence a) $t
where
type MulType (CSequence a) $t = CSequence (MulType a $t)
mul = lift1T mul
instance
(CanMulAsymmetric a $t, CanGiveUpIfVeryInaccurate (MulType a $t))
=>
CanMulAsymmetric (CSequence a) (CN $t)
where
type MulType (CSequence a) (CN $t) = CSequence (MulType a $t)
mul = lift1T mul
instance
(CanMulAsymmetric $t a, CanGiveUpIfVeryInaccurate (MulType $t a))
=>
CanMulAsymmetric $t (CSequence a)
where
type MulType $t (CSequence a) = CSequence (MulType $t a)
mul = liftT1 mul
instance
(CanMulAsymmetric $t a, CanGiveUpIfVeryInaccurate (MulType $t a))
=>
CanMulAsymmetric (CN $t) (CSequence a)
where
type MulType (CN $t) (CSequence a) = CSequence (MulType $t a)
mul = liftT1 mul
instance
(CanDiv a $t)
=>
CanDiv (CSequence a) $t
where
type DivType (CSequence a) $t = CSequence (DivType a $t)
divide = lift1T divide
instance
(CanDiv a $t)
=>
CanDiv (CSequence a) (CN $t)
where
type DivType (CSequence a) (CN $t) = CSequence (DivType a $t)
divide = lift1T divide
instance
(CanDiv $t a, CanTestZero a)
=>
CanDiv $t (CSequence a)
where
type DivType $t (CSequence a) = CSequence (DivType $t a)
divide = liftT1 divide
instance
(CanDiv $t a, CanTestZero a)
=>
CanDiv (CN $t) (CSequence a)
where
type DivType (CN $t) (CSequence a) = CSequence (DivType $t a)
divide = liftT1 divide
|]))