[Haskell-beginners] xml light problem or pebkac

Manfred Lotz manfred.lotz at arcor.de
Tue Jun 7 18:14:46 CEST 2011

On Tue, 7 Jun 2011 16:09:41 +0200
Daniel Fischer <daniel.is.fischer at googlemail.com> wrote:

> > 
> > 
> > I'm not sure if it is obvious where my mistake here lies. If not I
> > have to try to make this a working minimal example.
> I wrote:
> > If you force the result before closing the handle, enough of the
> > file is read to find the desired elements,
> You're not forcing the result. You can choose to force in
> getXmlContent by seq'ing on name, location and whatever else fields
> you have, then using a strict return (return $! m') in the
> withBinaryFile action is sufficient, or you can do all the forcing in
> the withBinaryFile action, for example

Somehow I had not really understood your first answer. 
   return $! m'

does it nicely.


More information about the Beginners mailing list