1

当我需要查找包含符号的包时,我使用 Google 或 Hoogle。99% 的案例我都找到了 Hackage 的参考资料(这很好)。

有办法在本地查找吗?

例子:

$ ghci
Prelude> :i MonadState
Not in scope: data constructor `MonadState'

然后我搜索“hackage MonadState”并找到

http://hackage.haskell.org/.../Control-Monad-State-Class.html

然后:

Prelude> :m Control.Monad.State
Prelude> etc...

你怎么做?

非常感谢你!

4

1 回答 1

5

要在本地安装的软件包中搜索符号,请使用hoogle

$ cabal install hoogle
...

# generate a database of symbols
$ hoogle data
...

$ hoogle search MonadState
Control.Monad.State.Class class Monad m => MonadState s m | m -> s
Control.Monad.State.Lazy class Monad m => MonadState s m | m -> s
Control.Monad.State.Strict class Monad m => MonadState s m | m -> s
于 2012-11-25T10:15:44.283 回答