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"
The terms parameter and argument can be used for the same thing: information that are passed into a function. From a function's perspective: A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that are sent to the function when it is called.
Nevertheless, parameters are local variables defined in the function (inside of parentheses in the function header) and used to hold the data passed into the function.
Haddock is a free, portable command-line program documentation generator for Haskell. It is influenced by IDoc, HDoc, and Doxygen.
Looking through the Haddock source code, it looks like no, as function arguments are only extracted from inside types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With