0 | module Data.Container.Base.Object.Instances
3 | import Data.List.Quantifiers
5 | import Data.Container.Base.Object.Definition
6 | import Data.Container.Base.Product.Definitions
7 | import Data.Container.Base.TreeUtils
8 | import Control.Monad.Distribution
15 | Empty = (_ : Void) !> Void
21 | Scalar = (_ : Unit) !> Unit
28 | UnitCont = (_ : Unit) !> Void
35 | Pair = (_ : Unit) !> Bool
42 | Either = (_ : Bool) !> Unit
50 | Maybe = (b : Bool) !> (if b then Unit else Void)
58 | MaybeTwo = (b : Bool) !> (if b then Fin 2 else Void)
64 | List = (n : Nat) !> Fin n
69 | Vect : List .Shp -> Cont
70 | Vect n = (_ : Unit) !> Fin n
76 | Stream = (_ : Unit) !> Nat
82 | BinTree = (b : BinTreeShape) !> BinTreePos b
88 | BinTreeNode = (b : BinTreeShape) !> BinTreePosNode b
94 | BinTreeLeaf = (b : BinTreeShape) !> BinTreePosLeaf b
99 | Tensor : List Cont -> Cont
100 | Tensor = foldr (>@) Scalar
103 | CartesianTensor : List Cont -> Cont
104 | CartesianTensor = foldr (>*<) UnitCont
107 | HancockTensor : List Cont -> Cont
108 | HancockTensor = foldr (><) Scalar
111 | CoproductTensor : List Cont -> Cont
112 | CoproductTensor = foldr (>+<) Empty
117 | Sample : Nat -> Cont
118 | Sample n = Const2 (Dist n) (Fin n)