ad- Automatic Differentiation

PortabilityGHC only
Safe HaskellNone



Unsafe and often partial combinators intended for internal usage.

Handle with care.



data Forward a s Source

Forward mode AD


Forward !a a 
Lift !a 


Typeable2 Forward 
(Num a, Bounded a) => Bounded (Forward a s) 
(Num a, Enum a) => Enum (Forward a s) 
(Num a, Eq a) => Eq (Forward a s) 
Floating a => Floating (Forward a s) 
Fractional a => Fractional (Forward a s) 
(Data a, Data s) => Data (Forward a s) 
Num a => Num (Forward a s) 
(Num a, Ord a) => Ord (Forward a s) 
Real a => Real (Forward a s) 
RealFloat a => RealFloat (Forward a s) 
RealFrac a => RealFrac (Forward a s) 
Show a => Show (Forward a s) 
Erf a => Erf (Forward a s) 
InvErf a => InvErf (Forward a s) 
Num a => Mode (Forward a s) 
Num a => Jacobian (Forward a s) 

primal :: Num a => Forward a s -> aSource

tangent :: Num a => Forward a s -> aSource

Calculate the tangent using forward mode AD.

bundle :: a -> a -> Forward a sSource

unbundle :: Num a => Forward a s -> (a, a)Source

apply :: Num a => (Forward a s -> b) -> a -> bSource

bind :: (Traversable f, Num a) => (f (Forward a s) -> b) -> f a -> f bSource

bind' :: (Traversable f, Num a) => (f (Forward a s) -> b) -> f a -> (b, f b)Source

bindWith :: (Traversable f, Num a) => (a -> b -> c) -> (f (Forward a s) -> b) -> f a -> f cSource

bindWith' :: (Traversable f, Num a) => (a -> b -> c) -> (f (Forward a s) -> b) -> f a -> (b, f c)Source

transposeWith :: (Functor f, Foldable f, Traversable g) => (b -> f a -> c) -> f (g a) -> g b -> g cSource