3 ms·
What kind of error would you like to see here instead ?
by pyrale 7y ago
What kind of error would you like to see here instead ?
- RussianCow 7y agoThe Rust compiler does a great job of making suggestions for how you can fix your code, which is tremendously helpful for the majority of cases where your mistake was simple. There is no reason (in theory) that GHC can't offer the same level of guidance.
- ppseafield 7y agoMaybe just one extra line like this? Prelude> print 2 + 3 <interactive>:3:1: error: • No instance for (Num (IO ())) arising from a use of ‘+’ • The expression `print 2` :: IO () • In the expression: print 2 + 3 In an equation for ‘it’: it = print 2 + 3 Just adding the one line telling telling you what was `IO ()` is helpful. ghci obviously knows what it was here.
- sullyj3 7y agoThis suggestion is a straightforward, easy to implement improvement. Many compilers have serious UX problems because their authors don't take UX seriously. Elm and Rust are two languages getting this right.