ta0kira / zeolite

Zeolite is a statically-typed, general-purpose programming language.
Apache License 2.0
18 stars 0 forks source link

Remove `GeneralType` and use `MergeTree` instead? #104

Closed ta0kira closed 3 years ago

ta0kira commented 3 years ago

The only real difference at this point is that the Show instance of GeneralInstance (type alias) uses Zeolite syntax and that for MergeTree uses Haskell syntax. One solution is to add a new class for formatting in Zeolite syntax.

ta0kira commented 3 years ago

Actually, GeneralType also removes duplicates in mergeAny and mergeAll, so this might not work. Maybe MergeTree could contain an arbitrary container of some sort.

ta0kira commented 3 years ago

The deduplication done by GeneralType prevents it from being a Monad, Functor, etc., which means that some MergeTree substitutions can't be represented. An alternative is to create a new class for objects "like" MergeTree and make functions on the latter available to the former.