I want my showStackHead function take a stack print the head and return the rests, here is my code --code
showStackHead xx
| xx == [] = return []
| otherwise = do putStrLn("result:" ++ (head xx))
return (tail xx)
when I run this code, the compiler tells me there is a parse error about the second return, so what is the right way to write this function?