Posted on 2006-11-05
Given that I have the following function:
-- This function constructs InputData where InputData is either a line of words ex "Hi there. Oh it's Bob!" or
-- it is a word in which to search the string ex "?Bob"
inputline :: String -> InputData
| x == '?' = Search xs
| otherwise = Line (x:xs)
so for example:
inputline "hello bob"
returns > Line "hello bob"
What I can figure out is how to pass this inputline data type into a function, and then return just the string part.