The :browse
, :info
and :type
GHCi commands are very convenient.
Is it possible to get the same information programmaticaly in a Haskell program? That is, to get the exported functions from a module, the types of stuff, etc.
:browse
- when a Haskell program is compiled, no (useful) information is kept about which module something came from, so your program wouldn't be able to access that information.
:type
- Unless you're using Data.Typeable, types aren't visible at all at runtime. Types in Haskell are mostly for the compiler to check to correctness/safety of code.
:info
- See above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With