GHC changes

Steffen Mazanek steffen.mazanek at unibw-muenchen.de
Wed Oct 29 11:01:20 EST 2003


Hello GHC freaks,

I have made some changes to the GHC source
code (6.0.1) and I would really welcome your
feedback, whether they are ok for my task
(first step: introduce record expressions
of the shape 'struct {x1=e1,x2=e2,...,xn=en}'):

* added

 ("struct", ITstruct, bit glaExtsBit),

 to ghcExtensionKeywordsFM and
 ITstruct to Token
 in Lex.lhs
* added

 | Struct [(id, HsExpr id)]

 to data type HsExpr id in HsExpr.lhs
 Please tell me, what is this id for? Can it
 be used in this context? What is FastString?
* added

  'struct'       { ITstruct }

 to the token part of Parser.y (please tell me, why
 in the lexer we declare ITstruct to represent
 the keyword "struct" and in the parser specification
 we turn back to 'struct'),
 added

 structassignments
    : structassignments ',' structassignment      { $3 : $1 }
    | structassignments ','         { $1 }
    | structassignment { [$1] }
    | {- empty -}      { [] }
 structassignment
    : qvar '=' exp       { ($1,$3) }

 as new production rules (what type has structassignments? I can not simply
 write [(id,HsExpr id)], is qvar '=' exp appropriate? I do not understand
 structassignments completely (I have tried to make it analog to fbinds)),
 extended exp10 by

 | 'struct' '{' structassignments '}'  {Struct $3}
 | '{' structassignments '}' {Struct $2}

 and finally added

 | Struct [(id, HsExpr id)]

 to HsExpr

How can I speed up the recompilation process? I just want to check, whether my
changes are compilable or not, is it possible to switch off optimization and
other time consuming transformations?

At next I will try to master the following steps:
* embed the remaining new production rules to the parser, e.g., record
  type declaration, selectors, particular kind annotations
* adaptation of the type checker
* reduction of struct expressions

Thank you very much,
Steffen Mazanek



More information about the Glasgow-haskell-users mailing list