I am new to Haskell and I am trying to get a list of values from input and print one item out from the list each line.
func :: [String] -> IO ()
I am having trouble trying to figure out how to print out the item in the list, when the list size is just 1.
func [] = return ()
func [x] = return x
I am getting this error message when trying to compile the file:
Couldn't match expected type `()' with actual type `String'
In the first argument of `return', namely `x'
In the expression: return x
I am completely lost and I have tried searching but haven't found anything. Thanks!
returna value. You need a function likeputStrLnfor that.