Hacker News new | ask | show | jobs
by carterschonwald 999 days ago
I’m almost a grey beard in typed functional programming and I’m actually confused by this.
1 comments

The language and way of writing feels very weird. The concepts are simple genetics but for some reason I don’t get the idea of underlying type. Wish they used a more formal language
it's not doing anything particularly interesting from a formal perspective. If you're familiar with Haskell's newtype deriving, the tilde is solving the same problem—just at the use-sites of the type instead of at the declaration site. The types it tends to be useful for are the types that Go allows as constants (https://go.dev/ref/spec#Constants), which tend to be the type classes that modern Preludes will overload the literals for.
That’s exactly it… every time I’ve tried to find detailed docs about go generics I just find really confusing prose with examples