Opened 20 months ago

Closed 8 months ago

Last modified 8 months ago

#8584 closed feature request (fixed)

Pattern synonym type signatures

Reported by: cactus Owned by: cactus
Priority: normal Milestone: 7.10.1
Component: Compiler (Type checker) Version:
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: #5144 Blocking: #8968
Related Tickets: 8581 Differential Revisions:

Description (last modified by simonpj)

Currently, the only way to specify a type signature for a pattern synonym is by adding type annotations to the right-hand side, like this:

{-# LANGUAGE PatternSynonyms, ScopedTypeVariables #-}

pattern Single x = ([x] :: [Int])

Bespoke syntax for adding type signatures for pattern synonyms would probably be useful.

Link to PatternSynonyms for pattern synonym signatures for specification.

Change History (8)

comment:1 Changed 18 months ago by nomeata

JFTR: The code in master already contains a PatSynSig constructor, but it is dead code...

comment:2 Changed 16 months ago by cactus

It is not dead, just dormant :) Haddock uses it. The plan for this ticket is to add frontend (parser/typechecker) support for PatSynSig, but it's not done yet.

comment:3 Changed 12 months ago by cactus

  • Component changed from Compiler to Compiler (Type checker)
  • Keywords pattern synonyms added
  • Milestone set to 7.10.1
  • Owner set to cactus

comment:4 Changed 12 months ago by cactus

  • Blocking 8968 added

comment:5 Changed 11 months ago by cactus

comment:7 Changed 10 months ago by simonpj

  • Description modified (diff)

comment:8 Changed 8 months ago by cactus

  • Resolution set to fixed
  • Status changed from new to closed

comment:9 Changed 8 months ago by cactus

  • Keywords PatternSynonyms added; pattern synonyms removed
Note: See TracTickets for help on using tickets.