3 ms·
As the first comment on that article notes: $ ghci GHCi, version 9.2.1: https://www.haskell.org/ghc/ https://www.haskell.org/ghc/ :? for help Main λ> 1+[2,3] <
by tromp 5y ago
As the first comment on that article notes:
$ ghci
GHCi, version 9.2.1: https://www.haskell.org/ghc/ https://www.haskell.org/ghc/ :? for help
Main λ> 1+[2,3]
<interactive>:1:1: error:
• No instance for (Num [Integer]) arising from a use of ‘it’
• In the first argument of ‘ghciInteractivePrint’, namely ‘it’
In a stmt of an interactive GHCi command: ghciInteractivePrint it
In other words, this has already been fixed in GHC 9.2. More detail on the Reddit discussion of this post:
https://www.reddit.com/r/haskell/comments/suinws/haskell_error_messages_come_on/ https://www.reddit.com/r/haskell/comments/suinws/haskell_err...
- nickcw 5y agoAs a Haskell beginner I have no idea what this error message means. What is `it`? Perhaps it is the argument for ghciInteractivePrint? That is what the error says. But what is ghciInteractivePrint that wasn't in the original code? I'm guessing an alias for print. The error seems to be No instance for (Num [Integer]) Which doesn't say anything about + So I'm still in the dark about this error message!
- tromp 5y agoIf you ask for the type of (+) it's Num a => a -> a -> a So it does say something about + through its type.
- ParetoOptimal 5y agoIf you presume the user knows the type of (+) which I think is kind of fair. Ideally though it would be: (+) has no instance for (Num [Integer]) The the improvement the GHC team made is already huge for those that have at least heard of Num, which I'd guess is anyone who's went through a Haskell tutorial.