【发布时间】:2016-08-28 16:55:55
【问题描述】:
我犯了一个错误in another question 本来可以通过查看来解决的
:t myfunctionofinterest
对于我在库中使用的函数。
但是,当我在我的项目根目录中运行时
$ stack ghci
我的 Main.hs 有:
import MyLib
我的模块可以:
module MyLib {
bunchOfFunctions -- but not myfunctionofinterest
} where
import SomeDB.ModuleThatExposes -- myfunctionofinterest
myfunc :: IO ()
myfunc = do
myfunctionofinterest a b c -- place where I misuse myfunctionofinterest and could have used :t on it to see it had 3 args
我不能 :t myfunctionofinterest 在 main 中,因为它没有公开,Import MyLib.myfunctionofinterest 也没有明确
帮助,因为它是在导入中定义的。虽然我知道我可以公开它然后检查它,:a 进行编译,然后编辑库以再次隐藏它,有什么可以更快更直接地实现它吗?
这似乎是一种常见的模式。当您需要在开发过程中检查库中使用的东西的类型时,您会怎么做?
【问题讨论】:
-
import MyModule如果MyModule在exposed-modules或other-modules在您的 cabal 文件中,则将起作用。
标签: haskell development-environment