jfecher / ante

A safe, easy systems language
http://antelang.org
MIT License
1.89k stars 79 forks source link

Draft: Add Else Operator #198

Open anoojpatel opened 5 months ago

anoojpatel commented 5 months ago

Add the Else Operator with type: (else): Maybe a -> a -> a

This PR adds a new Else binary operator into the AST and handles the tracking of the Maybe type constructor from the prelude.

jfecher commented 3 months ago

Since this PR has been open for some time, let me know if you want to pair program this together some time, want me to take it over entirely, or if you want to keep working on it solo. I've been rather slow to respond lately so I apologize for slowing things down a bit but your contribution is still very much appreciated :slightly_smiling_face:.

anoojpatel commented 3 months ago

Hi! No worries, and sorry for the slow progress! I'm definitely open to pair program whenever you might be available! I'm hoping to finish this and merge it in

anoojpatel commented 3 months ago

Thanks for the pairing session! Was a great learning experience and thanks for taking the time out :)

To summarize, things that are left is mainly handling the single line if a then b else c disambiguating by creating a without_else_expr with a boolean value to handle that case in the parser.