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

Claus Reinke claus.reinke at talk21.com
Thu Nov 29 20:15:03 EST 2007


> 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




More information about the Haskell-Cafe mailing list