[Haskell-cafe] What is a "simple pattern binding"?

dm-list-haskell-cafe at scs.stanford.edu dm-list-haskell-cafe at scs.stanford.edu
Sun Jun 26 17:03:38 CEST 2011


At Sun, 26 Jun 2011 09:31:05 +0100,
Paterson, Ross wrote:
> 
> Indeed, the Report has two problems:
> 
> Sections 4.4.3.2 and 4.5.5 have different definitions of "simple pattern".
> This has been there since section 4.5.5 (Monomorphism Restriction) was
> added in Haskell 1.1.  But then the only technical use of the term is
> in section 4.5.5.
>
> When the definition of declaration group (section 4.5.1) was changed in
> Haskell 2010 to break dependencies on type signatures, Rule 1 of the
> Monomorphism Restriction (section 4.5.5), while not incorrect, became
> partially redundant and overly complex.  It could have been simplified
> along the lines you describe.

Aha!  This is starting to make sense!  Indeed the Haskell98 text is
far clearer, and when I look at the differences in section 4.5.1, I
start to understand what the committee meant.  Still, the clause

	b1 contains a free identifier that has no type signature and
	is bound by b2

applies the phrase "has no type signature" to the identifier, not to
the binding.  Such phrasing does not exclude expression
type-signatures.  I presume that in the following code, binding b1
does not depend on b2:

	(x, y) = (z, 1)          -- call this binding b1
	(z, _) = (2, y)          -- call this binding b2
	w = 1 + (z :: Double)

So my reading was that they meant "has no type signature *in b1*".
I take it that your reading is that they meant:

	b1 contains a free identifier that is bound by b2 and b2 is
	accompanied by a type signature for that identifier

I think, given the ambiguities here, it's worth filing a ticket on the
haskell' web site.

Thank you.
David



More information about the Haskell-Cafe mailing list