Opened 4 years ago

Last modified 11 months ago

#10803 patch feature request

New SignatureSections extension

Reported by: hvr Owned by: hvr
Priority: normal Milestone:
Component: Compiler Version: 7.10.2
Keywords: Cc: sean.leather@…, akio
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:

Description (last modified by hvr)

Originally 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.

{-# LANGUAGE SignatureSections #-}

Typing judgement:

_________________________
 G ⊢ (:: ty) :: ty -> ty

Change History (19)

comment:3 Changed 4 years ago by spl

Cc: sean.leather@… added

comment:4 Changed 4 years ago by hvr

The beginning of an implementation can be found in the wip/T10803 branch

comment:6 Changed 4 years ago by hvr

Description: modified (diff)

comment:7 Changed 4 years ago by hvr

Description: modified (diff)

comment:8 Changed 4 years ago by hvr

Differential Rev(s): Phab:D1185
Owner: set to hvr
Type: bugfeature request

comment:9 Changed 4 years ago by hvr

Status: newpatch

comment:10 Changed 4 years ago by hvr

Description: modified (diff)
Summary: New TypeSignatureSections extensionNew SignatureSections extension

comment:11 Changed 4 years ago 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.

comment:12 Changed 4 years ago 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!

comment:13 Changed 4 years ago 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.

comment:14 Changed 4 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:15 Changed 4 years ago by bgamari

Milestone: 8.0.18.2.1

This won't be happening for 8.0. Punting to 8.2.

comment:16 Changed 3 years ago by akio

Cc: akio added

comment:17 Changed 3 years ago by bgamari

Milestone: 8.2.18.4.1

It seems unlikely that this will happen for 8.2. Punting.

comment:18 Changed 2 years ago by Iceland_jack

Is this needed now that we have visible type application

comment:19 Changed 2 years ago by bgamari

Milestone: 8.4.18.6.1

It seems pretty unlikely that this will happen for 8.6 and TypeApplications removes some of the need.

comment:20 Changed 16 months ago by bgamari

Milestone: 8.6.18.8.1

These won't be fixed for 8.6, bumping to 8.8.

comment:21 Changed 11 months ago by bgamari

Milestone: 8.8.1

It's not clear to me what the status of this is but it certainly isn't going to make 8.8.

Note: See TracTickets for help on using tickets.