concat-examples-0.3.0.0: Some examples of compiling to categories
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConCat.Incremental

Description

Incremental evaluation via generalized automatic differentiation

Documentation

type AtomDel a = Maybe a Source #

type Atomic a = (HasDelta a, Delta a ~ AtomDel a) Source #

type RepDel a = (HasRep a, HasDelta (Rep a), Delta a ~ Delta (Rep a)) Source #

class HasDelta a where Source #

Minimal complete definition

Nothing

Associated Types

type Delta a Source #

type Delta a = Delta (Rep a)

Methods

(@+) :: HasDelta a => Binop (Delta a) infixl 6 Source #

default (@+) :: RepDel a => Binop (Delta a) Source #

(.+^) :: a -> Delta a -> a infixl 6 Source #

default (.+^) :: RepDel a => a -> Delta a -> a Source #

(.-.) :: a -> a -> Delta a infixl 6 Source #

default (.-.) :: RepDel a => a -> a -> Delta a Source #

zeroD :: Delta a Source #

default zeroD :: RepDel a => Delta a Source #

Instances

Instances details
HasDelta () Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta () Source #

Methods

(@+) :: Binop (Delta ()) Source #

(.+^) :: () -> Delta () -> () Source #

(.-.) :: () -> () -> Delta () Source #

zeroD :: Delta () Source #

HasDelta Bool Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta Bool Source #

HasDelta Double Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta Double Source #

HasDelta Float Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta Float Source #

HasDelta Int Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta Int Source #

OpCon (:*) (Sat HasDelta) Source # 
Instance details

Defined in ConCat.Incremental

Methods

inOp :: forall (a :: k) (b :: k). (Sat HasDelta a && Sat HasDelta b) |- Sat HasDelta (a :* b) Source #

OpCon (:+) (Sat HasDelta) Source # 
Instance details

Defined in ConCat.Incremental

Methods

inOp :: forall (a :: k) (b :: k). (Sat HasDelta a && Sat HasDelta b) |- Sat HasDelta (a :+ b) Source #

OpCon (->) (Sat HasDelta) Source # 
Instance details

Defined in ConCat.Incremental

Methods

inOp :: forall (a :: k) (b :: k). (Sat HasDelta a && Sat HasDelta b) |- Sat HasDelta (a -> b) Source #

(HasDelta a, HasDelta b) => HasDelta (a :* b) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta (a :* b) Source #

Methods

(@+) :: Binop (Delta (a :* b)) Source #

(.+^) :: (a :* b) -> Delta (a :* b) -> a :* b Source #

(.-.) :: (a :* b) -> (a :* b) -> Delta (a :* b) Source #

zeroD :: Delta (a :* b) Source #

(HasDelta a, HasDelta b) => HasDelta (a :+ b) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta (a :+ b) Source #

Methods

(@+) :: Binop (Delta (a :+ b)) Source #

(.+^) :: (a :+ b) -> Delta (a :+ b) -> a :+ b Source #

(.-.) :: (a :+ b) -> (a :+ b) -> Delta (a :+ b) Source #

zeroD :: Delta (a :+ b) Source #

HasDelta b => HasDelta (a -> b) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Delta (a -> b) Source #

Methods

(@+) :: Binop (Delta (a -> b)) Source #

(.+^) :: (a -> b) -> Delta (a -> b) -> a -> b Source #

(.-.) :: (a -> b) -> (a -> b) -> Delta (a -> b) Source #

zeroD :: Delta (a -> b) Source #

appD :: HasDelta a => Delta a -> Unop a Source #

newtype Del a Source #

Constructors

Del (Delta a) 

Instances

Instances details
(OkCAR (Del a), IfCat (:>) (Rep (Del a))) => IfCat (:>) (Del a) Source # 
Instance details

Defined in ConCat.Incremental

Methods

ifC :: IfT (:>) (Del a) Source #

HasDelta a => Additive (Del a) Source # 
Instance details

Defined in ConCat.Incremental

Methods

zero :: Del a Source #

(^+^) :: Del a -> Del a -> Del a Source #

HasRep (Del a) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Rep (Del a) Source #

Methods

repr :: Del a -> Rep (Del a) Source #

abst :: Rep (Del a) -> Del a Source #

OkCAR (Del a) => GenBuses (Del a) Source # 
Instance details

Defined in ConCat.Incremental

type Rep (Del a) Source # 
Instance details

Defined in ConCat.Incremental

type Rep (Del a) = Delta a

newtype a -#> b infixr 1 Source #

Constructors

DelX 

Fields

Instances

Instances details
BraidedPCat (-#>) Source # 
Instance details

Defined in ConCat.Incremental

Methods

swapP :: Ok2 (-#>) a b => Prod (-#>) a b -#> Prod (-#>) b a Source #

Category (-#>) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Ok (-#>) :: Type -> Constraint Source #

Methods

id :: Ok (-#>) a => a -#> a Source #

(.) :: forall b c a. Ok3 (-#>) a b c => (b -#> c) -> (a -#> b) -> a -#> c Source #

CoproductPCat (-#>) Source # 
Instance details

Defined in ConCat.Incremental

Methods

inlP :: Ok2 (-#>) a b => a -#> CoprodP (-#>) a b Source #

inrP :: Ok2 (-#>) a b => b -#> CoprodP (-#>) a b Source #

jamP :: Ok (-#>) a => CoprodP (-#>) a a -#> a Source #

MonoidalPCat (-#>) Source # 
Instance details

Defined in ConCat.Incremental

Methods

(***) :: Ok4 (-#>) a b c d => (a -#> c) -> (b -#> d) -> Prod (-#>) a b -#> Prod (-#>) c d Source #

first :: forall a a' b. Ok3 (-#>) a b a' => (a -#> a') -> Prod (-#>) a b -#> Prod (-#>) a' b Source #

second :: Ok3 (-#>) a b b' => (b -#> b') -> Prod (-#>) a b -#> Prod (-#>) a b' Source #

ProductCat (-#>) Source # 
Instance details

Defined in ConCat.Incremental

Methods

exl :: Ok2 (-#>) a b => Prod (-#>) a b -#> a Source #

exr :: Ok2 (-#>) a b => Prod (-#>) a b -#> b Source #

dup :: Ok (-#>) a => a -#> Prod (-#>) a a Source #

(Num s, Additive s, Atomic s) => NumCat Inc s Source # 
Instance details

Defined in ConCat.Incremental

Methods

negateC :: Inc s s Source #

addC :: Inc (Prod Inc s s) s Source #

subC :: Inc (Prod Inc s s) s Source #

mulC :: Inc (Prod Inc s s) s Source #

powIC :: Inc (Prod Inc s Int) s Source #

(OkCAR (a -#> b), IfCat (:>) (Rep (a -#> b))) => IfCat (:>) (a -#> b) Source # 
Instance details

Defined in ConCat.Incremental

Methods

ifC :: IfT (:>) (a -#> b) Source #

HasRep (a -#> b) Source # 
Instance details

Defined in ConCat.Incremental

Associated Types

type Rep (a -#> b) Source #

Methods

repr :: (a -#> b) -> Rep (a -#> b) Source #

abst :: Rep (a -#> b) -> a -#> b Source #

OkCAR (a -#> b) => GenBuses (a -#> b) Source # 
Instance details

Defined in ConCat.Incremental

Methods

genBuses' :: Template u v -> [Source] -> BusesM (Buses (a -#> b)) Source #

ty :: Ty Source #

unflattenB' :: State [Source] (Buses (a -#> b)) Source #

type Ok (-#>) Source # 
Instance details

Defined in ConCat.Incremental

type Rep (a -#> b) Source # 
Instance details

Defined in ConCat.Incremental

type Rep (a -#> b) = Del a -+> Del b

pairD :: (Del u :* Del v) -+> Del (u :* v) Source #

unPairD :: Del (u :* v) -+> (Del u :* Del v) Source #

inPairD :: C4 HasDelta u v u' v' => ((Del u :* Del v) -+> (Del u' :* Del v')) -> Del (u :* v) -+> Del (u' :* v') Source #

atomicD1 :: (Atomic a, Atomic b) => (a -> b) -> a -#> b Source #

orMaybe :: ((a :* b) -> c) -> (a :* b) -> (Maybe a :* Maybe b) -> Maybe c Source #

atomicD2 :: (Atomic a, Atomic b, Atomic c) => ((a :* b) -> c) -> (a :* b) -> (a :* b) -#> c Source #

atomic1 :: (Atomic a, Atomic b) => (a -> b) -> GD (-#>) a b Source #

atomic2 :: (Atomic a, Atomic b, Atomic c) => ((a :* b) -> c) -> GD (-#>) (a :* b) c Source #

andInc :: forall a b. (a -> b) -> a -> b :* (Delta a -> Delta b) Source #

inc :: forall a b. (a -> b) -> a -> Delta a -> Delta b Source #