haddock icon indicating copy to clipboard operation
haddock copied to clipboard

Documentation to default signatures

Open Lev135 opened this issue 3 years ago • 0 comments

This code won't produce a haddock error. Nevertheless haddock comment to default bar will be lost. I think comments to default realizations are very useful, but if it's too hard to fix maybe it is possible to produce an error. I was very surprised not finding my comments in result, while all had been processed fine.

-- | MyClass
class MyClass m where
  -- | foo signature with default realization
  foo :: Num a => m a
  foo = bar

  -- | bar signature
  bar :: Num a => m a

  -- | default bar realization with restricted signature
  default bar :: (a ~ Int) => m a
  bar = foo

Lev135 avatar Aug 06 '22 13:08 Lev135