[Haskell-cafe] Associated types for number coercion

Christopher Done chrisdone at gmail.com
Wed Mar 20 00:24:09 CET 2013


(But I get annoyed about having to convert between five string types
(String, Text, lazy Text, ByteString, lazy ByteString), so maybe I'm
just generally more bothered by the whole “not being able to just
write the program” than others.)

On 20 March 2013 00:22, Christopher Done <chrisdone at gmail.com> wrote:
> 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