Ancestors

Written by Nicolas Rinaudo on 2024-12-18 at 00:07

I spent a few hours doing some very GADT-y things in Scala 2 and being very impressed with how well the compiler behaved.

Things like the attached screenshot, which honestly, the way I can use t in the pattern match and have the compiler work out that expr must be of type Expr[X] is really cool.

Went a little overboard with the whole thing, and then realised I'd messed up my command line arguments and was working in Scala 3... Reverting to Scala 2 was quite painful.

=> View attached media

=> More informations about this toot | More toots from NicolasRinaudo@functional.cafe

Toot

Written by Nicolas Rinaudo on 2024-12-18 at 00:09

It also took me a shamefully long time to realise you could use non-parametric sum types with a single, parametric variant to have convenient type equalities in pattern matches

=> More informations about this toot | More toots from NicolasRinaudo@functional.cafe

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113670919140198142
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
250.743211 milliseconds
Gemini-to-HTML Time
0.477802 milliseconds

This content has been proxied by September (3851b).