您需要先让 Hoogle 为您创建一个 yesod-core 数据库:
λ> :!hoogle data yesod-core
0 warnings, saved to .warnings
Data generation complete
然后它就可以工作了!
λ> :!hoogle "+yesod-core MonadHandler m => Text -> Text -> m ()"
Yesod.Core.Handler addHeader :: MonadHandler m => Text -> Text -> m ()
Yesod.Core.Handler deleteCookie :: MonadHandler m => Text -> Text -> m ()
Yesod.Core.Handler setHeader :: MonadHandler m => Text -> Text -> m ()
Yesod.Core.Handler setSession :: MonadHandler m => Text -> Text -> m ()
Yesod.Core.Widget toWidgetMedia :: (ToWidgetMedia site a, MonadWidget m, HandlerSite m ~ site) => Text -> a -> m ()
Yesod.Core.Json (.=) :: KeyValue kv => forall v. ToJSON v => Text -> v -> kv
哎呀,+yesod-core
标签不是很好。幸运的是,我们可以将 Hoogle 数据库合并为一个大数据库:
$ cd ~/.stack/snapshots/x86_64-osx/lts-5.8/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases
$ mv default.hoo{,-prev}
$ hoogle combine *.hoo
(您的数据库路径将根据您是stack install
编辑还是cabal install
编辑而有所不同。)
λ> :!hoogle "addHeader"
Yesod.Core.Handler addHeader :: MonadHandler m => Text -> Text -> m ()
Network.CGI.Monad cgiAddHeader :: MonadCGI m => HeaderName -> String -> m ()
比谷歌好太多了。