ad-0.44.1: Automatic Differentiation

PortabilityGHC only
Stabilityexperimental
Maintainerekmett@gmail.com

Numeric.AD.Classes

Contents

Description

 

Synopsis

AD Modes

class Lifted t => Mode t whereSource

Methods

lift :: Num a => a -> t aSource

Embed a constant

(<+>) :: Num a => t a -> t a -> t aSource

Vector sum

(*^) :: Num a => a -> t a -> t aSource

Scalar-vector multiplication

(^*) :: Num a => t a -> a -> t aSource

Vector-scalar multiplication

(^/) :: Fractional a => t a -> a -> t aSource

Scalar division

zero :: Num a => t aSource

 'zero' = 'lift' 0

Comonads

class Functor f => Copointed f whereSource

Methods

extract :: f a -> aSource

Instances

Functor f => Copointed (Stream f) 
Functor f => Copointed (Tensors f)

While we can not be a Comonad without a fzip-like operation, you can use the comonad for Stream f a to manipulate a structure comonadically that you can turn into Tensors.

class Copointed f => Comonad f whereSource

Methods

duplicate :: f a -> f (f a)Source

extend :: (f a -> b) -> f a -> f bSource

Instances