probability-polynomial-1.0.0.0: Probability distributions via piecewise polynomials
CopyrightPredictable Network Solutions Ltd. 2020-2024
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Function.Class

Description

 
Synopsis

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, …

Associated Types

type Domain f Source #

The domain of definition of the function.

type Codomain f Source #

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.

Methods

eval :: f -> Domain f -> Codomain f Source #

Evaluate a function at a point in its Domain.

Instances

Instances details
Ord v => Function (Set v) Source #

Set v represents a function v -> Bool.

Domain   (Set v) = v
Codomain (Set v) = Bool
Instance details

Defined in Data.Function.Class

Associated Types

type Domain (Set v) Source #

type Codomain (Set v) Source #

Methods

eval :: Set v -> Domain (Set v) -> Codomain (Set v) Source #

(Function o, Num o, Ord (Domain o), Num (Codomain o)) => Function (Piecewise o) Source #

Evaluate a piecewise function at a point.

Instance details

Defined in Numeric.Function.Piecewise

Associated Types

type Domain (Piecewise o) Source #

type Codomain (Piecewise o) Source #

Num a => Function (Poly a) Source #

Evaluate a polynomial at a point.

eval :: Poly a -> a -> a
Instance details

Defined in Numeric.Polynomial.Simple

Associated Types

type Domain (Poly a) Source #

type Codomain (Poly a) Source #

Methods

eval :: Poly a -> Domain (Poly a) -> Codomain (Poly a) Source #

Ord k => Function (Map k v) Source #

Map k v represents a function k -> Maybe v.

Domain   (Map k v) = k
Codomain (Map k v) = Maybe v
Instance details

Defined in Data.Function.Class

Associated Types

type Domain (Map k v) Source #

type Codomain (Map k v) Source #

Methods

eval :: Map k v -> Domain (Map k v) -> Codomain (Map k v) Source #

Function (a -> b) Source #

Functions are Function.

Instance details

Defined in Data.Function.Class

Associated Types

type Domain (a -> b) Source #

type Codomain (a -> b) Source #

Methods

eval :: (a -> b) -> Domain (a -> b) -> Codomain (a -> b) Source #