Hoogle query returning functions that don't match type signature

115 Views Asked by At

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]?

1

There are 1 best solutions below

0
On BEST ANSWER

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