lapis-lang / lapis-lang

The Lapis Programming System
0 stars 0 forks source link

ADTs vs Objects #7

Open mlhaufe opened 1 year ago

mlhaufe commented 1 year ago

Object == closure == coalgebra. Unfold

ADT == Algebra. Fold

http://lambda-the-ultimate.org/classic/message7355.html#7446

Multimethods to unify ADT and Objects?

http://lambda-the-ultimate.org/classic/message7355.html#7488

"the defining property of an algebra says that every observation can be expressed as a fold, so fold is a `universal observation'"

Unified under a bialgebra. But what does that mean practically?

async only on objects? sync only on ADTs?

immutability on ADTs and mutability/side-effects in objects?

immutable objects can exist though: Value Objects. But should they?

Ref:

mlhaufe commented 1 year ago

"data" for algebras "codata" for coalgebras (objects)