gpt4 book ai didi

haskell - 有什么方法可以先在 Haddock 中描述函数参数?

转载 作者:行者123 更新时间:2023-12-04 02:15:06 25 4
gpt4 key购买 nike

典型的 Haddock 语法允许写这样的东西

-- 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"

我想用Java方式编写它,在函数签名之前我有参数描述。我有更复杂的签名,所以这种方法破坏了可读性。 有没有这样写的方法?
-- 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"

最佳答案

关于haskell - 有什么方法可以先在 Haddock 中描述函数参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27367361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com