Hacker News new | past | comments | ask | show | jobs | submit login

> This is needed for stronger type checking.

Is 'needed' (as opposed to 'used') really correct here? Haskell's type classes manage to handle the type checking for different kinds of addition perfectly well without an explicitly different operator:

    > :t 1 + 1
    1 + 1 :: Num a => a
    > :t 1.5 + 1.5
    1.5 + 1.5 :: Fractional a => a
In other words, since 1 makes sense as an element of any 'Num'mable type, so does 1 + 1; but, since 1.5 only makes sense as an element of a 'Fractional'able type, we can only regard 1.5 + 1.5 as an element of those more restrictive types.



Indeed, I meant "used". Fixed this in my comment above. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: