[Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

Manlio Perillo manlio_perillo at libero.it
Sun Apr 19 11:48:00 EDT 2009

Henning Thielemann ha scritto:
> On Tue, 14 Apr 2009, rodrigo.bonifacio wrote:
>> I guess this is a very simple question. How can I convert IO [XmlTree]
>> to just a list of
>> XmlTree?
> The old Wiki had:
>   http://www.haskell.org/wikisnapshot/ThatAnnoyingIoType.html
> Should be ported to the new Wiki since it is a FAQ ...

Note that it is not always possible to separate IO from pure code.
As an example, consider an HTTP 1.1 server that read a request body
containing a number for each line, and return a response body containing
the sum of the numbers.

Here, you can not really separate IO from pure computation.
And you can not use lazy IO, if you want your server to support HTTP 1.1

Regards  Manlio Perillo

More information about the Haskell-Cafe mailing list