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

ConCat.Distribution

Description

A category of probabilistic functions using discrete distributions

Synopsis

Documentation

newtype Dist a b Source #

Distribution category

Constructors

Dist (a -> Map b R) 

Instances

Instances details
AssociativePCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

lassocP :: Ok3 Dist a b c => Dist (Prod Dist a (Prod Dist b c)) (Prod Dist (Prod Dist a b) c) Source #

rassocP :: Ok3 Dist a b c => Dist (Prod Dist (Prod Dist a b) c) (Prod Dist a (Prod Dist b c)) Source #

AssociativeSCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

lassocS :: Oks Dist '[a, b, c] => Dist (Coprod Dist a (Coprod Dist b c)) (Coprod Dist (Coprod Dist a b) c) Source #

rassocS :: Oks Dist '[a, b, c] => Dist (Coprod Dist (Coprod Dist a b) c) (Coprod Dist a (Coprod Dist b c)) Source #

BraidedPCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

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

BraidedSCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

swapS :: Ok2 Dist a b => Dist (Coprod Dist a b) (Coprod Dist b a) Source #

Category Dist Source # 
Instance details

Defined in ConCat.Distribution

Associated Types

type Ok Dist :: Type -> Constraint Source #

Methods

id :: Ok Dist a => Dist a a Source #

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

CoproductCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

inl :: Ok2 Dist a b => Dist a (Coprod Dist a b) Source #

inr :: Ok2 Dist a b => Dist b (Coprod Dist a b) Source #

jam :: Ok Dist a => Dist (Coprod Dist a a) a Source #

DistribCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

distl :: Ok3 Dist a u v => Dist (Prod Dist a (Coprod Dist u v)) (Coprod Dist (Prod Dist a u) (Prod Dist a v)) Source #

distr :: Ok3 Dist u v b => Dist (Prod Dist (Coprod Dist u v) b) (Coprod Dist (Prod Dist u b) (Prod Dist v b)) Source #

MonoidalPCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

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

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

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

MonoidalSCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

(+++) :: Ok4 Dist a b c d => Dist c a -> Dist d b -> Dist (Coprod Dist c d) (Coprod Dist a b) Source #

left :: forall a a' b. Oks Dist '[a, b, a'] => Dist a a' -> Dist (Coprod Dist a b) (Coprod Dist a' b) Source #

right :: Oks Dist '[a, b, b'] => Dist b b' -> Dist (Coprod Dist a b) (Coprod Dist a b') Source #

ProductCat Dist Source # 
Instance details

Defined in ConCat.Distribution

Methods

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

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

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

Num a => ScalarCat Dist a Source # 
Instance details

Defined in ConCat.Distribution

Methods

scale :: a -> Dist a a Source #

type Ok Dist Source # 
Instance details

Defined in ConCat.Distribution

type Ok Dist = Ord

distrib :: (a -> Map b R) -> Dist a b Source #

The one category-specific operation.

exactly :: (a -> b) -> Dist a b Source #

Embed a regular deterministic function