[Haskell-cafe] "doctest" for haskell -- a good project?
Don Stewart
dons at galois.com
Sat Mar 22 15:22:42 EDT 2008
arnarbi:
> Hey Don,
>
> On Sat, Mar 22, 2008 at 8:39 AM, Don Stewart <dons at galois.com> wrote:
> > I'm not sure how doctest works, or how it would work in a Haskell
> > setting, could you elaborate?
>
> In a nutshell, Python doctest has the programmer put an example "interactive
> session" in a functions docstring. A doctest module then extracts those, tries
> running the function on the inputs and sees if it matches the output.
Ah yes. This is a great idea, and would be very useful.
Haskell code is often documented with QuickCheck properties the code
satisfies. Ensuring these are up to date is something that would be good
to automate.
It should be easier than in Python too, as fragments typically are pure,
and don't require state to be initialised.
-- Don
More information about the Haskell-Cafe
mailing list