Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-12-01 Thread Tomasz Zielonka
On Fri, Nov 30, 2007 at 08:55:51AM +, Neil Mitchell wrote:
 Hi
 
Prelude :b Control.Concurrent.MVar
module 'Control.Concurrent.MVar' is not interpreted
 
 :b now defaults to :breakpoint, you want :browse

That's a questionable decision, IMO:
- it changes behavior
- I expect :browse to be used more often, so it deserves the sort
  :b version (:bro is not that short)

On the other hand, this change can have an (unintended?) feature
advertising effect ;-)

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-12-01 Thread Stefan O'Rear
On Sun, Dec 02, 2007 at 05:45:48AM +0100, Tomasz Zielonka wrote:
 On Fri, Nov 30, 2007 at 08:55:51AM +, Neil Mitchell wrote:
  Hi
  
 Prelude :b Control.Concurrent.MVar
 module 'Control.Concurrent.MVar' is not interpreted
  
  :b now defaults to :breakpoint, you want :browse
 
 That's a questionable decision, IMO:
 - it changes behavior
 - I expect :browse to be used more often, so it deserves the sort
   :b version (:bro is not that short)
 
 On the other hand, this change can have an (unintended?) feature
 advertising effect ;-)

It's not a decision at all.  :b is the first command starting with b,
which was browse yesterday, is breakpoint today, and tomorrow will be
something you've never heard of.  It's inherently fragile, and shouldn't
be relied on in scripts - and if :b does anything funny, spell out the
command!

(There is a case to be made for explicitly defining short forms of
commands - but that is not what :b is, and making this case should only
be done in a new thread.)

Stefan


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-12-01 Thread Tomasz Zielonka
On Sat, Dec 01, 2007 at 10:01:13PM -0800, Stefan O'Rear wrote:
 On Sun, Dec 02, 2007 at 05:45:48AM +0100, Tomasz Zielonka wrote:
  That's a questionable decision, IMO:
  - it changes behavior
  - I expect :browse to be used more often, so it deserves the sort
:b version (:bro is not that short)
  
  On the other hand, this change can have an (unintended?) feature
  advertising effect ;-)
 
 It's not a decision at all.  :b is the first command starting with b,
 which was browse yesterday, is breakpoint today, and tomorrow will be
 something you've never heard of.

I haven't thought about it this way. OK, so _this_ is the questionable
decision: allowing the ambiguous shortcut.

 It's inherently fragile, and shouldn't be relied on in scripts

I am only relying on it in my brain's procedural memory and I guess it's
going to fix itself eventually ;-)

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Neil Mitchell
Hi

   Prelude :b Control.Concurrent.MVar
   module 'Control.Concurrent.MVar' is not interpreted

:b now defaults to :breakpoint, you want :browse

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Ketil Malde
Claus Reinke [EMAIL PROTECTED] writes:

 you might find it easier to use GHCi's :browse command

While ghc -e works, this no longer work within GHCi?

  Prelude :b Control.Concurrent.MVar
  module 'Control.Concurrent.MVar' is not interpreted

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-30 Thread Andrew Coppin

Rob Hoelz wrote:

Hello fellow Haskellers,

Does anyone know if/where I can find a specification for the .hi files
generated by GHC?  I ask because I want to write an omni-completion
plugin for Vim to make Haskell hacking a bit nicer.
  


You don't want to do that.

The .hi files can expose internal implementation details that shouldn't 
be visible to callers of the library. (E.g., so that GHC can inline 
things across module boundaries.) What you want to play with is the 
:browse command. ;-)


(Thinking about it... some kind of tool for easily producing a propper 
interface file that 3rd party tools can use would probably be quite a 
useful thing... I wonder how hard it would be to implement?)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell interface file (.hi) format?

2007-11-29 Thread Rob Hoelz
Hello fellow Haskellers,

Does anyone know if/where I can find a specification for the .hi files
generated by GHC?  I ask because I want to write an omni-completion
plugin for Vim to make Haskell hacking a bit nicer.

Thanks,
Rob Hoelz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-29 Thread Rob Hoelz
Claus Reinke [EMAIL PROTECTED] wrote:

  Does anyone know if/where I can find a specification for the .hi
  files generated by GHC?  I ask because I want to write an
  omni-completion plugin for Vim to make Haskell hacking a bit nicer.
 
 you might find it easier to use GHCi's :browse command
 
 $ ghc -e ':browse Control.Concurrent.MVar'
 modifyMVar :: MVar a - (a - IO (a, b)) - IO b
 modifyMVar_ :: MVar a - (a - IO a) - IO ()
 readMVar :: MVar a - IO a
 swapMVar :: MVar a - a - IO a
 withMVar :: MVar a - (a - IO b) - IO b
 data MVar a = GHC.IOBase.MVar (GHC.Prim.MVar# GHC.Prim.RealWorld
 a) addMVarFinalizer :: MVar a - IO () - IO ()
 isEmptyMVar :: MVar a - IO Bool
 newEmptyMVar :: IO (MVar a)
 newMVar :: a - IO (MVar a)
 putMVar :: MVar a - a - IO ()
 takeMVar :: MVar a - IO a
 tryPutMVar :: MVar a - a - IO Bool
 tryTakeMVar :: MVar a - IO (Maybe a)
 
 that is what the haskell mode plugins for vim use, for one
 of their completion modes, anyway;-)
 
 http://www.cs.kent.ac.uk/~cr3/toolbox/haskell/Vim/
 
 (actually, that completion is wrt to imported identifiers,
 so we simply do a ':browse *current_module'; another 
 completion mode is based on haddock indices, and then 
 there are the standard occurs-in-imported-source-files 
 and occurs-in-tags-file completions)
 
 claus
 

Wow!  Thanks for saving me a ton of work, everyone!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Haskell interface file (.hi) format?

2007-11-29 Thread Neil Mitchell
Hi

  Does anyone know if/where I can find a specification for the .hi files
  generated by GHC?  I ask because I want to write an omni-completion
  plugin for Vim to make Haskell hacking a bit nicer.

 you might find it easier to use GHCi's :browse command

Or you might want to try haddock with the --hoogle command. Similar
thing, slightly different format - depends what suits you.

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe