
Yes, I'm afraid so. With -fglasgow-exts Template Haskell captures [t| ... |] and [p| ... |] and similarly [d| and [e| for quotations. I don't think I'd fully realised that this conflicts with list comprehensions [t|t<-ts] (I remember reading a book when I was 10 featuring kids trying to decode a message that was in two parts "mac" .. and "hine". Took me ages to spot "machine".) But maybe this isn't what you found? Better syntax here would be welcome if anyone can think of some. Simon | -----Original Message----- | From: glasgow-haskell-users-admin@haskell.org [mailto:glasgow-haskell-users-admin@haskell.org] | On Behalf Of John Meacham | Sent: 18 June 2003 03:24 | To: glasgow-haskell-users@haskell.org | Subject: @-bindings broken in 6.0? | | change in list comprehension parsing? | after I upgraded to ghc 6.0 there were some odd syntax errors on list | comprehensions which i did not get before, making sure i put spaces | between all symbols seems to fix them.. was something changed about how | they are parsed which breaks code that used to work? just curious. | John | -- | ------------------------------------------------------------------------ --- | John Meacham - California Institute of Technology, Alum. - john@foo.net | ------------------------------------------------------------------------ --- | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

yes. I use 't' as a variable rather often in this context. and -fglasgow-exts. that seems to be it. perhaps it should not interpret it as the special quotation if the comprehension doesn't end with |]? John On Wed, Jun 18, 2003 at 09:04:42AM +0100, Simon Peyton-Jones wrote:
Yes, I'm afraid so. With -fglasgow-exts Template Haskell captures [t| ... |] and [p| ... |] and similarly [d| and [e| for quotations. I don't think I'd fully realised that this conflicts with list comprehensions [t|t<-ts]
(I remember reading a book when I was 10 featuring kids trying to decode a message that was in two parts "mac" .. and "hine". Took me ages to spot "machine".)
But maybe this isn't what you found? Better syntax here would be welcome if anyone can think of some.
Simon
| -----Original Message----- | From: glasgow-haskell-users-admin@haskell.org [mailto:glasgow-haskell-users-admin@haskell.org] | On Behalf Of John Meacham | Sent: 18 June 2003 03:24 | To: glasgow-haskell-users@haskell.org | Subject: @-bindings broken in 6.0? | | change in list comprehension parsing? | after I upgraded to ghc 6.0 there were some odd syntax errors on list | comprehensions which i did not get before, making sure i put spaces | between all symbols seems to fix them.. was something changed about how | they are parsed which breaks code that used to work? just curious. | John | -- | ------------------------------------------------------------------------ --- | John Meacham - California Institute of Technology, Alum. - john@foo.net | ------------------------------------------------------------------------ --- | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------

I think symbols instead of letters in quotations would be better
[t| ... |]
[::| ... |] (but check "[::|" before a parallel array "[::]" )
and [p| ... |]
[@| ... |]
and similarly [d|
[{}| ... ] "[e|"? That's simply [| ... |] Christian

"Simon Peyton-Jones"
Yes, I'm afraid so. With -fglasgow-exts Template Haskell captures [t| ... |] and [p| ... |] and similarly [d| and [e| for quotations.
I had a similar experience when I defined the (?) operator. Which obviously clashes with the syntax for implicit paramters, unless surrounded by spaces.
But maybe this isn't what you found? Better syntax here would be welcome if anyone can think of some.
I think lumping all these extensions under one switch is the problem. I find it hard to do useful stuff without some extensions, but would rather not be bitten by this kind of things. Isn't it possible to provide e.g. implicit parameters and template Haskell as "magical modules"? So that "import Template" enables the syntax above, and I could use "import MultiParameterTCs" but not "ImplicitParams", for instance? Or at least, provide different -fglasgow-exts flags to fine tune which extensions are being used. -kzm -- If I haven't seen further, it is by standing in the footprints of giants

I think lumping all these extensions under one switch is the problem. I find it hard to do useful stuff without some extensions, but would rather not be bitten by this kind of things.
Hear hear :). I agree. Though the only extension which gets me is TH (both the |] issue mentioned here and the glomming of $, as in: map$filter f which is now interpreted as TH). Perhaps a -fno-th flag would be sufficient :) - Hal

On Wednesday 18 June 2003 01:04 am, Simon Peyton-Jones wrote:
Better syntax here would be welcome if anyone can think of some.
Why not add a '|' after the initial '[': [|t| ... |] and [|p| ... |] It may be a little more heavyweight but it is symmetrical (and probably makes parsing easier too). I haven't played with Template Haskell at all, so I don't know if '[|' is already a distinguished token. Cheers, Andy -- Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com
participants (7)
-
Andy Moran
-
Christian Maeder
-
Hal Daume III
-
John Meacham
-
ketil@ii.uib.no
-
Ralf Hinze
-
Simon Peyton-Jones