Bug in hGetBufBA + hIsEOF

2001-12-10 Thread Koen Claessen
Hi, Given a file test of size 2342. The program Bug.hs behaves correctly (the result is (2048,384)), but when uncommenting the seemingly innocent line, the program behaves incorrectly (result is (2048,2048)), and the buffer is filled with garbage. main = do han - openFile test ReadMode

RE: Bug in hGetBufBA + hIsEOF

2001-12-10 Thread Simon Marlow
Given a file test of size 2342. The program Bug.hs behaves correctly (the result is (2048,384)), but when uncommenting the seemingly innocent line, the program behaves incorrectly (result is (2048,2048)), and the buffer is filled with garbage. main = do han - openFile test ReadMode

Re: --+ not treated as a start of a comment

2001-12-10 Thread Sigbjorn Finne
Thanks, I've made Hugs98 comply with the Report. --sigbjorn - Original Message - From: Ian Lynagh [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 09, 2001 10:43 Subject: --+ not treated as a start of a comment If I have foo = 0 --+ 1 then ghc tells me

RE: Combining Module Interfaces

2001-12-10 Thread Simon Peyton-Jones
No, GHC just does not support this. GHC tries to avoid duplicating information (which might become inconsistent with catastrophic results), so C.hi simply records the dependency on A.hi and B.hi. You must have both of the latter available. Simon | -Original Message- | From: Ashley

RE: Questions about sharing

2001-12-10 Thread Simon Marlow
My understanding is that GHC tries to have it both ways. Here's my understanding of how it works (implementors should probably chime in if my memory is faulty or out of date): 1) There is a single, canonical copy of every nullary constructor. This canonical copy is used wherever

CFP: WRS 2002 - 2nd WS on Reduction Strategies in Rewriting and Programming

2001-12-10 Thread Bernhard Gramlich
[Apologies for multiple copies of this announcement] ** *** first call for papers and participation **

Another question about sharing

2001-12-10 Thread Adrian Hey
Hello, If I have.. data Path = L Path | R Path | T paths = T : branch paths branch (p:ps) = L p : R p : branch ps This will be a CAF which can never be garbage collected, but may grow indefinitely large as it gets reduced. Correct? Is it possible to avoid this problem

Re: Another question about sharing

2001-12-10 Thread Malcolm Wallace
If I have.. data Path = L Path | R Path | T paths = T : branch paths branch (p:ps) = L p : R p : branch ps This will be a CAF which can never be garbage collected, but may grow indefinitely large as it gets reduced. Correct? Any decent compiler will garbage collect the

WAAAPL 2002, preliminary announcement

2001-12-10 Thread Ralf Hinze
Apologies if you receive multiple copies... PRELIMINARY CALL FOR PAPERS [Deadline for submission: 3rd June 2002] WAAAPL 2002

FME'2002, 2nd CFP

2001-12-10 Thread Lars-Henrik Eriksson
apologies if you receive multiple copies... FORMAL METHODS EUROPE FME 2002 Formal Methods: Getting IT Right International Symposium and Tutorials http://floc02.diku.dk/FME/

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
I'm curious, how does GHC determine that the CAF is no longer required if it is referenced by code (somehow)? If code was also some kind of heap allocated data structure I guess this would be possible, but I thought this wasn't so with GHC. GHC actually tracks references to top-level

Re: Another question about sharing

2001-12-10 Thread Malcolm Wallace
data Path = L Path | R Path | T paths = T : branch paths branch (p:ps) = L p : R p : branch ps This code was originally written in Clean, and the Clean designers addressed this problem by allowing the programmer to distinguish between constants and functions with no

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
Well, how about the following little circular program? paths :: () - [Path] paths () = let r = T : branch r in r As far as I can understand what you are looking for, I think this meets the bill. Every use of the expression `paths ()' will re-evaluate the infinite

Re: Another question about sharing

2001-12-10 Thread Malcolm Wallace
You can't rely on adding dummy arguments to cause re-evaluation: full-laziness (enabled when optimisation is on in GHC) will do the opposite transformation. Well in this case, you may find it harder to claim that the full laziness transformation constitutes an `optimisation'. Maybe the GHC

RE: Another question about sharing

2001-12-10 Thread Simon Marlow
You can't rely on adding dummy arguments to cause re-evaluation: full-laziness (enabled when optimisation is on in GHC) will do the opposite transformation. Well in this case, you may find it harder to claim that the full laziness transformation constitutes an `optimisation'. Maybe the

Re: Clarification of \begin{code} ... \end{code} stuff

2001-12-10 Thread Ian Lynagh
On Mon, Dec 10, 2001 at 04:03:27PM +, Ian Lynagh wrote: In the thread Literate scripts not handled correctly Simon Marlow said: Yes, it looks like GHC's unlit program removes whitespace when looking for \begin{code}, but not for \end{code}. The report isn't explicit about whether

SPJ (and others') book. Was: Pointers in Haskell??

2001-12-10 Thread Jerzy Karczmarczuk
Mark P Jones comments: ... | Simon Peyton-Jones. The implementation of functional | programming languages. Prentice-Hall, 1987 ... | This book is already on-line at | | http://research.microsoft.com/Users/simonpj/Papers/student.ps.gz That's a useful resource too, but it's

RE: instance declarations

2001-12-10 Thread Mark P Jones
Hi Marcin, | There's no solid technical reason for this, but Haskell doesn't allow | it at the moment because there isn't an easy way to name an instance | declaration. | | There is another problem: even if we created a syntax to name them, | if they would not be exported by default then

RE: Pointers in Haskell??

2001-12-10 Thread Simon Peyton-Jones
| Simon Peyton-Jones. The implementation of functional | programming languages. Prentice-Hall, 1987 | | is this book could be made available online ? cos on amazon | it seems out of print. I'm planning to scan it in and make the copy available online. In the next month or two. Simon

Re: instance declarations

2001-12-10 Thread Ketil Z Malde
David Feuer [EMAIL PROTECTED] writes: 1. Why can't [instances] be hidden in module imports/exports? The way I see it, an instance declaration is an assertion that a certain data type supports a certain set of operations. Thus, if the data type and the operations on it are in scope, it makes

Re: Pointers in Haskell??

2001-12-10 Thread William Lee Irwin III
On Mon, Dec 10, 2001 at 12:58:33AM -0800, Simon Peyton-Jones wrote: | Simon Peyton-Jones. The implementation of functional | programming languages. Prentice-Hall, 1987 | | is this book could be made available online ? cos on amazon | it seems out of print. I'm planning to scan

Re: cond and match

2001-12-10 Thread Hannah Schroeter
Hello! On Sun, Dec 09, 2001 at 01:07:08PM +, Marcin 'Qrczak' Kowalczyk wrote: Fri, 7 Dec 2001 17:12:52 -0500 (EST), David Feuer [EMAIL PROTECTED] pisze: I'm wondering why Haskell doesn't support Scheme-like cond statements or a pattern matching predicate. I agree that both constructs

Re: (no subject)

2001-12-10 Thread David Feuer
uma kompella wrote: hi i am new to haskell and am having a problem to write function which takes a boolean expression and returns a truthvalue stating whether or not it is a tautology. Can anyone please help me?? Thanks a lot uma I assume this is your homework. It is better to

Re: (no subject)

2001-12-10 Thread Ashley Yakeley
At 2001-12-10 16:07, uma kompella wrote: i am new to haskell and am having a problem to write function which takes a boolean expression and returns a truthvalue stating whether or not it is a tautology. If you really want to impress your tutor, see if you can find a function that does this in