CheeseMonger
02-21-2004, 02:25 PM
After reading in a string from a file, my function returns a IO [Char] type.
How can I use this data with functions that require a [Char] or [a]type?
For example, the display function returns a string read from the file:
MatIO> display
"SQ345 ","10","10","08","05","Manchester","Singapore"
But if I try to reverse it:
MatIO> reverse display
ERROR - Type error in application
*** Expression : reverse display
*** Term : display
*** Type : IO [Char]
*** Does not match : [a]
How can I get around this issue?
Cheers for any help.
How can I use this data with functions that require a [Char] or [a]type?
For example, the display function returns a string read from the file:
MatIO> display
"SQ345 ","10","10","08","05","Manchester","Singapore"
But if I try to reverse it:
MatIO> reverse display
ERROR - Type error in application
*** Expression : reverse display
*** Term : display
*** Type : IO [Char]
*** Does not match : [a]
How can I get around this issue?
Cheers for any help.