Copyright | Predictable Network Solutions Ltd. 2020-2024 |
---|---|
License | BSD-3-Clause |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Documentation
class Function f where Source #
An instance of Function
is a type that represents functions.
Function can be evaluated at points in their Domain
.
Examples: Polynomials, trigonometric polynomials, piecewise polynomials, …
The domain of definition of the function.
The codomain of a function is the set of potential function values, i.e. function values never lie outside this set.
In contrast, the set of actual function values is called the image and is typically a strict subset of the codomain.
Instances
Ord v => Function (Set v) Source # |
Domain (Set v) = v Codomain (Set v) = Bool |
(Function o, Num o, Ord (Domain o), Num (Codomain o)) => Function (Piecewise o) Source # | Evaluate a piecewise function at a point. |
Num a => Function (Poly a) Source # | Evaluate a polynomial at a point. eval :: Poly a -> a -> a |
Ord k => Function (Map k v) Source # |
Domain (Map k v) = k Codomain (Map k v) = Maybe v |
Function (a -> b) Source # | Functions are |