Nested pattern binding translates to outermost binding?

Dan Weston westondan at
Fri Jul 6 15:08:01 EDT 2007

 From Haskell' ticket #76:

 > 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?


More information about the Haskell-prime mailing list