News for hackers. Stuff that matters.
Re:Examples of Incorrect Abstractions in Other Languages by antonvs on Wednesday May 20, 2020 @02:05AM (#23243753)
In Haskell, `sum` adds a collection of numbers, i.e. instances of the Num typeclass:

    Prelude> sum ["a", "b"]

    <interactive>:4:1: error:
    • No instance for (Num [Char]) arising from a use of ‘sum’
    • In the expression: sum ["a", "b"]
      In an equation for ‘it’: it = sum ["a", "b"]
You appear to be refuting a straw man.

There are no comments on this comment yet.