Dnia pią 13. czerwca 2003 16:34, Dean Herington napisał:
> `seq` guarantees only enough evaluation to determine whether its first
> argument is bottom. That's why your commented code reads only the first
> character. You need to evaluate the entire string. As someone else
> suggested, `deepSeq`
On Fri, Jun 13, 2003 at 10:57:21AM -0400, Dean Herington wrote:
> Tomasz Zielonka wrote:
>
> > One can also use Strategies module that comes with GHC (in package
> > concurrent), for example:
>
> Could you tell me more specifically where to find the Strategies module in
> GHC? I couldn't find it
On Fri, Jun 13, 2003 at 10:34:53AM -0400, Dean Herington wrote:
>
> `seq` guarantees only enough evaluation to determine whether its first
> argument is bottom. That's why your commented code reads only the first
> character. You need to evaluate the entire string. As someone else
> suggested,
Niels Reyngoud wrote:
> Hello all,
>
> Thanks for your replies on our previous posts. To avoid the lazy
> behaviour, we tried to write our own IO module "IOExts2" which basically
> redifnes
> readFile, writeFile and appendFile to make sure they use binary-mode and
> strict behaviour. The libary is
On Friday, 2003-06-13, 10:33, CEST, Niels Reyngoud wrote:
> [...]
> To avoid the lazy behaviour, we tried to write our own IO module "IOExts2"
> which basically redifnes readFile, writeFile and appendFile to make sure
> they use binary-mode and strict behaviour. The libary is as follows:
>
> [...]
> (moderator, can you please include this mail at the bottom of my
> previous mail?)
>
> PS: I think the next example shows pretty well what goes wrong when
> you're not closing the read-handle:
>
> ---
> test = do writeFile' "123.txt" "blaat"
>
> appendFile' "123.txt" " 1"
> z
(moderator, can you please include this mail at the bottom of my
previous mail?)
PS: I think the next example shows pretty well what goes wrong when
you're not closing the read-handle:
---
test = do writeFile' "123.txt" "blaat"
appendFile' "123.txt" " 1"
z <- readFile' "123.txt"
Hello all,
Thanks for your replies on our previous posts. To avoid the lazy
behaviour, we tried to write our own IO module "IOExts2" which basically
redifnes
readFile, writeFile and appendFile to make sure they use binary-mode and
strict behaviour. The libary is as follows:
--
module I
On Thu, 12 Jun 2003, Niels Reyngoud wrote:
> Hello,
>
> We're two students from the department of computer science at the
> University of Utrecht (the Netherlands), and we're havind some severe
> difficulties in working
> with file handles in Haskell. Consider for example the following program
> Hello,
>
> We're two students from the department of computer science at the
> University of Utrecht (the Netherlands), and we're havind some severe
> difficulties in working
> with file handles in Haskell. Consider for example the following program:
>
> main = do --let inputfile = "input.t
> main = do --let inputfile = "input.txt"
> let inputtext = "testit"
> let outputfile = "output.txt"
> writeFile outputfile ""
> handle2 <- openFileEx outputfile (BinaryMode WriteMode)
> hPutStr handle2 (inputtext ++ " extra")
>
> handle3 <- openFil
I believe this is related to the topic discussed a few weeks ago. See
http://haskell.org/pipermail/haskell/2003-May/011851.html
and responses.
At least, this is most likely the curprit of your second problem.
I'm not so sure about the first one. I would expect "testit extratestit
extra2" to
Hello,
We're two students from the department of computer science at the
University of Utrecht (the Netherlands), and we're havind some severe
difficulties in working
with file handles in Haskell. Consider for example the following program:
main = do --let inputfile = "input.txt"
let in
13 matches
Mail list logo