News for hackers. Stuff that matters.
Re:First look at Clojure.core.typed by TylerE on Thursday August 29, 2013 @11:16AM (#6296258)
Admittedly, I'm only a novice at clojure (working on it), but I find that type error really unfriendly. It doesn't provide any clearly actionable information, something like "+ expects it's 2nd argument to be Integer, but internal-number is a Number"
Re:First look at Clojure.core.typed by boothead on Thursday August 29, 2013 @11:49AM (#6296479)
Some terminology might help..

The domain is the inputs of a function and the range is the output. I assume that if there were multiple arguments to the function it would git you the other ones too.

BTW compare it to the haskell version of the same:

  > 1 + "1"
  No instance for (GHC.Num.Num [GHC.Types.Char])
  arising from a use of `GHC.Num.+'
  Possible fix:
  add an instance declaration for (GHC.Num.Num [GHC.Types.Char])
The shirt looks significantly less hairy in clojure :-)
Re:First look at Clojure.core.typed by kenko on Thursday August 29, 2013 @01:04PM (#6296988)
The Haskell error is made more complicated by the fact that Num is a typeclass that other types can participate in. Other type errors are more tractable:

    Prelude> 'a' : 'a'
    
    <interactive>:3:7:
        Couldn't match expected type `[Char]' with actual type `Char'
        In the second argument of `(:)', namely 'a'
        In the expression: 'a' : 'a'
        In an equation for `it': it = 'a' : 'a'
Re:First look at Clojure.core.typed by FreeFull on Thursday August 29, 2013 @07:03PM (#6299202)
The reason behind that error message is how generic numbers are in Haskell by default. 1 + "1" will actually be working code if you make an instance for Num [Char].