myLast :: [a] -> a
myLast [] = error "Empty List"
myLast [x] = x
myLast (x:xs) = myLast xs

myLast' = foldl1 (flip const)

myLast'' = foldl1 (curry snd)