Following up on this rather old thread, if you want to see a module which has lots of input/output example pairs, and properties, in the documentation then look at filepath (hoogle for takeExtension as an example). These properties are also automatically transformed in to test cases, so filepath has good documentation and good test coverage all in one, plus the documentation is actually checked for correctness. I think more libraries should do this - so I challenge someone to write the definitive "tests and assertions in code" package for Haskell.
And it's nice to hear that Hoogle is great :-) Thanks, Neil 2009/10/25 zaxis <[email protected]>: > > http://www.haskell.org/hoogle/ is VERY great for haskeller. However, i feel > hoogle should be improved by providing more examples as : > > isInfixOf :: Eq a => [a] -> [a] -> Bool > > The isInfixOf function takes two lists and returns True iff the first list > is contained, wholly and intact, anywhere within the second. > > Example: > > isInfixOf "Haskell" "I really like Haskell." -> True > isInfixOf "Ial" "I really like Haskell." -> False > > The Example code will be helpful for programmer to understand its > definition. > > Sincerely! > -- > View this message in context: > http://www.nabble.com/Hoogle-is-great-but-...-tp26046410p26046410.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
