Hi Ketil,
I know your problem all too well. If you are sure that you need all of
the file's content, then you should read it all from the start. I've
found this little function handy and I'm using it all over the place:
readFileStrictly :: FilePath -> IO String
readFileStrictly filePath =
do h
> These things are always tricky to understand, which is why I recommend
> not using lazy I/O. File reading is not a pure operation: running out
> of file descriptors is a good counter-example.
Without saying wether I agree with lazy I/O or not, I suggest that
this particular problem may also be
>> I would add some significant papers, such as John Hughes'
>> "Why functional programming matters", etc.
>
>I've added that paper to the introduction. Other suggestions are welcome.
"Conception, Evolution, and Application of Functional Programming Languages", Paul
Hudak, ACM Computing Surveys,
On Thu, 13 Feb 2003 10:45:10 -, "Simon Marlow" <[EMAIL PROTECTED]>
wrote:
>File reading is not a pure operation: running out
>of file descriptors is a good counter-example.
How does this differ from running out of memory whilst trying to evaluate
something?
Cheers,
Ganesh
__
"Ketil Z. Malde" wrote:
> "Simon Marlow" <[EMAIL PROTECTED]> writes:
>
> > > > -- | add data from a file to the histogram
> > > > addFile :: FiniteMap String Int -> String -> IO (FiniteMap
> > > String Int)
> > > > addFile fm name = do
> > > > x <- readFile name
> > > > ret
Hello all,
The Learning Haskell page has moved to a better place, the official Haskell
homepage. You can now find it at
http://www.haskell.org/learning.html
and through a link on the Haskell homepage index.
Jerzy wrote:
> I would add some significant papers, such as John Hughes'
> "Why functio
I am pleased to announce version 0.11.1 "Powder Snow" of
the C interface generator C->Haskell. This is a source-only
testing release, which introduces two major features:
* Arbitrary C pre-processor directives can be included into
a Haskell binding module. These will be placed into a
custom
"Simon Marlow" <[EMAIL PROTECTED]> writes:
> > > -- | add data from a file to the histogram
> > > addFile :: FiniteMap String Int -> String -> IO (FiniteMap
> > String Int)
> > > addFile fm name = do
> > > x <- readFile name
> > > return (addHist fm x)
> > >
> > > -- | ad
> The following code runs out of file handles, so I am seeking
> enlightenment as to why.
>
> > -- | add data from a file to the histogram
> > addFile :: FiniteMap String Int -> String -> IO (FiniteMap
> String Int)
> > addFile fm name = do
> > x <- readFile name
> > r
[EMAIL PROTECTED] (Ketil Z. Malde) writes:
[EMAIL PROTECTED] (Ketil Z. Malde) writes:
> Prelude> :r
> phase `Literate pre-processor' failed (exitcode = 1)
> I've no idea what trigged this, perhaps running out of file handles?
I forgot: GHC version 5.04.1. It seems that this is definitely
t
John Meacham wondered:
| what does it mean to apply 'seq' to a function? how
| does one place an abstraction in WHNF? it seems that
| the ONLY thing one can do to a function is apply it to
| some argument so does seq need to apply the function
| to a dummy argument or something?
Here is a si
Arjan van IJzendoorn wrote:
Often we see messages from people who want to learn Haskell (something we
applaud), but don't know where to begin.
...
Enough talk: http://www.cs.uu.nl/~afie/haskell/LearningHaskell.html
Thanks, Arjan, nice work.
I would add some significant papers, such as John
12 matches
Mail list logo