Hoogle查询返回与类型签名不匹配的函数

时间:2014-06-16 05:57:03

标签: haskell hoogle

如果我尝试使用以下Hoogle命令(v4.2.33)搜索包含类型签名ByteString->[ByteString]的函数:

hoogle --count 40 "ByteString->[ByteString]"

然后在输出结束时我得到:

Data.ByteString.Char8 transpose :: [ByteString] -> [ByteString]
Data.ByteString.Lazy transpose :: [ByteString] -> [ByteString]
Data.ByteString.Lazy.Char8 transpose :: [ByteString] -> [ByteString]
Codec.Compression.Zlib.Raw compress :: ByteString -> ByteString
Codec.Compression.GZip compress :: ByteString -> ByteString

当我将类型签名指定为ByteString -> ByteString时,为什么Hoogle会返回带有签名ByteString->[ByteString]等的函数?

1 个答案:

答案 0 :(得分:2)

Hoogle使用" approximate"类型匹配,概括类型和剥离构造函数的概念来查找近似匹配。

相关问题