haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 241 forks source link

Haddock doesn't include selectors from record pattern synonyms #971

Open sjakobi opened 6 years ago

sjakobi commented 6 years ago

The module

{-# language PatternSynonyms #-}
module Lib where

pattern P{x, y} = (x, y)

has the following exports:

λ :browse Lib
pattern P :: a -> b -> (a, b)
x :: (a, b) -> a
y :: (a, b) -> b

But Haddock doesn't show x and y:

image

sjakobi commented 6 years ago

Oops. Seems like this is already fixed in the wip/hi-haddock tree: :)

image

What this doesn't reveal though, is that x and y can be used in the pattern:

λ P {x = 1, y = 2}
(1,2)
harpocrates commented 5 years ago

Even ghci's :browse does a pretty terrible job of presenting the information. We need some nice output presentation that

awpr commented 3 years ago

Some updates: