在GHCI中,有没有办法看到模块中的功能列表? [英] Is there a way to see the list of functions in a module, in GHCI?
本文介绍了在GHCI中,有没有办法看到模块中的功能列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Python或Common Lisp中,我发现它可以在运行时列出库的内容。 Haskell具有相同的功能,特别是GHCI提示符?
I find it handy in Python or Common Lisp that you can list a library's contents at runtime. Does Haskell have the same thing, in particular from a GHCI prompt?
推荐答案
GHCi有一个:浏览
命令列出模块的内容:
GHCi has a :browse
command to list the contents of modules:
Prelude> :browse Data.List
(\\) :: (Eq a) => [a] -> [a] -> [a]
delete :: (Eq a) => a -> [a] -> [a]
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
elemIndex :: (Eq a) => a -> [a] -> Maybe Int
...
Prelude> :help
...
:browse[!] [[*]<mod>] display the names defined by module <mod>
(!: more details; *: all top-level names)
...
这篇关于在GHCI中,有没有办法看到模块中的功能列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文