2012-11-25 1 views
1

Lorsque j'ai besoin de chercher quel paquet contient un symbole, j'utilise Google ou Hoogle. 99% des cas j'ai trouvé une référence à Hackage (c'est bon).Comment chercher un symbole dans les paquets installés

Vous pouvez rechercher localement?

Exemple:

$ ghci 
Prelude> :i MonadState 
Not in scope: data constructor `MonadState' 

je recherche "MonadState hackage" et trouvé

http://hackage.haskell.org/.../Control-Monad-State-Class.html 

Puis:

Prelude> :m Control.Monad.State 
Prelude> etc... 

Comment trouvez-vous?

Merci beaucoup!

+1

Vous pouvez installer Hoogle localement. – dave4420

Répondre

5

Pour rechercher des paquets installés localement pour les symboles, utilisez hoogle:

$ cabal install hoogle 
... 

# generate a database of symbols 
$ hoogle data 
... 

$ hoogle search MonadState 
Control.Monad.State.Class class Monad m => MonadState s m | m -> s 
Control.Monad.State.Lazy class Monad m => MonadState s m | m -> s 
Control.Monad.State.Strict class Monad m => MonadState s m | m -> s 
Questions connexes