Creating a Haskell app to do crosstabs

Hi everyone - I'm a relative newcomer to Haskell, and am very much besotted with it - it's a great language! :-) At the moment, I'm in the early stages of putting together a little "Haskell-like" language using the Spirit parser framework (Spirit is part of the Boost C++ libraries). Spirit also has a functional-programming "sister" library (Phoenix), which includes lambdas, lazy functions and lots more. Phoenix is currently being merged with the Boost Lambda Library. ( Sorry for the off-topic digression - just giving the background to what I'm doing .... ;-) ) I've done a couple of "toy parsers" for Spirit already, but now I'm looking to do something that is more of a challenge - doing a small-ish Haskell-like language. The language is aimed at being able to read in a comma-delimited file (with column-headings), and putting the data into "columns". ( I envisage maybe a Haskell "pair". The first item being the column heading, the second being a list, with the data in it. ) Then, the user would select one of those "columns" for a "page" variable (that one would be optional), and one or more "columns" for the crosstab rows and columns. What I'm needing to do is to first put together the code in Haskell itself, and get it running. Then, that will give me a good feel as to how much of "core" Haskell I need to implement, in order to do the crosstab app. So, I was wondering - has anyone in the Haskell community used Haskell to do crosstabs? ( And if so, is there any code available? ). Any help in the two areas - a) Using Haskell to read a delimited file (with column-headings) into a columnar or tabular data-structure - b) Using Haskell to do crosstabs - - would be very welcome! I should also stress that full credit will be given to the writers of any code supplied. Very many thanks in advance for any help received! - - Andy

Hello Andy, Thursday, August 11, 2005, 5:18:12 AM, you wrote: AE> I'm a relative newcomer to Haskell, and am very much besotted with it AE> - it's a great language! :-) AE> At the moment, I'm in the early stages of putting together a little AE> "Haskell-like" language using the Spirit parser framework (Spirit is AE> part of the Boost C++ libraries). Spirit also has a AE> functional-programming "sister" library (Phoenix), which includes AE> lambdas, lazy functions and lots more. Phoenix is currently being AE> merged with the Boost Lambda Library. btw, afaik Spirit is modeled after ParseC (parsing combinators) haskell library and Phoenix was needed for this library because parser combinators require lazy functional language to work :) -- Best regards, Bulat mailto:bulatz@HotPOP.com

Bulat Ziganshin writes:
afaik Spirit is modeled after ParseC (parsing combinators) haskell library and Phoenix was needed for this library because parser combinators require lazy functional language to work :)
Just a minor nit: the Phoenix library has nothing to do with parsing. It's basically a collection of expression templates which save you a lot of time when it comes to writing glue code. Binding arguments of arbitrary function objects is something Phoenix can do, for example. Spirit works well with that library because both were written by the same author, but they aren't really related. You are right, though, that Spirit was influenced by Haskell quite a bit. As a matter of fact, it was Spirit's author -- Joel de Guzman -- who made me aware of Haskell when he posted some example source code on the mailing list back then; I think it was the usual implementation of Quicksort. I distinctly remember that I couldn't believe my eyes when I saw that. ;-) Peter

Hello Peter, Thursday, August 11, 2005, 1:18:54 PM, you wrote: PS> > afaik Spirit is modeled after ParseC (parsing combinators) PS> > haskell library and Phoenix was needed for this library PS> > because parser combinators require lazy functional language to PS> > work :) PS> Just a minor nit: the Phoenix library has nothing to do with PS> parsing. It's basically a collection of expression templates PS> which save you a lot of time when it comes to writing glue code. Phoenix is a part of Spirit, though -- Best regards, Bulat mailto:bulatz@HotPOP.com

Bulat Ziganshin wrote: <snip>
btw, afaik Spirit is modeled after ParseC (parsing combinators) haskell library and Phoenix was needed for this library because parser combinators require lazy functional language to work :)
Hi Bulat - thanks for this! I didn't know that about Phoenix. Certainly both Spirit and Phoenix are very good, and the developers of those libraries are excellent. ( I'm just a contributor of a couple of examples, although the s/f Spirit page lists me as a dev! :-) ) - Andy
participants (3)
-
Andy Elvey
-
Bulat Ziganshin
-
Peter Simons