do expression

Mark Carroll mark@chaos.x-philes.com
Mon, 5 May 2003 11:09:50 -0400 (EDT)


On Tue, 6 May 2003, sashan wrote:
(snip)
>            choice <- getLine
>            case choice of
>              1 -> do putStrLn "f1"
(snip)

getLine returns a String, yet the 1 is your case statement is a number.

Try,
	case (read choice) of

instead. "read" complements "show": it is a handy function that turns
strings into what you want. (The "Read" typeclass is relevant.)

-- Mark