| Copyright | (c) Michal Konecny |
|---|---|
| License | BSD3 |
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Numeric.MixedTypes.Ring
Contents
Description
Synopsis
- type CanAddSubMulBy t s = (CanAddThis t s, CanSubThis t s, CanSub s t, SubType s t ~ t, CanMulBy t s)
- class (CanNegSameType t, CanAddSameType t, CanSubSameType t, CanMulSameType t, HasEq t t, HasEq t Integer, CanAddSubMulBy t Integer, HasEq t Int, CanAddSubMulBy t Int, HasIntegers t) => Ring t
- class (Ring t, HasEq t t, HasEq t Int, HasEq t Integer, HasOrder t t, HasOrder t Int, HasOrder t Integer) => OrderedRing t
- class (Ring t, HasEqCertainly t t, HasEqCertainly t Int, HasEq t Integer, HasOrderCertainly t t, HasOrderCertainly t Int, HasOrderCertainly t Integer, CanTestPosNeg t) => OrderedCertainlyRing t
- type CanMul t1 t2 = (CanMulAsymmetric t1 t2, CanMulAsymmetric t2 t1, MulType t1 t2 ~ MulType t2 t1)
- class CanMulAsymmetric t1 t2 where
- type CanMulBy t1 t2 = (CanMul t1 t2, MulType t1 t2 ~ t1)
- type CanMulSameType t = CanMulBy t t
- (*) :: CanMulAsymmetric t1 t2 => t1 -> t2 -> MulType t1 t2
- product :: (CanMulSameType t, ConvertibleExactly Integer t) => [t] -> t
- specCanMul :: _ => T t1 -> T t2 -> T t3 -> Spec
- specCanMulNotMixed :: _ => T t -> Spec
- specCanMulSameType :: (Show t, ConvertibleExactly Integer t, CanTestCertainly (EqCompareType t t), HasEqAsymmetric t t, CanMulAsymmetric t t, MulType t t ~ t) => T t -> Spec
Ring
type CanAddSubMulBy t s = (CanAddThis t s, CanSubThis t s, CanSub s t, SubType s t ~ t, CanMulBy t s) Source #
class (CanNegSameType t, CanAddSameType t, CanSubSameType t, CanMulSameType t, HasEq t t, HasEq t Integer, CanAddSubMulBy t Integer, HasEq t Int, CanAddSubMulBy t Int, HasIntegers t) => Ring t Source #
class (Ring t, HasEq t t, HasEq t Int, HasEq t Integer, HasOrder t t, HasOrder t Int, HasOrder t Integer) => OrderedRing t Source #
Instances
| OrderedRing Integer Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedRing Rational Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedRing (CN Integer) Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedRing (CN Rational) Source # | |
Defined in Numeric.MixedTypes.Ring | |
class (Ring t, HasEqCertainly t t, HasEqCertainly t Int, HasEq t Integer, HasOrderCertainly t t, HasOrderCertainly t Int, HasOrderCertainly t Integer, CanTestPosNeg t) => OrderedCertainlyRing t Source #
Instances
| OrderedCertainlyRing Integer Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedCertainlyRing Rational Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedCertainlyRing (CN Integer) Source # | |
Defined in Numeric.MixedTypes.Ring | |
| OrderedCertainlyRing (CN Rational) Source # | |
Defined in Numeric.MixedTypes.Ring | |
Multiplication
type CanMul t1 t2 = (CanMulAsymmetric t1 t2, CanMulAsymmetric t2 t1, MulType t1 t2 ~ MulType t2 t1) Source #
class CanMulAsymmetric t1 t2 where Source #
A replacement for Prelude's *. If t1 = t2 and Num t1,
then one can use the default implementation to mirror Prelude's *.
Minimal complete definition
Nothing
Methods
Instances
type CanMulSameType t = CanMulBy t t Source #
(*) :: CanMulAsymmetric t1 t2 => t1 -> t2 -> MulType t1 t2 infixl 7 Source #
product :: (CanMulSameType t, ConvertibleExactly Integer t) => [t] -> t Source #
Tests
specCanMul :: _ => T t1 -> T t2 -> T t3 -> Spec Source #
HSpec properties that each implementation of CanMul should satisfy.
specCanMulNotMixed :: _ => T t -> Spec Source #
HSpec properties that each implementation of CanMul should satisfy.
specCanMulSameType :: (Show t, ConvertibleExactly Integer t, CanTestCertainly (EqCompareType t t), HasEqAsymmetric t t, CanMulAsymmetric t t, MulType t t ~ t) => T t -> Spec Source #
HSpec properties that each implementation of CanMulSameType should satisfy.