Haskellers! It's that time of the month. I'm putting out the November release of the Revised Haskell 98 Report. As ever, I earnestly seek your feedback. Especially I'd like to know whether I have stumbled in rewriting the section about Enum in the light of recent email. http://research.microsoft.com/~simonpj/haskell98-revised My plan is to iterate just once more (early Dec), and then freeze the report at Christmas. I'm getting tired! Simon
On Fri, Nov 02, 2001 at 09:30:36AM -0800, Simon Peyton-Jones wrote:
Haskellers!
Hi Simon :-)
It's that time of the month. I'm putting out the November release of the Revised Haskell 98 Report. As ever, I earnestly seek your feedback. Especially I'd like to know whether I have stumbled in rewriting the section about Enum in the light of recent email.
http://research.microsoft.com/~simonpj/haskell98-revised/haskell98-report-ht... says "Revised: October 2001" - am I seeing the latest version? Actually, http://research.microsoft.com/~simonpj/haskell98-revised/haskell98-report-ht... has "November 2001" at the bottom so I guess I am. You still have lexeme -> ... | qop | ... in the lexical syntax but have qop -> qvarop | qconop in the context-free syntax - is this deliberate? It really sucks IMO.
My plan is to iterate just once more (early Dec), and then freeze the report at Christmas. I'm getting tired!
:-) Thanks Ian
Hi Simon
It's that time of the month. I'm putting out the November release of the Revised Haskell 98 Report. As ever, I earnestly seek your feedback.
In appendix B (syntax), B.3 (layout) says * A stream of tokens as specified by the lexical syntax in the Haskell report, with the following additional tokens: + If the first *token after a let, where, do, or of keyword is not {, it is preceded by {n} where n is the indentation of the *token. + If the first *token of a module is not { or module, then it is preceded by {n} where n is the indentation of the *token. + Where the start of a *token does not follow any complete *token on the same line, this *token is preceded by <n> where n is the indentation of the *token, provided that it is not, as a consequence of the first two rules, preceded by {n}. I think the word "token" should be replaced with "lexeme" where I have marked it with *. I am also not clear what you mean by "complete token"? Finally, ghci, hi and hugs seem to accept
instance Fractional Int where
as a valid program, but the layout rule doesn't seem to specify how ot handle this (and as the last token is a new line token some simple fixes don't work). If I have this module:
module Foo where instance Fractional Int where foo = 5
then with ghci I can evaluate foo: Compiling Foo ( QQW.lhs, interpreted ) QQW.lhs:3: Warning: No explicit method nor default method for `fromRational' In the instance declaration for `Fractional Int' Foo> foo 5 Foo> hi lets me load it but complains when I try to evaluate it: Prelude> foo [Compiling... ==================================== Error when renaming:: Identifier foo used at 10:21 is not defined. (in overlap resolution) ...failed] Prelude> and hugs won't even let me load it: Reading file "QQW.lhs": ERROR QQW.lhs:4 - No member "foo" in class "Fractional" Prelude> As the report stands I don't think any implementation does the right thing, but that they should fail due to not being able to offsideify the module as n == m on the line defining foo so the { is neither explicitly nor implicitly provided for the idecls. Thanks Ian
On Sun, Nov 04, 2001 at 12:46:34AM +0000, Ian Lynagh wrote:
Finally, ghci, hi and hugs seem to accept
instance Fractional Int where
as a valid program, but the layout rule doesn't seem to specify how ot handle this (and as the last token is a new line token some simple fixes don't work).
Bother, completely forgot about this. I think after If the first token after a let, where, do, or of keyword is not {, it is preceded by {n} where n is the indentation of the token. (with s/token/lexeme/g as before) we need If there is no lexeme after a let, where, do, or of keyword then {0} is appended to the token stream. (thus forcing implicit { }). Ian
participants (2)
-
Ian Lynagh -
Simon Peyton-Jones