Skip to content

Releases: typelift/Abstract

Free Structures and Algebraic Data Types

23 May 07:27
77f2902
Compare
Choose a tag to compare

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>, representing A and B at the same time;
  • Coproduct<A,B>, representing either A or B;
  • Inclusive<A,B>, representing one of the following:
    • only type A;
    • only type B;
    • both types A and B.

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.

Update to Swift 4.1

26 Apr 06:49
8c4691a
Compare
Choose a tag to compare

Many changes:

  • new project structure, focused on separation of abstractions from concrete types;
  • use of conditional conformance throughout the whole project;
  • new Function type that selectively conforms to the protocols depending on the output type;
  • a couple of new concrete types.

Carthage support

08 Dec 16:02
68fcd8e
Compare
Choose a tag to compare

Now Abstract properly builds with Carthage.

A nice starting point

17 Nov 15:59
2db6162
Compare
Choose a tag to compare
A nice starting point Pre-release
Pre-release

The basics are done. I'm trying this release to see if I can integrate Abstract with another project via SwiftPM.