Haskell 98 lexical syntax again

2002-02-13 Thread Simon Peyton-Jones
To meet Ian's observation below, I propose to replace the lexical production newline - a newline (system dependent) by newline - return linefeed | return | linefeed which, given maximal munch, will behave decently on any normal system. Any objections? Simon |

RE: foralls in class assertions

2002-02-19 Thread Simon Peyton-Jones
I don't know if it makes sense. You've written down some syntax, but it's not clear to me what you intend by it. The instance decls remind me somewhat of the generalisation described towards the end of a paper Ralf Hinze and I wrote, Generic type classes. There we describe why instance decls

RE: Haskell 98 Report

2002-02-20 Thread Simon Peyton-Jones
I don't want to do that until its finished! Which I earnestly hope will be soon. Simon | -Original Message- | From: David Feuer [mailto:[EMAIL PROTECTED]] | Sent: 20 February 2002 08:43 | To: [EMAIL PROTECTED] | Subject: Haskell 98 Report | | | Is the revised Haskell98 report going

RE: foralls in class assertions

2002-02-20 Thread Simon Peyton-Jones
be useful to you? I only have the example in our paper as motivation so far. Simon | -Original Message- | From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] | Sent: 20 February 2002 01:08 | To: Simon Peyton-Jones; Haskell List | Subject: RE: foralls in class assertions | | | At 2002-02-19 09:21

ICFP 2002: write now!

2002-02-21 Thread Simon Peyton-Jones
Submission deadline: 21 March 2002 18:00 UTC Program Chair: Simon Peyton Jones (Microsoft Research) Full call for papers including submission details: http://icfp2002.cs.brown.edu/CfP/ ICFP 2002 seeks original

FW: Survival of generic-classes in ghc

2002-02-25 Thread Simon Peyton-Jones
I had meant to send this message to the Haskell list, because I think there may be some readers who have good ideas about it. Simon -Original Message- From: Simon Peyton-Jones [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 21:16 To: Patrik Jansson; Haskell Cafe List Cc: Ralf Hinze

RE: H98 Report: expression syntax glitch

2002-02-26 Thread Simon Peyton-Jones
| Consider the following Haskell 98 expressions: | | (let x = 10 in x `div`) | (let x = 10 in x `div` 3) | | To parse the first, a bottom-up parser should reduce the | let-expression before the operator, while to parse the second | it should shift. But it needs 4 tokens of

RE: H98 Report: expression syntax glitch

2002-02-26 Thread Simon Peyton-Jones
| -Original Message- | From: Ross Paterson [mailto:[EMAIL PROTECTED]] | Sent: 26 February 2002 16:06 | To: Simon Peyton-Jones | Cc: [EMAIL PROTECTED] | Subject: Re: H98 Report: expression syntax glitch | | | On Tue, Feb 26, 2002 at 07:30:44AM -0800, Simon Peyton-Jones wrote: | Replace The ambiguity

RE: Behavior of fromInteger on out-of-range arguments

2002-02-26 Thread Simon Peyton-Jones
| It'd be lovely if the Haskell report took a stand on the | issue, but I suspect that may be too much to hope for. Actually, it'd be an easy, non-destablising change to make to the Report to specify the behaviour of the Int instance of fromInteger on numbers larger than will fit in an Int.

RE: H98 Report: expression syntax glitch

2002-02-27 Thread Simon Peyton-Jones
PROTECTED]] | Sent: 27 February 2002 10:43 | To: Simon Peyton-Jones | Cc: [EMAIL PROTECTED] | Subject: Re: H98 Report: expression syntax glitch | | | On Tue, Feb 26, 2002 at 08:23:03AM -0800, Simon Peyton-Jones wrote: | I didn't phrase it right. I meant that a let/lambda/if always | extends

RE: Behavior of fromInteger on out-of-range arguments

2002-02-28 Thread Simon Peyton-Jones
| By the way, the report says: Class Enum defines operations | on sequentially | ordered types. I think the sequentially means that | multiple applications | of succ to a value shall not result in the same value. That's | why I think | that succ (maxBound :: Int) should be an error and not

RE: first-class polymorphism beats rank-2 polymorphism

2002-03-08 Thread Simon Peyton-Jones
| So I would claim that these two types are the same: | | forall x. Class x = (forall y. Class y = y - y) - x - x | (forall y. Class y = y - y) - (forall x. Class x = x - x) | | ...so you should be able to do this: | | combinator :: (forall y. Class y = y - y) - (forall x. | Class x = x

RE: rank-n polymorphism

2002-03-08 Thread Simon Peyton-Jones
Mark Shields and I are writing a paper. The technical basis is in Putting type annotations to work Odersky/Laufer, POPL'96. Simon | -Original Message- | From: Artem S Alimarine [mailto:[EMAIL PROTECTED]] | Sent: 07 March 2002 16:27 | To: [EMAIL PROTECTED] | Subject: rank-n

RE: first-class polymorphism beats rank-2 polymorphism

2002-03-11 Thread Simon Peyton-Jones
| Looking at the type of sequ, | the foralls for t end up at the top. | Hence, I have no chance to define sequential | composition. Indeed the foralls are at the top, but I claim that wherever you could use the composition function you were expecting, you can also use the one GHC gives you. The

RE: Concurrent Haskell (GHC) and Win32 Applications ?

2002-03-11 Thread Simon Peyton-Jones
| The problem I think is with the lightweight thread implementation - | Win32 calls can (and will) block the OS thread that makes the call, | which blocks the entire system. Given that I'm wanting to write a | network server with a Win32 GUI, this is obviously a Bad Thing. Yes, that's true at

RE: Standard Library report: List union

2002-03-11 Thread Simon Peyton-Jones
There's a remark at the beginning of 7.2 that says: delete, (\\), union and intersect preserve the invariant that lists don't contain duplicates, provided that their first argument contains no duplicates. The same applies to unionBy etc. This design is one you might reasonably disagree

RE: H98 Report: expression syntax glitch

2002-03-11 Thread Simon Peyton-Jones
Ross points out that this is really hard to parse: | case x of y | ($ True) $ \ z - z :: Bool - Bool - y because the parser doesn't know when to stop eating the type and treat the arrow as the case-alternative arrow. Carl reminds us that this is hard to parse too: | do a == b == c

RE: Concurrent Haskell (GHC) and Win32 Applications ?

2002-03-12 Thread Simon Peyton-Jones
| Ahem - how far would this be from a real multithreaded | implementation, i.e. one that could use a few OS threads to | take advantage of multiple CPUs in an SMP system? Not very far. We have had a working implementation of such a thing, but not in a robust releasable state. S

RE: first-class polymorphism beats rank-2 polymorphism

2002-03-12 Thread Simon Peyton-Jones
| type Generic i o = forall x. i x - o x | | type Id x = x | | comb :: | (Generic Id Id) | - (Generic Id Id) | - (Generic Id Id) | comb = undefined | So now let's ask for the type of comb in ghc. | It turns out to be the rank-1 (!!!) type I captured as | explicit type

RE: first-class polymorphism beats rank-2 polymorphism

2002-03-12 Thread Simon Peyton-Jones
| Ok, that's what I meant: in RHSs of other type synonyms. | BTW, it also works when passing parameters to parameterized | datatypes. Here is a variation on defining Generic as a | datatypes as opposed to the earlier type synonym. Id is still | the same type synonym as before. | | data

FW: Layout indentation marking

2002-03-12 Thread Simon Peyton-Jones
I agree with Ian here (and not just because of what GHC does!) Does anyone disagree? Simon -Original Message- From: Ian Lynagh [mailto:[EMAIL PROTECTED]] Sent: 10 March 2002 15:23 To: Haskell list Subject: Layout indentation marking Given this module module Main where

FW: H98 Report: expression syntax glitch

2002-03-12 Thread Simon Peyton-Jones
joyful task (aided by many others) to try to illuminate the darkness, so I invite your opinions about which fix (the one below, or Ross's) is better. Simon -Original Message- From: Ross Paterson [mailto:[EMAIL PROTECTED]] Sent: 11 March 2002 17:59 To: Simon Peyton-Jones Subject: Re: H98

RE: Haskell report: deriving Show Read instances, Appendix D

2002-03-12 Thread Simon Peyton-Jones
Folks Olaf points out a problem with the specification of 'deriving' Show. In particular: | The representation will be enclosed in parentheses | if the precedence of the top-level constructor operator in x | is less than d. Olaf proposes that we should change less than to less than or

ICFP'02: 6 days to go.

2002-03-15 Thread Simon Peyton-Jones
, Pittsburgh, USA Final call for papers Submission deadline: 21 March 2002 18:00 UTC Program Chair: Simon Peyton Jones (Microsoft Research) Full call for papers including submission

Haskell 98 report: March release

2002-03-18 Thread Simon Peyton-Jones
Folks Before I get buried in ICFP submissions I thought I should get out the H98 report draft. It's in the usual place: http://research.microsoft.com/~simonpj/haskell98-revised Main changes since the Dec release are: Much improved informal semantics of pattern matching (3.17).

RE: question about concurrency implementation

2002-03-19 Thread Simon Peyton-Jones
Dean | From Simon Marlow's reply, I gather that the current | implementations of Concurrent Haskell provide concurrency | but not parallelism, and that provision of parallelism is | not likely in the near term. That's more or less right. The trouble is that for shared-memory parallelism -

RE: catch (fail ...)

2002-03-22 Thread Simon Peyton-Jones
This is an inconsistency that was fixed in the revised Haskell98 report (Apr 2001). See http://research.microsoft.com/~simonpj/haskell98-revised In the bug list look for Page 90. It looks as though Hugs hasn't quite caught up with this change. Simon | -Original Message- |

Do-notation

2002-03-28 Thread Simon Peyton-Jones
James White has noticed that the draft Haskell 98 report gives the following translation for do-notation: do {e}= e do {e;stmts} = e do {stmts} do {p - e; stmts} = let ok p = do {stmts} ok _ = fail ...

RE: and do notation

2002-04-03 Thread Simon Peyton-Jones
|I think the point that's being missed in this discussion |is that a monad is a n *abstract* type, and sometimes the |natural equality on the abstract type is not the same as |equality on representations. ... If we can give a | more efficient |

RE: deriving over renamed types

2002-04-04 Thread Simon Peyton-Jones
It's a bug in GHC 5.02 and earlier; fixed in 5.03 Simon | -Original Message- | From: Hal Daume III [mailto:[EMAIL PROTECTED]] | Sent: 04 April 2002 00:15 | To: Haskell Mailing List | Subject: deriving over renamed types | | | Why can't I do this: | | import FiniteMap | type FM =

RE: deriving over renamed types

2002-04-04 Thread Simon Peyton-Jones
| ...which would be very useful, but would probably have unpleasant | consequences for type inference... | | To my mind, this is not a credible objection. The horse has | already bolted; there's no point in trying to shut the stable | door. The existing post-Hindley-Milner aspects of

RE: functional programming contest

2002-04-04 Thread Simon Peyton-Jones
Yes, and there will be one this year too. Tim Sheard is organising it. Simon | -Original Message- | From: Tom Pledger [mailto:[EMAIL PROTECTED]] | Sent: 05 April 2002 04:03 | To: [EMAIL PROTECTED] | Subject: functional programming contest | | | Andre W B Furtado writes: | | I was

RE: explicitly quantified classes in functions

2002-04-04 Thread Simon Peyton-Jones
| Ah yes, silly me. What I had in mind, I suppose, was | something more along the lines of: | | foo :: Double - (exists q . Foo q = q) Correct. Currently you can only express this by wrapping the existential in a constructor: data R = forall q. Foo q = MkR q foo :: Double -

do notation and

2002-04-08 Thread Simon Peyton-Jones
Folks Following a good deal of email I now propose to DO NOTHING to the rules defining do-notation in the Haskell 98 Report. That means that GHC and Hugs, and nhc perhaps, should change so that they actually implement the do-notation translation rule do {e ; stmts} = e do

RE: do notation and

2002-04-22 Thread Simon Peyton-Jones
| So, changing the translation in GHC might actually introduce | a very nasty space leak in existing programs! It might, conceivably. But the H98 report doesn't seem the right place to try to tweak full laziness. So I'm going to leave the report as it is. Hugs and GHC have changed to match.

RE: defining (- Bool) as a set

2002-04-23 Thread Simon Peyton-Jones
Hal, [I think this sort of question would be better on the haskell-cafe list.] I don't think what you want can be done directly. It's the old thing about not having lambdas at the type level. You want: instance Eq a = Coll (\x. x - Bool) a where ... and you just can't do that.

RE: Lexing character literals in H98

2002-04-26 Thread Simon Peyton-Jones
| Yet another H98 question, this time regarding the module | Char: Is it a deliberate design decision that readLitChar | handles decimal, octal, and hex escapes, but lexLitChar | handles only decimal ones? It looks more like an oversight to me... Me too. It's a messy part of the language

RE: Dependent Types

2002-05-16 Thread Simon Peyton-Jones
| Here's a bit of background I managed to dig up: | http://www.mail-archive.com/haskell@haskell.org/msg05160.html | It appears that a change to the monomorphism | restriction to match Hugs's behaviour was considered for | Haskell 98, but it looks like it never made it into the report |

RE: minor H98 anomaly: class declarations

2002-05-27 Thread Simon Peyton-Jones
Yes, I agree, and I shall make this change forthwith unless anyone disagrees. thanks Simon | -Original Message- | From: Ross Paterson [mailto:[EMAIL PROTECTED]] | Sent: 27 May 2002 13:04 | To: [EMAIL PROTECTED] | Subject: minor H98 anomaly: class declarations | | | 4.3.1 has | |

RE: Negative literals and the meaning of case -2 of -2 - True

2002-05-27 Thread Simon Peyton-Jones
Fixed. Simon | -Original Message- | From: Simon Marlow [mailto:[EMAIL PROTECTED]] | Sent: 17 May 2002 10:34 | To: Thomas Hallgren; [EMAIL PROTECTED] | Subject: RE: Negative literals and the meaning of case -2 of | -2 - True | | | | To find out how Haskell implementations treat

readFloat

2002-05-28 Thread Simon Peyton-Jones
Folks I'm back to tidying up the Haskell Report. In the Numeric library, there is the useful function readFloat :: RealFloat a = ReadS a But you can't use it for reading rationals, because Rational isn't in RealFloat! This is a Royal Pain, and entirely unnecessary. In fact, readFloat

RE: readFloat

2002-05-30 Thread Simon Peyton-Jones
| It would be strange to name a function readFloat if its type is | RealFrac a = ReadS a. | I think the function should be named readFrac. For | compatibility, one could put the following into the prelude: | readFloat :: RealFloat a = ReadS a | readFloat = readFrac Well, that would

RE: [Fwd: F#]

2002-05-31 Thread Simon Peyton-Jones
| Idle curiosity: which aspects of the Haskell language are the | ones that make it complicated -- e.g., long-time stuff like | lazy evaluation, typeclasses inferrence, etc or newer stuff | like functional dependencies, etc or something else entirely | -- and do they only make it

RE: readFloat

2002-06-04 Thread Simon Peyton-Jones
| Especially converting rationals to a string and back should | always be the identity. It would be better to print rationals in the | form |numerator % denominator | | and read them in the same form. Oh yes, that is absolutely what Haskell does for Rationals. The 'read' and

RE: FFI and ODBC connectivity

2002-06-05 Thread Simon Peyton-Jones
HaskellDirect (or HDirect for short) is very much alive and being actively maintained by Sigbjorn Finne. http://www.haskell.org/hdirect/ It's built on top of the Haskell FFI, but it is much higher level. Simon | -Original Message- | From: Jamie Love [mailto:[EMAIL PROTECTED]]

FW: cvs commit: hugs98/lib IO.hs Prelude.hs

2002-06-05 Thread Simon Peyton-Jones
essage ----- From: "Simon Peyton-Jones" [EMAIL PROTECTED] To: "Sigbjorn Finne" [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 04:03 Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs Should I change the Report wording to be clearer? Si

Haskell 98 Report: May release

2002-06-07 Thread Simon Peyton-Jones
Folks, I've finally managed to push out the May 2002 release of the Haskell 98 report. http://research.microsoft.com/~simonpj/h98-revised As far as I know there are no outstanding issues, so I hope that there will be blissful silence for a month and I can freeze it. I'd have done so

RE: Library report, monad zero laws

2002-06-21 Thread Simon Peyton-Jones
if nothing substantial arises before then. Simon | -Original Message- | From: Jon Fairbairn [mailto:[EMAIL PROTECTED]] | Sent: 20 June 2002 16:27 | To: Simon Peyton-Jones | Subject: Library report, monad zero laws | | | The old report used to include | | m zero = zero | zero = m = zero

RE: foralls in class assertions

2002-07-22 Thread Simon Peyton-Jones
would love you for ever, rather than it'd be nice. Simon lazy evaluation PJ | -Original Message- | From: Ashley Yakeley [mailto:[EMAIL PROTECTED]] | Sent: 19 July 2002 03:24 | To: Simon Peyton-Jones; Haskell List | Subject: RE: foralls in class assertions | | | At 2002-02-20 13:15, Simon

RE: another minor fault in the Haskell Report

2002-07-22 Thread Simon Peyton-Jones
Thanks. Fixed. Incidentally, the cement is set just about solid. I've had no substantive bug reports since the June release, so I'm on the point of declaring the H98 Report finished. I'm just waiting for a few hours spare to do some cosmetics. (This message is a genuine bug, but I'm not

Bug in library report

2002-07-23 Thread Simon Peyton-Jones
Folks, Another small but long-standing bug in the Haskell Library report: the recursive calls to 'reads' and 'shows' in the Read and Show instances for Ratio and Array should be calls to readsPrec and showsPrec respectively. The corrected defintions are below. (c.f. the example of derived

RE: functional dependencies

2002-07-23 Thread Simon Peyton-Jones
I'm just catching up with some old mail here. Iavor writes: | class C a b | a - b | class C a b = D a | | vs. | | class C a b | a - b | class C a b = D a b | | Hugs accepts both of those, while GHC insists on the second. | The first example is a little shorter and one might argue that if

RE: Bug in library report

2002-07-24 Thread Simon Peyton-Jones
| As near as I can tell, the precedence of the bounds and | indices in an array doesn't matter at all. Simon M's | suggested change to Page 24 is therefore good for | consistency, but doesn't appear to actually have any effect. | Am I missing something? I think you are right, because the

RE: deriving instances for hidden types

2002-07-29 Thread Simon Peyton-Jones
| I've often felt a tinge of disappointment not being able to | derive classes over data structures that are defined in the | libraries (DeepSeq FiniteMap, for instance). I was wondering | if any of the tools (drift, etc.) or GHCs built-in meta | programming would allow you to say something

Haskell 98 report

2002-07-30 Thread Simon Peyton-Jones
Folks I'm happy to say that the Haskell 98 Report (both language and libraries) is going to be published as a book! It'll be a (very) special issue of the Journal of Functional programming (Jan 2003), but will be available separately through bookshops as a book published by Cambridge

RE: ambiguous type variables in existential classes

2002-08-28 Thread Simon Peyton-Jones
Hal I don't quite understand the intuitions behind your program, but the bug is easy enough: | instance (Eq e, Foo p) = Foo (Wrap p) where | foo (Bar p) e q = foo p e q This instance declaration is guaranteed to give problems if it is ever used, and GHC should probably bleat about it.

RE: ugliness with state parameter in ST stuff

2002-08-28 Thread Simon Peyton-Jones
I don't know what you are trying to do, but I do know why your program is rejected. The *whole point* of a value of type (STArray s Int Int) is that it can only be read by a state thread with the same type parameter 's' as the array. Given your decls class Foo a where foo :: a - IO Int

RE: difference between (evaluate . runST) and stToIO

2002-08-28 Thread Simon Peyton-Jones
They aren't identical. runST guarantees to run a complete state thread that can't interact with any other. stToIO runs some imperative actions that might interact with other stToIO calls. You might find it helpful to read 'State in Haskell' if you havn't already done so. Simon |

RE: GHC bug,or Hugs feature?

2002-08-28 Thread Simon Peyton-Jones
There are two things going on. 1. Hugs deals with mutual recursion in a more sophisticated way than GHC. Mark T is absolutely right, and the THIH paper explains. 2. Furthermore,GHC implements the H98 requirement that the context of all functions in a mutually recursive groups must be the

RE: Labelled types question

2002-09-10 Thread Simon Peyton-Jones
The code should not be able to see c. Nor the data constructor A. You don't say which Haskell implementation you are using. Simon | -Original Message- | From: Andre W B Furtado [mailto:[EMAIL PROTECTED]] | Sent: 09 September 2002 19:15 | To: [EMAIL PROTECTED] | Subject: Labelled types

RE: H98 Report: Unicode (was: Re: H98 Report: input functions)

2002-09-11 Thread Simon Peyton-Jones
Ketil says: | While we're at it, are there any plans to remove this paragraph from | section 2.1: | | | Haskell uses a pre-processor to convert non-Unicode character sets | | into Unicode. This pre-processor converts all characters to Unicode | | and uses the escape sequence \u, where the h

RE: Labelled field restrictions

2002-09-13 Thread Simon Peyton-Jones
A perfectly sensible idea. Main difficulty I see: its not clear what T.x would mean if both type T and module T existed, though. Also if I have data T = T { x,y::Int } data S = S { x,y::Int } I might write f :: S - T f s = T { x = S.y s, y = S.x s } So just

RE: Haskell 98: Behaviour of hClose

2002-09-17 Thread Simon Peyton-Jones
Sigbjorn writes: | Re: your request to have a final look through the report | for any wibbles that might remain -- Section 11.3.2 of the | lib report isn't clear on what the expected behaviour of | (hClose h hClose h) ought to be, i.e., will the second | hClose fail or not? | | Both GHC and

RE: Haskell 98: Behaviour of hClose

2002-09-18 Thread Simon Peyton-Jones
| No yelling, but some random points for consideration: | | 1. It might be worth being more explicit, i.e. stating whether this is | because the runtime explicitly enables echoing, or because it's | assumed that echoing will already be enabled. Well, at Haskell user doesn't care. It's

RE: Haskell 98: Behaviour of hClose

2002-09-18 Thread Simon Peyton-Jones
What I intended was a simple interactive Haskell program should behave the same on any OS/environment What you and Ross seem to be saying is no, the behaviour of the program can, and should, depend on the OS/environment If that's the consensus I'll happily

RE: Haskell 98: Behaviour of hClose

2002-09-18 Thread Simon Peyton-Jones
Ahem how true. I have not idea why it was removed. But I can't put anything back in at this stage. Simon | -Original Message- | From: Malcolm Wallace [mailto:[EMAIL PROTECTED]] | Sent: 18 September 2002 10:04 | To: Simon Peyton-Jones | Cc: [EMAIL PROTECTED] | Subject: Re: Haskell 98

RE: Haskell 98: Behaviour of hClose

2002-09-19 Thread Simon Peyton-Jones
Peyton-Jones | Cc: [EMAIL PROTECTED] | Subject: RE: Haskell 98: Behaviour of hClose | | | Simon Peyton-Jones wrote: | | | | 2. Is there actually anything special about the treatment of stdin, or | | does this apply to any input stream which is associated with a | | terminal? | | I'm

Haskell 98

2002-09-19 Thread Simon Peyton-Jones
Folks As you know, we're in the home straight for Haskell 98. With the exception of the recent discussion of echoing, there have been very, very few changes since the May release. (Check out the bugs list.) Cambridge University Press are going to publish the Language and Library Reports, both

RE: Haskell 98

2002-09-19 Thread Simon Peyton-Jones
| contributions. So the book currently shows me as editor, while the | preface attempts to give credit where credit is due. Please help me to | improve it. | | You don't specify very clearly when someone deserves to be on the | contribution list. | | I reported some errors in the report

RE: Haskell 98: Behaviour of hClose

2002-09-24 Thread Simon Peyton-Jones
On the matter of echoing, in Section 7.1 there seem to be two possibilities: 1. Delete the sentence By default, these input functions echo to standard output. altogether. 2. Replace the sentence by If the standard input (stdin) is a terminal device, any input on stdin is

RE: Haskell 98: Behaviour of hClose

2002-09-24 Thread Simon Peyton-Jones
Glynn writes: | 2. Regarding the buffering issue, I suggest adding something along the | lines of the following to section 11.4.2 of the library report: | | For a stream which is associated with a terminal device, setting the | mode to no-buffering will also disable any line-buffering which

RE: report definition of field names

2002-09-25 Thread Simon Peyton-Jones
| Replace: | A datatype declaration may optionally include field labels for some | or all of the components of the type. | With: | A datatype declaration may optionally include field labels. Each | constructor must use either labelled fields or unlabelled fields, | but

RE: empty field label constructor infelicity

2002-09-25 Thread Simon Peyton-Jones
| The report says The expression F {}, where F is a data constructor, is | legal whether or not F was declared with record syntax, provided F has no | strict fields: it denotes F _|_1 ... _|_n where n is the arity of F. | | It unclear to me why there needs to be this provision for records with

Haskell 98

2002-09-25 Thread Simon Peyton-Jones
| The report says The expression F {}, where F is a data constructor, is | legal whether or not F was declared with record syntax, provided F has no | strict fields: it denotes F _|_1 ... _|_n where n is the arity of F. | | It unclear to me why there needs to be this provision for records with

RE: Haskell 98

2002-09-25 Thread Simon Peyton-Jones
| I think the sentence in question (end of 3.15.2) is just a clarification; | the preceding 4 rules are sufficient and clear: F{}, S{} and S{x=3} are | all illegal because they omit a value for a strict field. That is, it's | correct, though not strictly necessary, nor does it cover all the

RE: GHC, Parallel libraries

2002-10-15 Thread Simon Peyton-Jones
| I looked on the web for a precompiled binary version of those | libraries, in vain. I found the GUM web page but it seems to be much | outdated, based on the ghc-4.06. Is there any more recent version available? Not as far as I konw. The parallel version of GHC is maintained and developed by

RE: forall and class contexts

2002-10-16 Thread Simon Peyton-Jones
| I want to define something like | class (Eq (forall a. T a), Monad T) = C T | where the context shall mean that T has to be an instance of Monad and | that for every type a the type T a has to be an instance of Eq. | Is such a thing possible with some Haskell implementation? Not currently,

RE: precedence bug with derived instances

2002-10-22 Thread Simon Peyton-Jones
| (1) In the first section, in: | | instance (cx, cx') = Ci (T u1 ... uk) where { d } | | the use of (cs, cs') is a bit loose (that is, suggestive rather than | precise syntax). One can't (according to the report, though GHC seems to | allow it) have nested parentheses in a context, which

RE: precedence bug with derived instances

2002-10-18 Thread Simon Peyton-Jones
| In GHC 5.04.1, derived instances of Show mishandle precedence: | | Prelude putStrLn (showsPrec 10 (Just 0) ) | Just 0 | | The result should be: (Just 0) I think it's a bug in the Report, not in GHC, actually. The Report says (Section D.4) The function 'showsPrec d x r' accepts a

RE: Rational sequence

2002-10-24 Thread Simon Peyton-Jones
Folks The concrete is setting fast, but Ross points out that the instance for Enum (Ratio a) is inconsistent with that for Enum Float and Enum Double. (It's strange that these non-integral types are in Enum, but we're stuck with that.) All three use 'numericEnumFrom' etc for the enumFrom method,

RE: Rational sequence

2002-10-24 Thread Simon Peyton-Jones
| Since I suppose you also want to receive constructive suggestions, | I'd suggest to remove some instance definitions from the | report. I definitely can't do that at this stage. I have never liked Float/Double/Ratio being in Enum, but there is no possibility of removing them now. A year or

RE: Rational sequence

2002-10-25 Thread Simon Peyton-Jones
| | It's inconsistent to remove the +1/2 for numericEnumFromTo but to leave | the +(n'-n) for numericEnumFromThenTo. I think you probably mean to | remove both (actually, all three). | | I wouldn't recommend these changes for Float and Double (the increments | are there to account for

RE: Rational sequence

2002-10-25 Thread Simon Peyton-Jones
| I definitely can't do that at this stage. I have never liked | Float/Double/Ratio being in Enum, but there is no possibility of | removing them now. A year or two ago, maybe. | | Just to clarify: Did you mean for Haskell 98 or did you mean forever? Thanks for raising that I

RE: problems with ghc ffi

2002-11-04 Thread Simon Peyton-Jones
GHC questions to ghc-users please, not the main Haskell list. You need the -ffi flag to use the FFI. S -Original Message- From: David Abbs [mailto:[EMAIL PROTECTED]] Sent: 04 November 2002 14:38 To: [EMAIL PROTECTED] Subject: problems with ghc ffi I am having

RE: Module re-exportation weekend puzzler

2002-11-06 Thread Simon Peyton-Jones
Thomas, Iavor, Thanks for your message. | Are you saying that you think the report doesn't fully define the | meaning of the module system, or just that difficult to understand and | needs to be clarified? The former, and hence it ought to be clarified. But after contemplating your message,

The Haskell 98 Report

2002-11-29 Thread Simon Peyton-Jones
, but it places no limitations on what else may be done with it. The copyright will still be (c) Simon Peyton Jones (as it has for some while; it has to be attached to someone or some thing), and the existing notice that says you can do what you like with this Report will stay unchanged. No non

Template Haskell

2003-01-06 Thread Simon Peyton-Jones
Folks Template Haskell is now being used by a few brave souls (they have to build GHC from scratch), and I don't want to overload the Haskell mailing list with nitty-gritty discussion about the finer points of TH. So Simon M has created a separate mailing list [EMAIL PROTECTED] for

RE: Gtk and Object I/O

2003-01-20 Thread Simon Peyton-Jones
| going to stop gtk+hs because of this. So it seems we are all | waiting for the critical user mass that makes our own beloved | GUI library (binding) the standard GUI library. For the sake | of Haskell, we can only hope that this will actually happen | one day. A sad side-effects of this is

RE: Arrays vs Lists and Specialization

2003-01-22 Thread Simon Peyton-Jones
Matthew | Many spectral estimation routines are defined in terms of special | matrices (ie, Toeplitz, etc). Arrays defined recursively by list | comprehensions make it easy to implement algorithms like Levinson-Durbin | recursion, and they look very similar to the mathematical definitions: | |

RE: time since the epoch

2003-02-03 Thread Simon Peyton-Jones
| the haskell 98 time library is horribly broken, if you are using ghc, | you can deconstruct the time constructor which has an Integer containing | the number of seconds since epoch... otherwise you can use | ... | I dont supose this could be considered a typo in the haskell 98 report? | it is

RE: [OT] Teaching Haskell in High School

2003-02-04 Thread Simon Peyton-Jones
Don't forget Helium (recently announced) http://www.cs.uu.nl/~afie/helium/index.html Also Manuel Chakravarty teaches Haskell to hordes. Simon | -Original Message- | From: Hal Daume III [mailto:[EMAIL PROTECTED]] | Sent: 04 February 2003 00:02 | To: Haskell Mailing List | Subject:

RE: filter and Prelude index in H98 report?

2003-02-10 Thread Simon Peyton-Jones
No there isn't. Its in the revised version at http://research.microsoft.com/~simonpj/haskell98-revised/haskell98-repor t-html/index.html I'll ask John to upload it. Simon | -Original Message- | From: Antony Courtney [mailto:[EMAIL PROTECTED]] | Sent: 07 February 2003 22:04 |

RE: effect of order of function arguments

2003-02-19 Thread Simon Peyton-Jones
| GHC used to have an optimisation for static argument like this. It would | turn both of the above programs into a similar form using a local | recursive function: | | interp y xs = interpaux xs | where interpaux [] = [] | interpaux (x:[]) = x:[] | interpaux (x:xs) =

RE: fundeps for extended Monad definition

2003-02-27 Thread Simon Peyton-Jones
Interesting example | class Monad2 m a ma | m a - ma, ma - m a where | return2 :: a - ma | bind2 :: Monad2 m b mb = ma - (a - mb) - mb | _unused :: m a - () | _unused = \_ - () | instance Monad2 [] a [a] where | bind2 = error urk The functional dependencies say m a -

RE: fundeps known beforehand (was RE: fundeps for extended Monad definition)

2003-02-28 Thread Simon Peyton-Jones
| since this claims that it will take a Bool and produce a value of type b | for all types b. However, would it be all right to say (in | pseudo-Haskell): | | f :: exists b . Bool - b | f x = x But this is a singularly useless function, because it produces a result of utterly unknown type, so

RE: fundeps for extended Monad definition

2003-03-03 Thread Simon Peyton-Jones
| The reason, which is thoroughly explained in Simon Peyton-Jones' | message, is that the given type signature is wrong: it should read | f1 :: (exists b. (C Int b) = Int - b) | | Right. Simon pointed out that this is a pretty useless function, but not | entirely so, since the result

The Revised Haskell 98 Report

2003-03-03 Thread Simon Peyton-Jones
Folks I am holding in my hands the first copy of the Haskell 98 Report to roll off the presses at Cambridge University Press. It looks great. And it has a copyright notice that says It is intended that this Report belong to the entire Haskell community..., just as the online version does.

RE: First-class types

2003-03-04 Thread Simon Peyton-Jones
| The following is a more flexible alternative to overloading. We | essentially define a function on types and invoke it, seemingly at run | time. No Dynamics or unsafe computations are employed. We only need | existential types, multi-parameter classes and functional | dependencies. The code also

RE: fundeps for extended Monad definition

2003-03-04 Thread Simon Peyton-Jones
| I believe something along the lines of the following would work: | | class C a b | a - b where { foo :: b - String } | instance C Int Int where { foo x = show (x+1) } | x :: forall b. C Int b = b | x = 5 | | (Supposing that the above definition were valid; i.e., we didn't get the | type

RE: Persistent data

2003-03-04 Thread Simon Peyton-Jones
GHC has a multi-generational garbage collector. If you have enough physical memory on your machine so that the GC isn't thrashing trying to find the 100 free bytes that remain, then you should find the database migrates to the oldest generation and stays there. If you use +RTS -Sstderr you'll

<    1   2   3   4   5   6   7   8   9   10   >