Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-23 Thread Arnar Birgisson
On Sun, Mar 23, 2008 at 5:09 PM, Marc Weber <[EMAIL PROTECTED]> wrote: > Adding documentation ficilities to ghci is nice, > however my experience is that documentation is not complete everywhere. > That's why I'm looking at source code directly (thus having doc strings if > given > else I can

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-23 Thread Marc Weber
Hi Shaun, I've read the whole thread till now. If you only look at the testing side Cabal is a possible target to run your tests. (I think you've already met it?) Adding documentation ficilities to ghci is nice, however my experience is that documentation is not complete everywhere. That's why I

RE: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Shaun Cutts
> 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. > Best shown by > an example: > By the way, python does thi

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Neil Mitchell
Hi > Niel -- I understand your script is part of FilePath... might it be a good > starting point for abstraction? Can you point me to it? You are certainly welcome to start from it, if it is of any use to you: darcs get http://darcs.haskell.org/packages/filepath/ Then look in the test director

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Don Stewart
arnarbi: > Hey Don, > > On Sat, Mar 22, 2008 at 8:39 AM, Don Stewart <[EMAIL PROTECTED]> 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

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Arnar Birgisson
Hey Don, On Sat, Mar 22, 2008 at 8:39 AM, Don Stewart <[EMAIL PROTECTED]> 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

RE: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Shaun Cutts
> > resemble a formal specification. For a couple of > examples, see my > > RangedSet package and Neil Mitchel's FilePath package. I manually > > copied the RangedSet tests into the Haddock documentation, > while Neil > > wrote a small Haskell script to extract his tests from his > > d

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Neil Mitchell
Hi > I once looked at doing this, but I didn't get very far. Me too, and I managed to get some way: > resemble a formal specification. For a couple of examples, see my > RangedSet package and Neil Mitchel's FilePath package. I manually > copied the RangedSet tests into the Haddock documenta

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Paul Johnson
Shaun Cutts wrote: I note that there is a unit testing framework for Haskell, but I don't see any doctest module. Might this be a good project? I once looked at doing this, but I didn't get very far. Haddock is important here because you want to include the tests as part of the documentation.

RE: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Shaun Cutts
t; -Original Message- > From: Thomas Schilling [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 22, 2008 9:54 AM > To: Neil Mitchell > Cc: Don Stewart; Shaun Cutts; haskell-cafe@haskell.org > Subject: Re: [Haskell-cafe] "doctest" for haskell -- a good project? > &

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Sebastian Sylvan
On Sat, Mar 22, 2008 at 8:39 AM, Don Stewart <[EMAIL PROTECTED]> wrote: > shaun: > >Hello, > > > >I am an experienced programmer, currently learning Haskell. Currently > I > >write many things in python. I use both the "doctest" and "unittest" > >modules extensively. As I write cod

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Thomas Schilling
On 22 mar 2008, at 13.17, Neil Mitchell wrote: Hi One idea that does strike me is that it would be super useful to have the ability in ghci to extract the haddocks associated with a function. :doc map would result in: -- | 'map' @f xs@ is the list obtained by applying @f@ to

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Neil Mitchell
Hi > One idea that does strike me is that it would be super useful to have > the ability in ghci to extract the haddocks associated with a function. > > > :doc map > > would result in: > > -- | 'map' @f xs@ is the list obtained by applying @f@ to each element > -- of @xs@, i.e.,

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Don Stewart
shaun: >Hello, > >I am an experienced programmer, currently learning Haskell. Currently I >write many things in python. I use both the "doctest" and "unittest" >modules extensively. As I write code, I simultaneously write doctest code >in the doc strings to explain/set out t

Re: [Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-22 Thread Roman Cheplyaka
* Shaun Cutts <[EMAIL PROTECTED]> [2008-03-22 02:20:38-0400] > Hello, > > I am an experienced programmer, currently learning Haskell. Currently I > write many things in python. I use both the "doctest" and "unittest" modules > extensively. As I write code, I simultaneously write doctest code in t

[Haskell-cafe] "doctest" for haskell -- a good project?

2008-03-21 Thread Shaun Cutts
Hello, I am an experienced programmer, currently learning Haskell. Currently I write many things in python. I use both the "doctest" and "unittest" modules extensively. As I write code, I simultaneously write doctest code in the doc strings to explain/set out the "typical narrative" of how the co