[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell
Subject:    SYNTAX ONLY
From:       Nick North <ndn () seg ! npl ! co ! uk>
Date:       1991-03-20 9:40:14
Message-ID: 13563.9103191403 () guava ! seg ! npl ! co ! uk
[Download RAW message or body]

Original-Via: uk.ac.ukc; Tue, 19 Mar 91 14:20:27 GMT
Date: Tue, 19 Mar 91 14:03:32 GMT
From: Nick North <ndn@seg.npl.co.uk>
To: haskell@cs.glasgow.ac.uk
Subject: SYNTAX ONLY
Sender: haskell-request@cs.glasgow.ac.uk

I would like to put in a plea for the Haskell syntax to allow empty
declarations (impdecls, fixdecls, topdecls and decls). This is to
aid those of us who automatically generate Haskell programs. The
effect would be to allow semicolon as a terminator or a separator
of declarations (since decl;decl; can be parsed as decl;decl;empty).

Let me try to convey the advantage of this scheme. Assume I have
generated a Haskell program consisting of a list of type declarations
and a list of value declarations. The natural way to print this is
to map some printing function over the type declarations, then do
the same thing to the value declarations.
The difficulty lies in where to put the semicolons: if they are
declaration separators, then they go between the type declarations
and between the value declarations and then an extra one between the types
and the values if and only if both lists are non-empty. This complicates
my printing process as I need an extra check for whether to place a
semicolon between the types and the values.
On the other hand, if empty declarations are allowed, so that semicolon
can be used as a declaration terminator, then we just put a semicolon
after every declaration. Easy.

The non layout-sensitive version of the syntax is there to help
automatic program generators and I think this change would make it even
more useful.

Nick North
National Physical Laboratory



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic