pattern signatures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

pattern signatures

Richard Eisenberg-4
Hi devs,

Is a pattern signature

a) something you put after `pattern P ::` ?
b) something you put after `::` in a pattern, as in `foo (Proxy :: Proxy a)` ?

I've seen the term "pattern signature" apply to both, and I've been tripped up by this. Does anyone have terminology that unambiguously separates these two constructs that we can all adopt?

Thanks!
Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

RE: pattern signatures

GHC - devs mailing list
Ah yes. I think we started with "pattern synonym signature" for (b) but have since denenerated to "pattern signature" which is quite confusing.

User advice would be good!

S

|  -----Original Message-----
|  From: ghc-devs [mailto:[hidden email]] On Behalf Of
|  Richard Eisenberg
|  Sent: 05 January 2018 13:48
|  To: GHC <[hidden email]>
|  Subject: pattern signatures
|  
|  Hi devs,
|  
|  Is a pattern signature
|  
|  a) something you put after `pattern P ::` ?
|  b) something you put after `::` in a pattern, as in `foo (Proxy ::
|  Proxy a)` ?
|  
|  I've seen the term "pattern signature" apply to both, and I've been
|  tripped up by this. Does anyone have terminology that unambiguously
|  separates these two constructs that we can all adopt?
|  
|  Thanks!
|  Richard
|  _______________________________________________
|  ghc-devs mailing list
|  [hidden email]
|  https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
|  askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-
|  devs&data=02%7C01%7Csimonpj%40microsoft.com%7Cbc86346cc90f4a9516d108d5
|  5442f5a0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6365075689386605
|  89&sdata=gvjnHyGAojz982UEV1u0hZPKH%2B%2F3UjiDlQm10%2BRZ7r8%3D&reserved
|  =0
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: pattern signatures

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.

On Fri, Jan 5, 2018 at 9:41 AM, Simon Peyton Jones via ghc-devs <[hidden email]> wrote:
Ah yes. I think we started with "pattern synonym signature" for (b) but have since denenerated to "pattern signature" which is quite confusing.

User advice would be good!

S

|  -----Original Message-----
|  From: ghc-devs [mailto:[hidden email]] On Behalf Of
|  Richard Eisenberg
|  Sent: 05 January 2018 13:48
|  To: GHC <[hidden email]>
|  Subject: pattern signatures
|
|  Hi devs,
|
|  Is a pattern signature
|
|  a) something you put after `pattern P ::` ?
|  b) something you put after `::` in a pattern, as in `foo (Proxy ::
|  Proxy a)` ?
|
|  I've seen the term "pattern signature" apply to both, and I've been
|  tripped up by this. Does anyone have terminology that unambiguously
|  separates these two constructs that we can all adopt?
|
|  Thanks!
|  Richard
|  _______________________________________________
|  ghc-devs mailing list
[hidden email]
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h
askell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-
|  devs&data=02%7C01%7Csimonpj%40microsoft.com%7Cbc86346cc90f4a9516d108d5
|  5442f5a0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6365075689386605
|  89&sdata=gvjnHyGAojz982UEV1u0hZPKH%2B%2F3UjiDlQm10%2BRZ7r8%3D&reserved
|  =0
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: pattern signatures

Joachim Breitner-2
Hi,

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.

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pattern signatures

Iavor Diatchki
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"

-Iavor




On Fri, Jan 5, 2018 at 1:12 PM Joachim Breitner <[hidden email]> wrote:
Hi,

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.

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: pattern signatures

Spiwack, Arnaud
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 <[hidden email]> 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"

-Iavor




On Fri, Jan 5, 2018 at 1:12 PM Joachim Breitner <[hidden email]> wrote:
Hi,

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.

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

RE: pattern signatures

GHC - devs mailing list

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.

 

Simon

 

From: ghc-devs [mailto:[hidden email]] On Behalf Of Spiwack, Arnaud
Sent: 08 January 2018 10:11
Cc: Joachim Breitner <[hidden email]>; [hidden email]
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 <[hidden email]> 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"

 

-Iavor

 

 

 

 

On Fri, Jan 5, 2018 at 1:12 PM Joachim Breitner <[hidden email]> wrote:

Hi,

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.

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

 


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: pattern signatures

Sylvain Henry-2

Or maybe "pattern ascription"? "type-ascription" is implied as "ascription" isn't commonly used for something else (AFAIK).

Sylvain


On 08/01/2018 13:59, Simon Peyton Jones via ghc-devs wrote:

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.

 

Simon

 

From: ghc-devs [[hidden email]] On Behalf Of Spiwack, Arnaud
Sent: 08 January 2018 10:11
Cc: Joachim Breitner [hidden email]; [hidden email]
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 <[hidden email]> 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"

 

-Iavor

 

 

 

 

On Fri, Jan 5, 2018 at 1:12 PM Joachim Breitner <[hidden email]> wrote:

Hi,

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.

Cheers,
Joachim

--
Joachim Breitner
  [hidden email]
  http://www.joachim-breitner.de/

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

 



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs