question about ghci on windows ...

Hello, I am reading through http://www.haskell.org/ghc/docs/latest/html/users_guide/index.html in particular the description of the boot libraries. I don't see how I can display function signatures from compiled code (i.e. .hi). ??? Kind regards, Vasya

On Wed, Nov 21, 2007 at 05:46:35PM -0600, Galchin Vasili wrote:
I am reading through http://www.haskell.org/ghc/docs/latest/html/users_guide/index.html in particular the description of the boot libraries. I don't see how I can display function signatures from compiled code (i.e. .hi). ???
I'm not sure I understand your question, nor am I sure which bit of the users guide you are looking at - can you tell us the section number please? Is ghc --show-iface Foo.hi what you want? Or :t Data.List.length from inside ghci? Thanks Ian

Hi Ian,
I am trying to dump out all function signatures exported from
System.Directory. I just tried
inside ghci: :! ghc --show-iface System.Directory. This is getting closer
... thank you! However, now there appears to be a "path" problem because I
get an error message: "System.Directory: openBinaryFile: does not exist (No
such file or directory)". ??
Thanks, Vasya
On Nov 21, 2007 6:08 PM, Ian Lynagh
On Wed, Nov 21, 2007 at 05:46:35PM -0600, Galchin Vasili wrote:
I am reading through http://www.haskell.org/ghc/docs/latest/html/users_guide/index.html in particular the description of the boot libraries. I don't see how I can display function signatures from compiled code (i.e. .hi). ???
I'm not sure I understand your question, nor am I sure which bit of the users guide you are looking at - can you tell us the section number please?
Is
ghc --show-iface Foo.hi
what you want? Or
:t Data.List.length
from inside ghci?
Thanks Ian

aha . ;^)
thnaks, vaya
On Nov 21, 2007 7:03 PM, Ian Lynagh
On Wed, Nov 21, 2007 at 06:57:55PM -0600, Galchin Vasili wrote:
I am trying to dump out all function signatures exported from System.Directory. I just tried inside ghci: :! ghc --show-iface System.Directory.
Aha, use
:browse System.Directory
Thanks Ian

On Nov 21, 2007, at 19:57 , Galchin Vasili wrote:
Hi Ian,
I am trying to dump out all function signatures exported from System.Directory. I just tried inside ghci: :! ghc --show-iface System.Directory. This is getting closer ... thank you! However, now there appears to be a "path" problem because I get an error message: " System.Directory: openBinaryFile: does not exist (No such file or directory)". ??
Just for reference: --show-iface is intended to operate on an explicitly specified .hi file, not a module name. You could locate System\Directory.hi in the ghc lib directory and run ghc --show-iface on that, or just use :browse. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Brandon S. Allbery KF8NH wrote:
On Nov 21, 2007, at 19:57 , Galchin Vasili wrote:
Hi Ian,
I am trying to dump out all function signatures exported from System.Directory. I just tried inside ghci: :! ghc --show-iface System.Directory. This is getting closer ... thank you! However, now there appears to be a "path" problem because I get an error message: " System.Directory: openBinaryFile: does not exist (No such file or directory)". ??
Just for reference: --show-iface is intended to operate on an explicitly specified .hi file, not a module name. You could locate System\Directory.hi in the ghc lib directory and run ghc --show-iface on that, or just use :browse.
Also, --show-iface dumps low-level compiler data. In particular, it doesn't necessarily show you exactly what the module exports - but rather, it shows you when GHC might inline into client modules. ;-) If you want the callable interface, you want to be using the :browse command, not playing with interface files.
participants (4)
-
Andrew Coppin
-
Brandon S. Allbery KF8NH
-
Galchin Vasili
-
Ian Lynagh