[英]How can I find out which (concrete) types satisfy a set of typeclass constraints?
[英]How can I find out where a type, data constructor or typeclass is defined?
我试图弄清楚为XMonad https://hackage.haskell.org/package/xmonad-0.12/docs/XMonad-Core.html#t:LayoutClass定义LayoutClass类型或数据构造函数的位置。
我也尝试使用ghci失败:
Prelude> import XMonad.Core
Prelude XMonad.Core> :t LayoutClass
<interactive>:1:1: error:
Data constructor not in scope: LayoutClass
Prelude XMonad.Core>
LayoutClass
不是数据类型或类型构造函数。 它是一个类型类。 您可以通过单击文档的Instances
表中以LayoutClass
开头的行右侧的Source
按钮来验证它。 例如,这是从LayoutClass Layout Window
开始的行的第一行代码
instance LayoutClass Layout Window where
这意味着“ Layout Window
是LayoutClass
类型类的实例。
在您链接的行的右边有一个“源”链接,在本例中为https://hackage.haskell.org/package/xmonad-0.12/docs/src/XMonad-Core.html#LayoutClass
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.