Also, if you are trying to display a line that looks like
  insert 5
or
  consume 6
then consider using
>                       putStrLn ("insert " ++ show r)
>                       putStrLn ("consume " ++ show r)
instead of
>                       print ("insert " ++ show r)
>                       print ("consume " ++ show r)
to avoid printing out the extra quotation marks. The function print is
defined in the prelude as

> print      :: Show a => a -> IO ()
> print x    =  putStrLn (show x)

also, you could do:

> putStrLn $ "insert " ++ show r

because the $ infix operator is just a tightly binding function
application... you can think of it as a sort of left parenthesis that
automatically adds a right parenthesis at the end of your expression.

  Jared.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to