andrew-johnson-4 / lambda-mountain

Compiler Backend for LSTS (Typed Macro Assembler)
https://andrew-johnson-4.github.io/lambda-mountain/
MIT License
20 stars 1 forks source link

Support codegen for haskell style type classes #888

Open andrew-johnson-4 opened 3 weeks ago

andrew-johnson-4 commented 3 weeks ago

This would require user defined type implication. That would be the only thing though mostly.

type List<a> implies Eq<a> where
   == = is;

This would help clarify some dark corners of interactions between the type system and function specialization.

andrew-johnson-4 commented 3 weeks ago

I think the natural way to implement this is to define a namespace for each type class:

Eq::== := (: is ...);