I'm trying to write a Haskell append function... Here's what I have:
myappend :: [a] -> [a] -> [a]
myappend [] x = x
myappend [x:xs] y = x : myappend xs y
But it's giving me an error: Occurs check: cannot construct the infinite type: a = [a] When generalising the type(s) for `myappend'
So, obviously there's something wrong with it but I can't see it... What's wrong with my append function?