Proposal: fix "simple pattern binding" and "declaration group"

Paterson, Ross R.Paterson at city.ac.uk
Mon Jun 27 16:02:33 CEST 2011


> For example, section 3.13 ends with the note:
>
>       case x of { (a,_) | let b = not a in b :: Bool -> a }
>
>       ... Programmers are advised, therefore, to avoid guards that
>       end with a type signature.

I would support changing "a type signature" to "an expression type
signature" in this note for consistency.

> There is no a priori reason why b should depend on a in a pair of
> bindings such as these:
>
>        a = const (\x -> x) b
>        b = const (a :: Int -> Int) (a :: Bool -> Bool)

There is: section 3.16 says that in an expression type signature e::t,
the type derived for e must be more specific than t.  To derive the
type of e, in this case a, before matching it against t, we have no
alternative but to use the definition of a.

> Even if you don't think the report is ambiguous, it is at least prone
> to misinterpretation, which is why a couple of examples would really
> help at the end of 4.5.1.

Fair enough.  Perhaps the example on the H' page would help:

http://hackage.haskell.org/trac/haskell-prime/wiki/RelaxedDependencyAnalysis



More information about the Haskell-prime mailing list