【发布时间】:2011-12-31 05:20:42
【问题描述】:
考虑以下模块
{-# LANGUAGE RecordWildCards #-}
module Example (foo, fuh, fon, fuzz) where
import qualified FirstClassModule (Bar(foo,fuh,fon,fuzz), makeBar)
FirstClassModule.Bar {..} = FirstClassModule.makeBar parameter
parameter :: Int
parameter = 15
意图是模块FirstClassModule 提供了一个记录类型Bar,它的工作方式有点像一流的模块。然后,模块Example 实例化模块并使用 RecordWildCards 扩展将名称引入范围并使其可导出。
当您在此模块上运行 Haddock(2.8 版)时,它会干扰 foo 函数的类型签名并将它们包含在 API 文档中。现在,我的问题是:
有没有办法记录生成的名称
foo、fuh等。 在Example模块中写下它们的类型签名?
我不想编写类型签名,因为在这种情况下,因为它们是样板文件。如果我必须把它们写下来,这个模块就会失去它的存在理由。
【问题讨论】:
标签: haskell documentation-generation haddock