This is something of the blind leading the blind, but you seem to need a bit of state monad mixed with IO monad. So you could look into StateT, a monad transformer, which should make you a StateIO monad specialized to FileReader. Then you define a `runFileReader` that allows you to jump into the FileReader monad.
I defined a "pointer walking" monad a while back, but that did all the IO with `unsafePerformIO`, so I could use a pure State monad. -- _jsn _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe