如何知道导入中可用的函数的完整列表? [英] How to know what are the full list of function availlable in an import?

查看:125
本文介绍了如何知道导入中可用的函数的完整列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Haskell中,如果我导入了一个模块,比如

  import Data.List 

如何知道Data.List提供的总方法是什么?



前奏我可以使用完成像这里所说有没有办法在GHCI中查看模块中的函数列表? ::

 前奏> :m + Data.List 
Prelude Data.List> Data.List。<此处按压选项卡>

但是我想把它放在一个可以操作的列表中,而不是在Prelude中。



这个问题不是关于内建如何在Haskell中知道builtins函数?,(我的意思是通过内建的可用函数,我们没有进行任何导入)

解决方案

您可以使用浏览:

  Prelude> :浏览Data.List 

它会列出所有可用的方法

In Haskell if I import a module e.g.

import Data.List 

How can I know what is the total method that Data.List made available ?

In Prelude I can use completion like said here Is there a way to see the list of functions in a module, in GHCI?::

Prelude> :m +Data.List
Prelude Data.List> Data.List.<PRESS TAB KEY HERE>

But I want to get this in a list that be can manipulate, not in Prelude.

This question is not about builtins how to know in Haskell the builtins functions?, (I mean by builtins available functions we have without doing any import)

解决方案

You can use browse:

Prelude> :browse Data.List

It will list all the methods available

这篇关于如何知道导入中可用的函数的完整列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆