How does Haskell deal with documentation?

前端 未结 3 1960
谎友^
谎友^ 2021-01-08 01:07

How do I get online documentation in Haskell?

Are there anything as elegant/handy as what Python does below?

>>> help([].count)
Help on bu         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-08 01:47

    Currently, there is no way to view the Haddock documentation within ghci, but there is a ticket for it.

    You can however get a small bit of info using the :info command, e.g.

    ghci> :i nub
    nub :: (Eq a) => [a] -> [a]     -- Defined in Data.List  
    

    so that you at least know where to look for the documentation for a particular function.

提交回复
热议问题