ad-0.28: Automatic Differentiation

PortabilityGHC only
Stabilityexperimental
Maintainerekmett@gmail.com

Numeric.AD.Tensors

Contents

Description

 

Synopsis

Tensors

data Tensors f a Source

Constructors

a :- (Tensors f (f a)) 

Instances

Functor f => Functor (Tensors f) 
Foldable f => Foldable (Tensors f) 
Traversable f => Traversable (Tensors 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.

headT :: Tensors f a -> aSource

tailT :: Tensors f a -> Tensors f (f a)Source

tensors :: Functor f => Stream f a -> Tensors f aSource

f-Branching Streams

data Stream f a Source

Constructors

a :< (f (Stream f a)) 

Instances

Functor f => Functor (Stream f) 
Foldable f => Foldable (Stream f) 
Traversable f => Traversable (Stream f) 
Functor f => Comonad (Stream f) 
Functor f => Copointed (Stream f) 
(Show a, Show (f (Stream f a))) => Show (Stream f a) 

headS :: Stream f a -> aSource

tailS :: Stream f a -> f (Stream f a)Source

unfoldS :: Functor f => (a -> (b, f a)) -> a -> Stream f bSource

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.

Functor f => Copointed (Iterated f) 

class Copointed f => Comonad f whereSource

Methods

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

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

Instances