Is it possible to document a class method with Haddock and query pieces of documentation in the instance declaration code?
For exemple, I would like the class documented like this :
class ModifMATH a where
-- | Explanations of simpMath method.
--
--
-- $part1
-- $part2
-- $part3
simpMath :: a -> a
and the instance documented like this :
instance ModifMATH MathExpress where
-- $part1 a piece of explanation
simpMath (MathDouble n) = ...
-- $part2 another explanation
simpMath (MathMult a b) = ...
-- $part3 end of explanations
simpMath (MathAdd a b) = ...
and get the html Haddock documentation look like this (sorry i have no image) :
class ModifMATH a where
Methods
simpMath :: a -> a
Explanations of simpMath method.
a piece of explanation
another explanation
end of explanations
This organization of documentation would be more readable and extensible when adding patterns in the instance while keeping the whole method documentation in a stand-alone paragraph. Is it possible?
I'm using Haddock version 2.10.0. on Debian 7.0.
Thank you for your help.