Data.Maclaurin
 Stability experimental Maintainer conal@conal.net
Description
Infinite derivative towers via linear maps, using the Maclaurin representation. See blog posts http://conal.net/blog/tag/derivatives/.
Synopsis
 data a :> b powVal :: :> a b -> b derivative :: :> a b -> a :-* (a :> b) derivativeAt :: (VectorSpace b s, LMapDom a s) => (a :> b) -> a -> a :> b type :~> a b = a -> a :> b dZero :: (LMapDom a s, AdditiveGroup b) => a :> b pureD :: (LMapDom a s, AdditiveGroup b) => b -> a :> b (<\$>>) :: (LMapDom a s, VectorSpace b s) => (b -> c) -> (a :> b) -> a :> c liftD2 :: (VectorSpace b s, LMapDom a s, VectorSpace c s, VectorSpace d s) => (b -> c -> d) -> (a :> b) -> (a :> c) -> a :> d liftD3 :: (LMapDom a s, VectorSpace b s, VectorSpace c s, VectorSpace d s, VectorSpace e s) => (b -> c -> d -> e) -> (a :> b) -> (a :> c) -> (a :> d) -> a :> e idD :: (LMapDom u s, VectorSpace u s) => u :~> u fstD :: (VectorSpace a s, LMapDom b s, LMapDom a s) => (a, b) :~> a sndD :: (VectorSpace b s, LMapDom b s, LMapDom a s) => (a, b) :~> b linearD :: (LMapDom u s, VectorSpace v s) => (u -> v) -> u :~> v distrib :: (LMapDom a s, VectorSpace b s, VectorSpace c s, VectorSpace u s) => (b -> c -> u) -> (a :> b) -> (a :> c) -> a :> u (@.) :: (LMapDom b s, LMapDom a s, VectorSpace c s) => (b :~> c) -> (a :~> b) -> a :~> c (>-<) :: (LMapDom a s, VectorSpace s s, VectorSpace u s) => (u -> u) -> ((a :> u) -> a :> s) -> (a :> u) -> a :> u (**^) :: (VectorSpace c s, VectorSpace s s, LMapDom a s) => (a :> s) -> (a :> c) -> a :> c (<*.>) :: (LMapDom a s, InnerSpace b s, VectorSpace s s) => (a :> b) -> (a :> b) -> a :> s
Documentation
 data a :> b Source
Tower of derivatives. Instances
 Eq b => Eq (a :> b) (LMapDom a b, Floating b, VectorSpace b b) => Floating (a :> b) (LMapDom a b, Fractional b, VectorSpace b b) => Fractional (a :> b) (LMapDom a b, Num b, VectorSpace b b) => Num (a :> b) Ord b => Ord (a :> b) Show b => Show (a :> b) (LMapDom a s, VectorSpace u s) => AdditiveGroup (a :> u) (LMapDom a s, VectorSpace u s) => VectorSpace (a :> u) s
 powVal :: :> a b -> b Source
 derivative :: :> a b -> a :-* (a :> b) Source
 derivativeAt :: (VectorSpace b s, LMapDom a s) => (a :> b) -> a -> a :> b Source
Sampled derivative. For avoiding an awkward typing problem related to the two required VectorSpace instances.
 type :~> a b = a -> a :> b Source
Infinitely differentiable functions
 dZero :: (LMapDom a s, AdditiveGroup b) => a :> b Source
Derivative tower full of zeroV.
 pureD :: (LMapDom a s, AdditiveGroup b) => b -> a :> b Source
Constant derivative tower.
 (<\$>>) :: (LMapDom a s, VectorSpace b s) => (b -> c) -> (a :> b) -> a :> c Source
Map a linear function over a derivative tower.
 liftD2 :: (VectorSpace b s, LMapDom a s, VectorSpace c s, VectorSpace d s) => (b -> c -> d) -> (a :> b) -> (a :> c) -> a :> d Source
Apply a linear binary function over derivative towers.
 liftD3 :: (LMapDom a s, VectorSpace b s, VectorSpace c s, VectorSpace d s, VectorSpace e s) => (b -> c -> d -> e) -> (a :> b) -> (a :> c) -> (a :> d) -> a :> e Source
Apply a linear ternary function over derivative towers.
 idD :: (LMapDom u s, VectorSpace u s) => u :~> u Source
Differentiable identity function. Sometimes called the derivation variable or similar, but it's not really a variable.
 fstD :: (VectorSpace a s, LMapDom b s, LMapDom a s) => (a, b) :~> a Source
Differentiable version of fst
 sndD :: (VectorSpace b s, LMapDom b s, LMapDom a s) => (a, b) :~> b Source
Differentiable version of snd
 linearD :: (LMapDom u s, VectorSpace v s) => (u -> v) -> u :~> v Source
Every linear function has a constant derivative equal to the function itself (as a linear map).
 distrib :: (LMapDom a s, VectorSpace b s, VectorSpace c s, VectorSpace u s) => (b -> c -> u) -> (a :> b) -> (a :> c) -> a :> u Source
Derivative tower for applying a binary function that distributes over addition, such as multiplication. A bit weaker assumption than bilinearity.
 (@.) :: (LMapDom b s, LMapDom a s, VectorSpace c s) => (b :~> c) -> (a :~> b) -> a :~> c Source