closing file handles

Hal Daume hdaume@ISI.EDU
Mon, 10 Sep 2001 09:44:37 -0700


Simon Marlow wrote:
>     go' f
>         = do h    <- openFile f ReadMode
>              text <- hGetContents h
>                  let c = head text
>                  c `seq` do { hClose h; return c }

This doesn't compile for me.  It complains that the last statement in a
'do' construct must be an expression...what gives?

-- 
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume