This release focuses on two main topics: free structures and algebraic data types.
Free structures
4 free algebraic structures were defined as typealiases of existing and brand new data structures, that is:
NonEmptyArray
(brand new) ->FreeSemigroup
;Array
->FreeMonoid
;Multiset
(a.k.a.Bag
, brand new) ->FreeCommutativeMonoid
;Set
->FreeBoundedSemilattice
.
A free representation for Semiring
was also provided, with the type SetM
(a Set
where elements are monoids).
Algebraic data types
3 algebraic data types were added, that is, data types that exist only for combining other types in interesting ways, that is:
Product<A,B>
, representingA
andB
at the same time;Coproduct<A,B>
, representing eitherA
orB
;Inclusive<A,B>
, representing one of the following:- only type
A
; - only type
B
; - both types
A
andB
.
- only type
These types have definitions for the algebraic structures depending on the contained types: e.g. Product<A,B>
is a Monoid
if A
and B
are monoids.
Finally, the Function
type was included among the algebraic data types.