[Haskell-cafe] Exception: Too many open files

Bas van Dijk basvandijk at home.nl
Mon Oct 23 19:19:43 EDT 2006


On Tuesday 24 October 2006 00:58, Greg Fitzgerald wrote:
> > test = print . take 3 =<< parseFiles
>
> I haven't had time to double-check this code, but something like this ought
> to work (no 'unsafe' operations!):
> test = sequence . take 3 . map (print . parseFile) =<< getFileFPs
>
> Let me know how it goes.

Indeed, the following works:

test = sequence . take 3 . map (\fp -> print =<< parseFile fp) =<< getFileFPs

Thanks,

Bas.


More information about the Haskell-Cafe mailing list