docstring equivalent

in python you can get info about a function or class because they are docstringed. is there some equivalent mechanism for haskell usable in ghci? -- In friendship, prad ... with you on your journey Towards Freedom http://www.towardsfreedom.com (website) Information, Inspiration, Imagination - truly a site for soaring I's

Hello Prad The info command will give you details of a function - its type signature and the module where it is defined, its fixity if it is an infix function: Prelude> :info length length :: [a] -> Int -- Defined in GHC.List The shorthand is :i Prelude> :i (>>=) class Monad m where (>>=) :: m a -> (a -> m b) -> m b ... -- Defined in GHC.Base infixl 1 >>= For constructors, info will tell you which data type the constructor belongs to and the module where it is defined: Prelude> :i Just data Maybe a = ... | Just a -- Defined in Data.Maybe There is no mechanism like docstring in Haskell though - the information displayed by the info command is not customizable. Best wishes Stephen

On Tue, 29 Jun 2010 07:48:21 +0100
Stephen Tetley
There is no mechanism like docstring in Haskell though
that's what i thought. thx for the scoop on info though, stephen. i found this site quite helpful for lookups: http://www.zvon.org/comp/r/ref-Haskell.html# (lots of good examples here too quite often!) and hackageDB does provide a lot of info on the specific functions that are there: http://hackage.haskell.org/packages/hackage.html -- In friendship, prad ... with you on your journey Towards Freedom http://www.towardsfreedom.com (website) Information, Inspiration, Imagination - truly a site for soaring I's
participants (2)
-
prad
-
Stephen Tetley