Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get module contents

Tags:

haskell

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.

like image 242
Lii Avatar asked Feb 18 '12 16:02

Lii


1 Answers

: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.

like image 139
amindfv Avatar answered Sep 19 '22 09:09

amindfv