I’m really surprised that’s your impression! To me these are night-and-day different.
- The first one says “You’re passing a
String -> Decoder User
function to<|
but it expects anInt -> Decoder b
function instead.” That tells me the\email ->
function is taking aString
where anInt
is expected. I understand all of that! - The second one says “You’re passing a
Decoder (Int -> b)
when you should be passing aDecoder (String -> String -> Bool -> UserModel)
instead.” In the previous example I know what aString -> Decoder User
function is, and I can see at a glance that the\email ->
anonymous function fits that description. In this one, which of these expressions is theDecoder (Int -> b)
exactly? Which one is theDecoder (String -> String -> Bool -> UserModel)
? What is the root mismatch here,Int ≠ String
orInt ≠ String -> String -> Bool
?
Granted, both errors are helpful in that they draw attention to the broken require
. (The former has it on the first line of the error message; the latter has it on the last line.) It’s also certainly more helpful that the second one underlines the problematic thing.
But to me, I can only read one of these errors and actually understand what the types in the message are telling me - and I wrote both of the libraries in question!