ad-0.12: Mixed-Mode Automatic Differentiation.

PortabilityGHC only






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

newtype AD f a Source

AD serves as a common wrapper for different Mode instances, exposing a traditional numerical tower. Universal quantification is used to limit the actions in user code to machinery that will return the same answers under all AD modes, allowing us to use modes interchangeably as both the type level "brand" and dictionary, providing a common API.




runAD :: f a


Primal f => Primal (AD f) 
Mode f => Mode (AD f) 
Lifted f => Lifted (AD f) 
(Num a, Lifted f, Bounded a) => Bounded (AD f a) 
(Num a, Lifted f, Enum a) => Enum (AD f a) 
(Num a, Lifted f, Eq a) => Eq (AD f a) 
(Lifted f, Floating a) => Floating (AD f a) 
(Lifted f, Fractional a) => Fractional (AD f a) 
(Lifted f, Num a) => Num (AD f a) 
(Num a, Lifted f, Ord a) => Ord (AD f a) 
(Lifted f, Real a) => Real (AD f a) 
(Lifted f, RealFloat a) => RealFloat (AD f a) 
(Lifted f, RealFrac a) => RealFrac (AD f a) 
(Lifted f, Show a) => Show (AD f a) 
Var (AD Reverse a) a 

newtype Id a Source


Id a 


Monad Id 
Functor Id 
Applicative Id 
Primal Id 
Mode Id 
Lifted Id 
Bounded a => Bounded (Id a) 
Enum a => Enum (Id a) 
Eq a => Eq (Id a) 
Floating a => Floating (Id a) 
Fractional a => Fractional (Id a) 
Num a => Num (Id a) 
Ord a => Ord (Id a) 
Real a => Real (Id a) 
RealFloat a => RealFloat (Id a) 
RealFrac a => RealFrac (Id a) 
Show a => Show (Id a) 
Monoid a => Monoid (Id a) 

probe :: a -> AD Id aSource

unprobe :: AD Id a -> aSource