Nested pattern binding translates to outermost binding?

Simon Peyton-Jones simonpj at microsoft.com
Mon Jul 9 04:38:39 EDT 2007


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: haskell-prime-bounces at haskell.org [mailto:haskell-prime-bounces at haskell.org] 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 at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-prime


More information about the Haskell-prime mailing list