Ticket #144 (new enhancement)

Opened 4 years ago

Last modified 2 months ago

Allow -- ^ comment on record constructor

Reported by: heatsink Owned by:
Priority: major Milestone:
Version: 2.14.0 Keywords:
Cc:

Description

This enhancement would add flexibility to the commenting style for record constructors. Accept a -- ^ comment between a constructor and its fields, meaning the same as a -- | comment before the constructor. The example below is rejected as a parse error due to the comment on 'Branch'.

-- | A tree with labeled internal nodes
data Tree =
    Empty                -- ^ Leaf
  | Branch               -- ^ Internal node
    { label :: a         -- ^ Node label
    , subtrees :: [Tree] -- ^ List of subtrees
    }

Change History

Changed 19 months ago by anonymous

  • milestone 2.7.0 deleted

Milestone 2.7.0 deleted

Changed 2 months ago by Fūzetsu

  • version changed from 2.6.1 to 2.14.0

See this GHC ticket for development. The change has to be made on their side (the comment needs to be attached to the constructor) at which point, it should auto-magically work in Haddock.

I'll close this when/if the change makes it into GHC/gets rejected.

Note: See TracTickets for help on using tickets.