Reputation: 7702
I'm using a library, which I've loaded into GHCI.
From the names of the functions is not obvious to me which one I should be using; I'm sure it exists, and want to see a list of type signatures of the functions available to me. I don't know how to do this.
:t
, but it only seems to work for a single function, and I don't want to do this for every single function that is being exported by the library.grep -R :: ./*
or similar over the source directory may omit functions without explicit type signatures.I'm open to try any method, but obviously prefer what's simple, portable, and repeatable.
Is there a way to find the type signatures of all exported functions in a library? Or to find out which functions have a type signature that includes a certain type?
Upvotes: 4
Views: 297
Reputation: 64750
just use :browse Module.Name
and you'll see all the values exported by the module:
> :browse Data.Tagged
newtype Tagged s b = Tagged {unTagged :: b}
asTaggedTypeOf :: s -> Tagged s b -> s
retag :: Tagged s b -> Tagged t b
tagSelf :: a -> Tagged a a
untag :: Tagged s b -> b
untagSelf :: Tagged a a -> a
Upvotes: 5