myTakeWhile :: (a-> Bool ) -> [a] -> [a]
myTakeWhile _ [] = []
myTakeWhile pred (head:tail) = if pred head
then head:myTakeWhile pred tail
else []
main = myTakeWhile (/= ' ') "This is practice."
gives me this error:
Couldn't match expected type ‘IO t0’ with actual type ‘[Char]’
• In the expression: main
When checking the type of the IO action ‘main’