When searching for a function on the Hoogle website, one sees the documentation associated with it, e.g.:
mod :: a -> a -> a infixl 7
integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == x
Hoogle also exists as a command line executable. As far as I know, it only shows the signature of the function:
~ ❯❯❯ hoogle --info Prelude.mod
Prelude mod :: Integral a => a -> a -> a
From package base
mod :: Integral a => a -> a -> a
Is there a way to get the associated documentation through the command line, as in the online version?
With the
-i
flag, Hoogle will show the first result from the query along with its Haddock description:If you want to see the description of a result other than the first one, supply the fully qualified name:
Use the
-i
option. It is not obvious how to get help for the default command (search
); here is how to do it: