mlhaufe / brevity

Brevity is a library that enables Feature-Oriented Programming (FOP) and solves the expression problem in a manner that makes data and operation declarations trivial to define and compose.
GNU Affero General Public License v3.0
1 stars 0 forks source link

Research unifying TypeRecursion and dataDec function w/ class constructor #65

Closed mlhaufe closed 1 year ago

mlhaufe commented 1 year ago

Currently data returns a function when parameterized:

const ListData = data((List, T) => ({
        Nil: {},
        Cons: { head: T, tail: List(T) }
    }));

List is also a TypeRecursion object and not the class constructor.

Given #64, it's worth looking into a way to return the class itself.

Additionally, the conversion to typescript (#28) should be easier if TypeRecursion can be replaced with the class itself (which implies the need for memoFix in the implementation)