[Haskell-cafe] Associated types for number coercion

Christopher Done chrisdone at gmail.com
Wed Mar 20 00:22:05 CET 2013


On 20 March 2013 00:05, Johan Tibell <johan.tibell at gmail.com> wrote:
> I prefer the current way (which is interestingly what Go chose as well).
> With implicit casts it's easy to shoot yourself in the foot e.g. when doing
> bit-twiddling.

I don't think it's an either-or case, though, is it? I would use the
magic implicitness when I don't care, like all the times I have to
write fromIntegral because I have an Int here and an Integer there,
and now I want to use them in a Double calculation, so my code ends up
littered with "fromIntegral", or "fi". Elsewhere in the world,
programmers just write arithmetic. When I would care, like in
bit-twiddling, I would use the explicit conversions.



More information about the Haskell-Cafe mailing list