pure icon indicating copy to clipboard operation
pure copied to clipboard

Compiler rejects type signatures for infix functions

Open myreen opened this issue 2 years ago • 0 comments

The compiler accepts this:

l1 ++ l2 =
  case l1 of
   [] -> l2
   h:t -> h : (t ++ l2)

main = Ret ()

But rejects any version with a type signature for ++. For example, it rejects:

(++) :: [a] -> [a] -> [a]
l1 ++ l2 =
  case l1 of
   [] -> l2
   h:t -> h : (t ++ l2)

main = Ret ()

myreen avatar Jan 21 '23 12:01 myreen