Ticket #3427 (new bug)

Opened 3 years ago

Last modified 4 months ago

control what sort of entity a deprecated pragma applies to

Reported by: igloo Owned by:
Priority: low Milestone: 7.6.1
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Originally reported as part of #3303.


It's annoying not being able to control whether a type or identically named constructor is being deprecated. Consider:

data Foo = Foo ...

This is a very common idiom. But now we want to switch to smart constructors

foo :: ... -> Foo

and eventually stop exporting the constructor Foo. But we cannot specify just the constructor, only both. According to the  user guide the workaround would be to have a module that imports one but not the other, however while that's possible for the type it's not possible for the constructor.

How about

{-# DEPRECATED constructor Foo "use `foo' instead" #-}

and while we're at it, might as well have

{-# DEPRECATED type Foo "..." #-}

leaving the unqualified case meaning both as it does now.

Change History

Changed 18 months ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 15 months ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 8 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 4 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1
Note: See TracTickets for help on using tickets.