[Haskell-cafe] Exception: Too many open files

Henning Thielemann lemming at henning-thielemann.de
Tue Oct 24 07:03:52 EDT 2006


I don't know why these unsafe* functions are suggested so easily. Their
name is chosen for good reason.


On Mon, 23 Oct 2006, Bas van Dijk wrote:

> ------------------------------------------------------------------------------
> module Main where
> 
> import Text.ParserCombinators.Parsec
> 
> data T = ...
> 
> test = print . take 3 =<< parseFiles
> 
> parseFiles :: IO [T]
> parseFiles = mapM parseFile =<< getFileFPs

Is it possible to turn it into

parseFiles :: [IO T]

?

Then you can easily do

sequence (take 3 parseFiles)


More information about the Haskell-Cafe mailing list