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

2008-03-22 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 code is

Re: [Haskell-cafe] [GSoC] Plugins for GHC

2008-03-22 Thread Bulat Ziganshin
Hello Max, Saturday, March 22, 2008, 1:23:37 AM, you wrote: around with modifying GHC itself. Potential use cases are: * And whatever clever ideas the community comes up with! i'm interested in syntax macros feature like metalua -- Best regards, Bulat

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 the doc

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 the

Re: [Haskell-cafe] [GSoC] Plugins for GHC

2008-03-22 Thread Neil Mitchell
Hi Max, This sounds fantastic! My only question would be how this relates to the external Core work that Tim has been doing. If we have this, can external core become a plugin? If we have this, do we no longer need external Core? It seems to say that we don't want external Core as the interface,

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] An ugly zip3 problem..

2008-03-22 Thread Michael Feathers
Thanks! I learned a lot from that. Michael Tillmann Rendel wrote: Michael Feathers wrote: I'm working on something and it's looking rather ugly. essentially, it's an application of a low pass filer to a dataset. I would not consider your code ugly. it can be made shorter, though.

Re: [Haskell-cafe] An ugly zip3 problem..

2008-03-22 Thread Michael Feathers
One thing that gets me about this solution.. as I was structuring mine I noticed that I was ending up with types like FilterWindow3 and functions like lowPass3. Inlining does eliminate them, but I wonder whether there is a good way to structure the computation generically so that it can be

[Haskell-cafe] How to program with sqlite?

2008-03-22 Thread Deng Chao
Hi all, I'm learning sqlite, and as I know haskell has some libraries like HDBC or HSQL can access sqlite DB. Can anybody give me a small example to show how to use it? It will be very appreciate? Thanks! Best Regards, Deng Chao ___ Haskell-Cafe

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] How to program with sqlite?

2008-03-22 Thread Sebastian Sylvan
On Sat, Mar 22, 2008 at 1:40 PM, Deng Chao [EMAIL PROTECTED] wrote: Hi all, I'm learning sqlite, and as I know haskell has some libraries like HDBC or HSQL can access sqlite DB. Can anybody give me a small example to show how to use it? It will be very appreciate? Thanks! Best Regards,

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 code, I

[Haskell-cafe] HXT and types in Control.Arrow.ArrowTree

2008-03-22 Thread Robert Vollmert
Hello, I'm having some trouble with HXT, the types of some functions in particular. This may well be caused by a lack of understanding for arrow programming -- I'd appreciate any hints. In short, I'm constantly running into what appear to be artificial type restrictions in

[Haskell-cafe] Opening Windows .lnk Files

2008-03-22 Thread Dominic Steinitz
Does anyone know how to do this? If I open a file on Windows e.g. asn_application.h.lnk then I get the link data rather than the data in the linked file. Thanks, Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

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

2008-03-22 Thread Shaun Cutts
Thanks for the quick responses. To elaborate on how doctests work in python: (Background: in python functions, classes modules are all objects -- having attributes as well as (for functions) the ability to run them. They all have, in particular a documentation string associated with them. To

Re: [Haskell-cafe] An ugly zip3 problem..

2008-03-22 Thread Bryan O'Sullivan
Michael Feathers wrote: Would Haskell's type system allow you to pass a function of arbitrary arity, discern its arity, use that information to construct the appropriate structure for iteration, and then apply it? The answer is probably yes, because almost every time I've thought that a type

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] AMQP framing layer: design help requested.

2008-03-22 Thread Paul Johnson
Dean Herington wrote: At 6:41 PM -0700 3/21/08, Adam Langley wrote: Also getter - fmap (amqpGetTable !) getWord8 getter is just fmap (amqpGetTable !) getWord8 I don't think so. Aren't there two gettings: the first to get the type byte and the second to get the item? Yes.

Re: [Haskell-cafe] Problem with OpenAL

2008-03-22 Thread Antoine Latter
For those of you following along, you'll need: import qualified Sound.OpenAL as AL import Data.Maybe import Foreign.C.Types import Control.Monad import Control.Concurrent import Foreign.Storable import Foreign.Marshal.Alloc when I run playOpenAL 440 I get no sound, and the following is

Re: [Haskell-cafe] AMQP framing layer: design help requested.

2008-03-22 Thread Derek Elkins
On Sat, 2008-03-22 at 16:08 +, Paul Johnson wrote: Dean Herington wrote: At 6:41 PM -0700 3/21/08, Adam Langley wrote: Also getter - fmap (amqpGetTable !) getWord8 getter is just fmap (amqpGetTable !) getWord8 I don't think so. Aren't there two gettings: the

Re: [Haskell-cafe] Opening Windows .lnk Files

2008-03-22 Thread Neil Mitchell
Hi Drop into the command line, rename the file from foo.lnk to foo.txt, using ren foo.lnk foo.txt, then open foo.txt. It's a chunk of binary goop, so will likely not be much use. There is a COM class for editing shortcut files (IShellLink), which I've used before from C code. See

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

Re: [Haskell-cafe] Opening Windows .lnk Files

2008-03-22 Thread Dominic Steinitz
Neil Mitchell wrote: Hi Drop into the command line, rename the file from foo.lnk to foo.txt, using ren foo.lnk foo.txt, then open foo.txt. It's a chunk of binary goop, so will likely not be much use. There is a COM class for editing shortcut files (IShellLink), which I've used before from C

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

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 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

RE: [Haskell-cafe] ANNOUNCE: wxHaskell 0.10.3 rc1

2008-03-22 Thread Peter Verswyvelen
Amazing, I downloaded and installed this release for Windows and it works out of the box, just as a lazy Windows user expects! Woohoo! Great work. -Original Message- From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Andrew Coppin Sent: donderdag 20 maart

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 this by

Re: [Haskell-cafe] Using HaskellDb to connect to PostgresSql

2008-03-22 Thread Bjorn Bringert
On Wed, Mar 19, 2008 at 8:32 PM, Justin Bailey [EMAIL PROTECTED] wrote: On Wed, Mar 19, 2008 at 10:55 AM, Marc Mertens [EMAIL PROTECTED] wrote: Hello, I'm trying to learn to use HaskellDb. I have managed to finally compile and install it on my linux box (I have ghc 6.8.2). But