3 ms·
Are the error messages as bad as Haskell? One of the primary reasons I shifted my focus from Haskell was because of the errors generated by the compiler were no
by akritrime 8y ago
Are the error messages as bad as Haskell? One of the primary reasons I shifted my focus from Haskell was because of the errors generated by the compiler were not at all helpful when you are learning on your own, especially in contrast to something like Rust.
- Pako 8y agoI'm not too sure about that because I haven't used either in some time unfortunately. I tried some stuff on their online REPL. From what I gathered Purescript is doomed to produce more "unwieldy" error messages because of the more complex type system. Take this definition for example: ` some = drop (Just 5) [1,2,3,4,5,6] ` Purescript isn't even doing _that_ bad in this case: it complains that `Maybe Int` doesn't match `Int` but then goes on talking about checking if `Maybe t0` is "at least as general as" `Int` which will probably be useful information for an experienced developer but not newcomers. This is, at least from what I experienced, what happens most of the time with Purescript: you get way too much information with way too many details. Compare this to an error produced by the Elm compiler: >-- TYPE MISMATCH ---------------------------- Main.elm >The 1st argument to `drop` is not what I expect: >8| List.drop (String.toInt userInput) [1,2,3,4,5,6] > ^^^^^^^^^^^^^^^^^^^^^^ >This `toInt` call produces: > Maybe Int >But `drop` needs the 1st argument to be: > Int >Hint: Use Maybe.withDefault to handle possible errors.