Skip to content

Undocumented arithmetic functions in Base/GHC

Summary

When using hoogle to search for functions with simple, arithmetic types, the user is presented with a lot of completely undocumented functions from base/GHC.X libraries.

Steps to reproduce the issue: On https://hoogle.haskell.org search for Int -> Int -> Int or Integer -> Integer -> Integer

The functions like divInt, clamp, badSafeIndex, plusInteger etc. which show up in the search results are mostly from base or GHC.X libraries, and are completely undocumented.

I discovered this problem when presenting Hoogle to a newcomer, who will probably try out Hoogle with simple types first. So it might be better to give them a good first impression in that case :)

Proposed improvements or changes

Add documentation strings. Since a lot of these functions are not meant to be used directly, but rather through the Num, Fractional etc. instances, the documentation in the corresponding modules could maybe also spell this out.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information