mixed-types-num-0.3.1.4: Alternative Prelude with numeric and logic expressions typed bottom-up

Copyright(c) Michal Konecny
LicenseBSD3
Maintainermikkonecny@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Numeric.MixedTypes.Field

Contents

Description

 

Synopsis

Field

Division

class CanDiv t1 t2 where Source #

A replacement for Prelude's binary /. If t1 = t2 and Fractional t1, then one can use the default implementation to mirror Prelude's /.

Minimal complete definition

divideNoCN

Associated Types

type DivTypeNoCN t1 t2 Source #

type DivType t1 t2 Source #

Methods

divideNoCN :: t1 -> t2 -> DivTypeNoCN t1 t2 Source #

divide :: t1 -> t2 -> DivType t1 t2 Source #

divide :: (CanTestZero t2, CanEnsureCN (DivTypeNoCN t1 t2), DivType t1 t2 ~ EnsureCN (DivTypeNoCN t1 t2)) => t1 -> t2 -> DivType t1 t2 Source #

Instances

CanDiv Double Double Source # 
CanDiv Double Int Source # 
CanDiv Double Integer Source # 
CanDiv Double Rational Source # 
CanDiv Int Double Source # 
CanDiv Int Int Source # 

Associated Types

type DivTypeNoCN Int Int :: * Source #

type DivType Int Int :: * Source #

CanDiv Int Integer Source # 
CanDiv Int Rational Source # 
CanDiv Integer Double Source # 
CanDiv Integer Int Source # 
CanDiv Integer Integer Source # 
CanDiv Integer Rational Source # 
CanDiv Rational Double Source # 
CanDiv Rational Int Source # 
CanDiv Rational Integer Source # 
CanDiv Rational Rational Source # 
(CanDiv Double b0, CanEnsureCE es0 b0, CanEnsureCE es0 (DivType Double b0), CanEnsureCE es0 (DivTypeNoCN Double b0), SuitableForCE es0) => CanDiv Double (CollectErrors es0 b0) Source # 

Associated Types

type DivTypeNoCN Double (CollectErrors es0 b0) :: * Source #

type DivType Double (CollectErrors es0 b0) :: * Source #

(CanDiv Int b0, CanEnsureCE es0 b0, CanEnsureCE es0 (DivType Int b0), CanEnsureCE es0 (DivTypeNoCN Int b0), SuitableForCE es0) => CanDiv Int (CollectErrors es0 b0) Source # 

Associated Types

type DivTypeNoCN Int (CollectErrors es0 b0) :: * Source #

type DivType Int (CollectErrors es0 b0) :: * Source #

(CanDiv Integer b0, CanEnsureCE es0 b0, CanEnsureCE es0 (DivType Integer b0), CanEnsureCE es0 (DivTypeNoCN Integer b0), SuitableForCE es0) => CanDiv Integer (CollectErrors es0 b0) Source # 
(CanDiv Rational b0, CanEnsureCE es0 b0, CanEnsureCE es0 (DivType Rational b0), CanEnsureCE es0 (DivTypeNoCN Rational b0), SuitableForCE es0) => CanDiv Rational (CollectErrors es0 b0) Source # 
CanDiv a b => CanDiv [a] [b] Source # 

Associated Types

type DivTypeNoCN [a] [b] :: * Source #

type DivType [a] [b] :: * Source #

Methods

divideNoCN :: [a] -> [b] -> DivTypeNoCN [a] [b] Source #

divide :: [a] -> [b] -> DivType [a] [b] Source #

CanDiv a b => CanDiv (Maybe a) (Maybe b) Source # 

Associated Types

type DivTypeNoCN (Maybe a) (Maybe b) :: * Source #

type DivType (Maybe a) (Maybe b) :: * Source #

Methods

divideNoCN :: Maybe a -> Maybe b -> DivTypeNoCN (Maybe a) (Maybe b) Source #

divide :: Maybe a -> Maybe b -> DivType (Maybe a) (Maybe b) Source #

(CanDiv a0 Double, CanEnsureCE es0 a0, CanEnsureCE es0 (DivType a0 Double), CanEnsureCE es0 (DivTypeNoCN a0 Double), SuitableForCE es0) => CanDiv (CollectErrors es0 a0) Double Source # 

Associated Types

type DivTypeNoCN (CollectErrors es0 a0) Double :: * Source #

type DivType (CollectErrors es0 a0) Double :: * Source #

(CanDiv a0 Rational, CanEnsureCE es0 a0, CanEnsureCE es0 (DivType a0 Rational), CanEnsureCE es0 (DivTypeNoCN a0 Rational), SuitableForCE es0) => CanDiv (CollectErrors es0 a0) Rational Source # 
(CanDiv a0 Int, CanEnsureCE es0 a0, CanEnsureCE es0 (DivType a0 Int), CanEnsureCE es0 (DivTypeNoCN a0 Int), SuitableForCE es0) => CanDiv (CollectErrors es0 a0) Int Source # 

Associated Types

type DivTypeNoCN (CollectErrors es0 a0) Int :: * Source #

type DivType (CollectErrors es0 a0) Int :: * Source #

(CanDiv a0 Integer, CanEnsureCE es0 a0, CanEnsureCE es0 (DivType a0 Integer), CanEnsureCE es0 (DivTypeNoCN a0 Integer), SuitableForCE es0) => CanDiv (CollectErrors es0 a0) Integer Source # 
(CanDiv a b, CanEnsureCE es a, CanEnsureCE es b, CanEnsureCE es (DivType a b), CanEnsureCE es (DivTypeNoCN a b), SuitableForCE es) => CanDiv (CollectErrors es a) (CollectErrors es b) Source # 

type CanDivBy t1 t2 = (CanDiv t1 t2, DivType t1 t2 ~ t1, DivTypeNoCN t1 t2 ~ t1) Source #

type CanDivCNBy t1 t2 = (CanDiv t1 t2, DivType t1 t2 ~ EnsureCN t1, DivTypeNoCN t1 t2 ~ t1, CanEnsureCN t1, CanDiv (EnsureCN t1) t2, DivType (EnsureCN t1) t2 ~ EnsureCN t1, DivTypeNoCN (EnsureCN t1) t2 ~ EnsureCN t1) Source #

(/) :: CanDiv t1 t2 => t1 -> t2 -> DivType t1 t2 infixl 7 Source #

(/!) :: CanDiv t1 t2 => t1 -> t2 -> DivTypeNoCN t1 t2 infixl 7 Source #

Tests