Hello everyone, I have just started studying and started trying to solve 99 questions in haskell.org. However I got stuck even in the first question. The first question wants me to write my own last function and I wrote this : 

q1mylast :: [x] -> x
q1mylast [a] = if length [a] <=1 then  a
else  q1mylast (tail [a])

This program doesn't work and it gives this error : 

Program error: pattern match failure: q1mylast "doaltan"

I'll be very glad if you could tell me what's wrong with the code and how can I fix it..
Thanks in advance :)