Remix.run Logo
b_e_n_t_o_n 3 hours ago

Perhaps it's because I'm not a haskeller but I'm not sure if I'm sold on encoding this into the type system. In go (and other languages for example), you would simply use a struct with a hidden Int, and receiver methods for construction/modification/access. I'm not sure I see the benefit of the type ceremony around it.

cryptonector an hour ago | parent | next [-]

> you would simply use a struct with a hidden

In such languages that's the equivalent of a newtype in Haskell.

the_af 2 hours ago | parent | prev [-]

Isn't the whole article a discussion of the kind of guarantees such an approach (which can also be done in Haskell) cannot provide?

b_e_n_t_o_n 2 hours ago | parent [-]

Right, I'm just unsure how valuable those guarantees really are. Especially if I'm extracting an Int out of the type to interface with other code.