numbers-3000.0.0.0: Various number types

Safe HaskellSafe-Infered



Symbolic number, i.e., these are not numbers at all, but just build a representation of the expressions. This implementation is incomplete in that it allows comnstruction, but not deconstruction of the expressions. It's mainly useful for debugging.



data Sym a Source

Symbolic numbers over some base type for the literals.


Enum a => Enum (Sym a) 
Eq a => Eq (Sym a) 
(Floating a, Eq a) => Floating (Sym a) 
(Fractional a, Eq a) => Fractional (Sym a) 
Integral a => Integral (Sym a) 
(Num a, Eq a) => Num (Sym a) 
Ord a => Ord (Sym a) 
Real a => Real (Sym a) 
(RealFloat a, Show a) => RealFloat (Sym a) 
RealFrac a => RealFrac (Sym a) 
Show a => Show (Sym a) 

var :: String -> Sym aSource

Create a variable.

con :: a -> Sym aSource

Create a constant (useful when it is not a literal).

subst :: (Num a, Eq a) => String -> Sym a -> Sym a -> Sym aSource

The expression subst x v e substitutes the expression v for each occurence of the variable x in e.

unSym :: Show a => Sym a -> aSource