logoalt Hacker News

stuartaxelowenyesterday at 7:18 PM1 replyview on HN

The answer I’ve seen is “just pass structs of functions around”, which is just one step more explicit than the implicit version we’re all use to, but honestly I kinda like it to free ourselves of all the ceremony around generics.


Replies

lpilyesterday at 7:29 PM

It’s discouraged to pass around structs of functions to replicate type classes in Gleam. Instead the preference is to not type class style patterns in your projects, favouring a concrete style instead.

show 1 reply