[GHC] #10803: New TypeSignatureSections extension

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- = Preliminary specification Have - `(::` ''type'' `)` be syntax sugar for - `(\x -> x ::` ''type'' `)` This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e. {{{#!hs {#- LANGUAGE TypeSignatureSections #-} }}} TODO: formalise this a bit more -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * type: bug => feature request -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by spl): [http://augustss.blogspot.com/2014/04/a-small-haskell-extension.html Lennart Augustsson's proposal] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by spl): * cc: sean.leather@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by hvr): The beginning of an implementation can be found in the [https://git.haskell.org/ghc.git/commitdiff/refs/heads/wip/T10803 wip/T10803] branch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by hvr: Old description:
= Preliminary specification
Have
- `(::` ''type'' `)`
be syntax sugar for
- `(\x -> x ::` ''type'' `)`
This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e.
{{{#!hs {#- LANGUAGE TypeSignatureSections #-} }}}
TODO: formalise this a bit more
New description: Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson] Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch = Preliminary specification Have - `(::` ''type'' `)` be syntax sugar for - `(\x -> x ::` ''type'' `)` This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e. {{{#!hs {#- LANGUAGE TypeSignatureSections #-} }}} Typing judgement: {{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}} TODO: formalise this a bit more -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by hvr: Old description:
Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson]
Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch
= Preliminary specification
Have
- `(::` ''type'' `)`
be syntax sugar for
- `(\x -> x ::` ''type'' `)`
This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e.
{{{#!hs {#- LANGUAGE TypeSignatureSections #-} }}}
Typing judgement:
{{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}}
TODO: formalise this a bit more
New description: Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson] Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch = Preliminary specification Have - `(::` ''type'' `)` be syntax sugar for - `(\x -> x ::` ''type'' `)` This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e. {{{#!hs {-# LANGUAGE TypeSignatureSections #-} }}} Typing judgement: {{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}} TODO: formalise this a bit more -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by hvr: Old description:
Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson]
Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch
= Preliminary specification
Have
- `(::` ''type'' `)`
be syntax sugar for
- `(\x -> x ::` ''type'' `)`
This new syntax extension is enabled via a new `TypeSignatureSections` language pragma, i.e.
{{{#!hs {-# LANGUAGE TypeSignatureSections #-} }}}
Typing judgement:
{{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}}
TODO: formalise this a bit more
New description: Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson] Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch = Preliminary specification Have - `(::` ''type'' `)` be syntax sugar for - `(\x -> x ::` ''type'' `)` This new syntax extension is enabled via a new `SignatureSections` or maybe `TypeSignatureSections` language pragma, e.g. {{{#!hs {-# LANGUAGE TypeSignatureSections #-} }}} Typing judgement: {{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}} TODO: formalise this a bit more -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Changes (by hvr): * owner: => hvr * differential: => Phab:D1185 * type: bug => feature request -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New TypeSignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Changes (by hvr): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Description changed by hvr: Old description:
Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson]
Incomplete work-in-progress can be found in [https://git.haskell.org/ghc.git/log/refs/heads/wip/T10803 wip/T10803] branch
= Preliminary specification
Have
- `(::` ''type'' `)`
be syntax sugar for
- `(\x -> x ::` ''type'' `)`
This new syntax extension is enabled via a new `SignatureSections` or maybe `TypeSignatureSections` language pragma, e.g.
{{{#!hs {-# LANGUAGE TypeSignatureSections #-} }}}
Typing judgement:
{{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}}
TODO: formalise this a bit more
New description: Originally [http://augustss.blogspot.co.at/2014/04/a-small-haskell- extension.html proposed by Lennart Augustsson] See also SignatureSections = Preliminary specification Have - `(::` ''type'' `)` be syntax sugar for - `(\x -> x ::` ''type'' `)` This new syntax extension is enabled via a new `SignatureSections` (or maybe `TypeSignatureSections`) language pragma, e.g. {{{#!hs {-# LANGUAGE SignatureSections #-} }}} Typing judgement: {{{ _________________________ G ⊢ (:: ty) :: ty -> ty }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Comment (by goldfire): Adding a portion of a comment from Phab:D1185, as Trac is better for design discussions: Once we have the visible type application feature (#5296), is this one needed any more? Do we have real-ish examples of when we want signature sections? The examples for http://augustss.blogspot.co.at/2014/04/a-small- haskell-extension.html are all quite easy to write with visible type application. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Comment (by simonpj): Well, a type signature is a lot simpler to most people than figuring out the right type argument. It means there is more than one way to do something, but Haskell has a lot of those! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1185 -------------------------------------+------------------------------------- Comment (by goldfire): Fair enough. But I'm still worried about runtime implications of signature sections, as described in the Phab:D1185 comments. Visible type application doesn't have that problem. If I'm right in supposing that signature sections potentially have runtime implications, I personally would never use/recommend the feature. Agreed that sometimes a signature section is more convenient for the programmer than figuring out the right visible type application. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.1 => 8.2.1 Comment: This won't be happening for 8.0. Punting to 8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Changes (by akio): * cc: akio (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.4.1 Comment: It seems unlikely that this will happen for 8.2. Punting. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Is this needed now that we have visible type application -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.4.1 => 8.6.1 Comment: It seems pretty unlikely that this will happen for 8.6 and `TypeApplications` removes some of the need. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10803: New SignatureSections extension -------------------------------------+------------------------------------- Reporter: hvr | Owner: hvr Type: feature request | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1185 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.8.1 => Comment: It's not clear to me what the status of this is but it certainly isn't going to make 8.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10803#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC