artella
artella

Reputation: 5118

Hoogle query returning functions that don't match type signature

If I try to use the following Hoogle command (v4.2.33) to search for functions containing the type signature ByteString->[ByteString] :

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

then towards the end of the output I get :

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

Why does Hoogle return functions with signature ByteString -> ByteString etc. when I specify the type signature to be ByteString->[ByteString]?

Upvotes: 0

Views: 112

Answers (1)

Don Stewart
Don Stewart

Reputation: 137987

Hoogle uses a concept of "approximate" type matching, generalizing types and stripping constructors to find close matches.

Upvotes: 2

Related Questions