12 | {-------------------------------------------------------------------------------
13 | Defines basic containers.
14 | Some of them are possible to express in terms of each other, but we opt to define most of them directly
15 | -------------------------------------------------------------------------------}
17 | ||| Constant (non-dependent) container: positions do not depend on shapes
18 | ||| As a polynomial functor: F(X) = aX^b
23 | ||| Constant container whose shapes and positions coincide
24 | ||| As a polynomial functor: F(X) = aX^a
29 | ||| Naperian container: a constant container with a single shape
30 | ||| As a polynomial functor: F(X) = X^b
35 | ||| Flat container: a constant container with a single position
36 | ||| As a polynomial functor: F(X) = aX
41 | ||| Sharp container: a constant container without any positions
42 | ||| As a polynomial functor: F(X) = a
47 | ||| Turn a container into a Naperian one by fixing a specific shape
52 | ||| Empty container, isomorphic to Void
53 | ||| As a polynomial functor: F(X) = 0
54 | ||| Initial container
59 | ||| Container of a single thing
60 | ||| As a polynomial functor: F(X) = X
61 | ||| Unit of the tensor and composition product
66 | ||| Container with a single shape, but no positions. Isomorphic to Unit : Type
67 | ||| As a polynomial functor: F(X) = 1
68 | ||| Terminal container
73 | ||| Product, container of two things
74 | ||| Isomorphic to Scalar >*< Scalar
75 | ||| As a polynomial functor: F(X) = X^2
80 | ||| Coproduct, container of either one of two things
81 | ||| Isomorphic to Scalar >+< Scalar
82 | ||| As a polynomial functor: F(X) = X + X
87 | ||| Container of either one thing, or nothing
88 | ||| Isomorphic to Scalar >+< UnitCont
89 | ||| Initial algebra is Nat
90 | ||| As a polynomial functor: F(X) = 1 + X
95 | ||| Container of either two things, or nothing
96 | ||| Isomorphic to Pair >+< UnitCont
97 | ||| Initial algebra is BinTreeShape
98 | ||| As a polynomial functor: F(X) = 1 + X^2
103 | ||| List, container with an arbitrary number of things
104 | ||| As a polynomial functor: F(X) = 1 + X + X^2 + X^3 + ...
109 | ||| Non-empty lists, container with an arbitrary number of things
110 | ||| As a polynomial functor: F(X) = X + X^2 + X^3 + ...
116 | ||| Bags/multisets, *quotient* containers
117 | ||| As an *analytic* functor: F(X) = 1 + X + X^2 + X^3 + ... / S_n
118 | ||| Not enforcing the quotient at the moment
119 | ||| See also `Data.Bag`
124 | ||| Vect, container of a fixed/known number of things
125 | ||| As a polynomial functor: F(X) = X^n
130 | ||| Grid, container of things arranged along two axes
131 | ||| As a polynomial functor: F(X) = X^(hw)
136 | ||| Container of an infinite number of things
137 | ||| As a polynomial functor: F(X) = X^Nat
142 | ||| Container of things stored at nodes and leaves of a binary tree
143 | ||| As a polynomial functor: F(X) = 1 + 2X + 3X^2 + 7X^3 + ...
148 | ||| Container of things stored at nodes of a binary tree
149 | ||| As a polynomial functor: F(X) = 1 + X + 2X^2 + 5X^3 +
154 | ||| Container of things stored at leaves of a binary tree
155 | ||| As a polynomial functor: F(X) = X + X^2 + 2X^3 + 5X^4 +
160 | ||| Tensors are containers
161 | ||| As a polynomial functor: F(X) = ?
178 | ||| Ignoring universe levels here
179 | ||| This should be the analogue of `Type : Type`