Is there any way to describe function parameters first in Haddock?

573 views Asked by At

Typical Haddock syntax allow to write something like this

-- Initializes local variables so arrays will get defined
--
-- Defer initialization context inside a compound type.
-- 
initialize :: Bool      -- ^ 1st parameter description  
           -> Type      -- ^ 2nd parameter description
           -> [Signal]  -- ^ 3rd parameter description
           -> Structure -- ^ 4th parameter description
           -> Doc       -- ^ result value desription
initialize _ (MachineVector 1 Pointer{}) = equals <+> text "NULL"

I want to write it in Java manner, where I have parameters description before function signature. I have more complex signatures, so this approach breaks readability. Is there any way to write like this?

-- Initializes local variables so arrays will get defined
--
-- Defer initialization context inside a compound type.
-- 
-- ^ 1st parameter description
-- ^ 2nd parameter description
-- ^ 3rd parameter description
-- ^ 4th parameter description
-- ^ result value desription
initialize :: Bool->Type->[Signal]->Structure->Doc       
initialize _ (MachineVector 1 Pointer{}) = equals <+> text "NULL"
1

There are 1 answers

1
rampion On BEST ANSWER