4 ms·
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 functio
by boothead 13y ago
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 :-)
- kenko 13y agoThe 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'
- FreeFull 13y agoThe 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].