ghc feature request: core notes

Simon Peyton-Jones simonpj@microsoft.com
Tue, 4 Feb 2003 09:28:19 -0000


I have to say that I'm not very keen.  There is an annotation facility
in Core, but it's easy for the notes to be discarded.  So if they are
conveying important info, it might easily get lost... and if not, what's
it doing there in the first place.  What do you expect to happen to
these annotations?

So just now I'm a bit sceptical.  Core is a data type that I'm trying
hard to keep simple. =20

Simon

| -----Original Message-----
| From: Hal Daume III [mailto:hdaume@ISI.EDU]
| Sent: 03 February 2003 23:24
| To: GHC Users Mailing List
| Subject: ghc feature request: core notes
|=20
| I'm not sure how "generally useful" this would be, but I would find it
| useful to be able to attach notes to core expressions from the Haskell
| code.  The idea being something along the lines of a code annotation
like
| a pragma.  For instance, in my Haskell program I would have something
| like:
|=20
|   f x y =3D
|     case {-# CORE "my first note" #-} g x of
|       ...
|=20
| then, the core would come out with, instead of:
|=20
|   case g x of ...
|=20
| we would have
|=20
|   case {note "my first note"} g x of ...
|=20
| The reason I would find this useful is somewhat obscure, but the basic
| idea is that I need to be able to both preprocess code and then change
| core based on how it was preprocessed.  I'd like to send annotations
like
| these out of the preprocessor so they can then be picked up later by
my
| core transformer.
|=20
| If this sounds like a good enough idea to go in, but no one has time
to
| implement it, I could do it myself (probably), but I thought I'd ask
the
| experts first (or if there's anything like this in there currently)...
|=20
|  - Hal
|=20
| --
| Hal Daume III
|=20
|  "Computer science is no more about computers    | hdaume@isi.edu
|   than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users