Given the code such as (imports are stripped for brevity):
fn: List a -> List a -> Bool
fn x y =
x < y
main =
text (toString(fn [1,1] [1,2]))
I got quite a strange error:
The type annotation for `fn` does not match its definition.
15| fn: List a -> List a -> Bool
^^^^^^^^^^^^^^^^^^^^^^^^
The type annotation is saying:
List a -> List a -> Bool
But I am inferring that the definition has this type:
List a -> List a -> Bool
Without the type annotation or with type annotation but using ==
instead of <
everything works OK. Is this a bug in elm compiler or am I doing something wrong?
I used online editor at http://elm-lang.org/try