▲ | 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? | ||||||||
|