2 ms·
The problem is that without HKT you can't abstract over these things; you can't write useful functions like "sequence", and so code that uses these expressions
by lmm 12y ago
The problem is that without HKT you can't abstract over these things; you can't write useful functions like "sequence", and so code that uses these expressions becomes a kind of second-class citizen that can't be refactored the way you'd do with normal code.
- platz 12y agoOf course, HKT is preferable, just in the error reporting context (i.e. this particular example) I'm not sure much the addt'l abstraction (functions like sequence) further solves the problem, seems like the expressions described may be sufficient. But I agree, in general, you absolutely want HKT for the reasons you mentioned. Said another way, if HKT in rust is doable, let's do that - but if that turns out not to be the case, there are some nice conpromises such as this example, which I think, at least, is better than the proposed ? Operator, because it is a bit more general/versatile.