RE: Nested pattern binding translates to outermost binding?
In the section Changes to the Report of the Wiki page you refer to http://hackage.haskell.org/trac/haskell-prime/wiki/BangPatterns I attempted to give the semantics of bang-patterns by saying what changes would be needed in the Haskell Report. If you think it's incomplete or ambiguous, then do yell. (The wiki says that the changes are incomplete but I can't now think why!) Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan | Weston | Sent: 06 July 2007 20:08 | To: Haskell Prime | Subject: Nested pattern binding translates to outermost binding? | | From Haskell' ticket #76: | http://hackage.haskell.org/trac/haskell-prime/wiki/BangPatterns | | The main idea is to add a single new production to the syntax | of patterns |pat ::= !pat | | Experiments (ghci -fbang-patterns -O2 -S, rename identifiers, then diff) | shows that nested pattern bindings are equivalent to the outermost binding: | | !(!pat) == !pat | !(~pat) == !pat | | ~(~pat) == ~pat | ~(!pat) == ~pat | | but I do not see any wording to that effect either in the Haskell 98 | report, the GHC documentation, or the Haskell' wiki. Have I overlooked | it, or does it follow from the existing language definition? | | Dan | | ___ | Haskell-prime mailing list | Haskell-prime@haskell.org | http://www.haskell.org/mailman/listinfo/haskell-prime ___ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime
Re: Nested pattern binding translates to outermost binding?
On Fri, Jul 06, 2007 at 06:20:45PM -0700, Dave Bayer wrote: On Jul 6, 2007, at 1:46 PM, Stefan O'Rear wrote: You could have just used -ddump-ds... Core is way more readable than GHC assembly. Great suggestion! Core looks familiar from playing with template Haskell, is it identical? No, Core is much lower level. It does not have guards, where-blocks, list comprehensions, type classes, etc; everything is reduced to simple pattern bindings, lambdas, lets, applications, and unboxed literals. Can one / does anyone use Core as a target for experimental toy languages? Aside from the moving target caveats... Apparently not, since GHC's support for *reading* core has been broken since the 6.0 days with nary a complaint. (Aaron Tomb and Tim Chevalier are currently working on fixing it). Stefan ___ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime