pattern signatures

Simon Peyton Jones simonpj at
Mon Jan 8 12:59:50 UTC 2018

I like the idea of distinguishing “signatures” from “annotations”.

But then what is currently a “pattern signature” with extension -XPatternSignatures, becomes “type annotation in a pattern” or perhaps “pattern type-annotation” which is a bit clumsy.

Possibly “type specification” instead of “type annotation”.  Thus “pattern type-spec” which is snappier.


From: ghc-devs [mailto:ghc-devs-bounces at] On Behalf Of Spiwack, Arnaud
Sent: 08 January 2018 10:11
Cc: Joachim Breitner <mail at>; ghc-devs at
Subject: Re: pattern signatures

In my eyes, signatures are something which goes with a definition.
So (a) is a pattern (synonym) signature, while (b) is merely a type annotation on a pattern.

On Fri, Jan 5, 2018 at 11:23 PM, Iavor Diatchki <iavor.diatchki at<mailto:iavor.diatchki at>> wrote:
Well, as you say, "pattern signature" makes sense for both, so I would expect to use context to disambiguate.  If I wanted to be explicit about which one I meant, I'd use:

a) "Pattern synonym signature"
b) "Signature on a pattern"


On Fri, Jan 5, 2018 at 1:12 PM Joachim Breitner <mail at<mailto:mail at>> wrote:

Am Freitag, den 05.01.2018, 13:42 -0500 schrieb Brandon Allbery:
> Further complicated by the fact that that form used to be called a
> "pattern signature" with accompanying extension, until that was
> folded into ScopedTypeVariables extension.

which I find super confusing, because sometimes I want a signature on a
pattern and it is counter-intuitive to me why I should not longer use
the obviously named PatternSignatures extension but rather the at first
glance unrelated ScopedTypeVariable extension.

But I am derailing the discussion a bit.


Joachim Breitner
  mail at<mailto:mail at><>
ghc-devs mailing list
ghc-devs at<mailto:ghc-devs at><>

ghc-devs mailing list
ghc-devs at<mailto:ghc-devs at><>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list