Re: [Haskell-cafe] parsec manyTill documentation question

2010-09-25 Thread Stephen Tetley
On 25 September 2010 05:30, Evan Laforge qdun...@gmail.com wrote: I thought the parsec source included some example parsers for simple languages?  In any case, there is lots of material floating around, [Snip] The best documentation is Daan Leijen's original manual, plus the original source

[Haskell-cafe] Coding conventions for Haskell?

2010-09-25 Thread Petr Pudlak
Hi, sometimes I have doubts how to structure my Haskell code - where to break lines, how much to indent, how to name functions and variables etc. Are there any suggested/recommended coding conventions? I searched a bit and I found a few articles and discussions: - Good Haskell coding

[Haskell-cafe] Tree Construction

2010-09-25 Thread Tom Hawkins
Hi, Often I need to assemble a tree from things with unstructured hierarchical paths. I built a function [1] to do this for ImProve. But does a library already exist that does this? If not I may create one, as I need it for a few different libraries. data Tree a b = Branch a [Tree a b] | Leaf

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-25 Thread Johan Tibell
On Sat, Sep 25, 2010 at 11:24 AM, Petr Pudlak d...@pudlak.name wrote: sometimes I have doubts how to structure my Haskell code - where to break lines, how much to indent, how to name functions and variables etc. Are there any suggested/recommended coding conventions? I searched a bit and I

[Haskell-cafe] Candlestick charts

2010-09-25 Thread rgowka1
Hi - What are the libraries to use in Haskell to generate a stock candlestick chart like http://stockcharts.com/h-sc/ui?s=SPYp=Db=5g=5id=p05007254056 I will use Finance-Quote-Yahoo to get the quote data from Yahoo. thanks for all your help. ___

Re: [Haskell-cafe] Candlestick charts

2010-09-25 Thread Henning Thielemann
On Sat, 25 Sep 2010, rgowka1 wrote: Hi - What are the libraries to use in Haskell to generate a stock candlestick chart like http://stockcharts.com/h-sc/ui?s=SPYp=Db=5g=5id=p05007254056 I will use Finance-Quote-Yahoo to get the quote data from Yahoo. You might try the gnuplot package as

Re: [Haskell-cafe] Candlestick charts

2010-09-25 Thread rgowka1
Can I just do cabal install gnuplot or should I use darcs to get the candles version.. On Sat, Sep 25, 2010 at 8:03 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 25 Sep 2010, rgowka1 wrote: Hi - What are the libraries to use in Haskell to generate a stock candlestick

Re: [Haskell-cafe] Candlestick charts

2010-09-25 Thread Henning Thielemann
On Sat, 25 Sep 2010, rgowka1 wrote: Can I just do cabal install gnuplot or should I use darcs to get the candles version.. The Hackage version should be up to date now. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Tree Construction

2010-09-25 Thread Sjoerd Visscher
Hi, I think what you need is a trie. See f.e. http://hackage.haskell.org/package/list-tries On Sep 25, 2010, at 11:54 AM, Tom Hawkins wrote: Hi, Often I need to assemble a tree from things with unstructured hierarchical paths. I built a function [1] to do this for ImProve. But does a

Re: [Haskell-cafe] Candlestick charts

2010-09-25 Thread rgowka1
I am trying to compile demo.hs, but keep getting the error that Paths_gnuplot could not be found. What/where is paths_gnuplot?? Sorry, I am still a beginner.. On Sat, Sep 25, 2010 at 8:48 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 25 Sep 2010, rgowka1 wrote: Can I

Re: [Haskell-cafe] Tree Construction

2010-09-25 Thread Holger Siegel
Am 25.09.2010 um 11:54 schrieb Tom Hawkins: Hi, Often I need to assemble a tree from things with unstructured hierarchical paths. I built a function [1] to do this for ImProve. But does a library already exist that does this? If not I may create one, as I need it for a few different

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-25 Thread Donn Cave
Though it's common practice for sure, maybe universal, does the Don't insert a space after a lambda rule make sense? I found it confusing at first sight, because of course it looks like something else - in \n m - ..., to the uninitiated it represents a newline, for example. Now that I understand

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-25 Thread Johan Tibell
On Sat, Sep 25, 2010 at 5:06 PM, Donn Cave d...@avvanta.com wrote: Though it's common practice for sure, maybe universal, does the Don't insert a space after a lambda rule make sense? I found it confusing at first sight, because of course it looks like something else - in \n m - ..., to the

Re: [Haskell-cafe] Applicative instances for Monads

2010-09-25 Thread Ben Millwood
On Sat, Sep 25, 2010 at 3:01 AM, Gregory Crosswhite gcr...@phys.washington.edu wrote: == import Control.Applicative import Control.Concurrent import Control.Concurrent.MVar newtype AIO a = AIO {unAIO :: IO a} instance

Re: [Haskell-cafe] Candlestick charts

2010-09-25 Thread Henning Thielemann
On Sat, 25 Sep 2010, rgowka1 wrote: I am trying to compile demo.hs, but keep getting the error that Paths_gnuplot could not be found. What/where is paths_gnuplot?? Sorry, I am still a beginner.. I forgot to mention in the documentation that you have to install with $ cabal install

[Haskell-cafe] ANN: JMacro 0.3.2, A library/dsl for generating Javascript

2010-09-25 Thread Gershom B
JMacro on hackage: http://hackage.haskell.org/package/jmacro This is the first official release announcement for JMacro, which has been on hackage in some form for over a year, and in the current version since July. JMacro is a library for the programmatic generation of Javascript code. It is

[Haskell-cafe] Inverse of HaskellDB

2010-09-25 Thread Jonathan Geddes
Cafe, HaskellDB takes a database schema and produces Haskell data structures (plus some other query-related stuff for its EDSL query language). What I'm looking for is the inverse of this functionality. I want to create tables based on a Haskell data structure with a few simple rules. These

Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-25 Thread Jan-Willem Maessen
No one seems to have mentioned that this is a non-optimization in call-by-need lambda-calculus (Ariola et al.), where it follows from the standard reduction rules. Since lazy implementations of Haskell all use call-by-need evaluation in some form, I'd call this playing by the rules rather than

Re: [Haskell-cafe] Inverse of HaskellDB

2010-09-25 Thread Antoine Latter
That sounds pretty awesome to me. Have you given any thought as to how you want to approach versioning? Maybe I'm asking a silly question - I have very little real world experience with relation databases and how to version schemas. Antoine On Sep 25, 2010 2:31 PM, Jonathan Geddes

Re: [Haskell-cafe] Inverse of HaskellDB

2010-09-25 Thread Jonathan Geddes
Versioning is a tricky problem regardless of how you are creating tables. And that isn't the problem I was aiming to tackle; the problem I was aiming to tackle is a bit more narrow than that: I have a record and now I need a table to stick it in. By the way, how does HaskellDB handle versioning?

Re: [Haskell-cafe] Simple question about the function composition operator

2010-09-25 Thread wren ng thornton
On 9/24/10 5:35 AM, Axel Benz wrote: Can anybody explain why this happens and how I can compose f and g? Hint: It works fine if f is defined as an unary function. As already mentioned: (g . f) x y = (\z- g (f z)) x y = g (f x) y In order to get it to work you need to say that you want to

Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-25 Thread wren ng thornton
On 9/25/10 3:43 PM, Jan-Willem Maessen wrote: No one seems to have mentioned that this is a non-optimization in call-by-need lambda-calculus (Ariola et al.), where it follows from the standard reduction rules. Exactly. Then again, call-by-need gives a form of partial evaluation, which was

Re: [Haskell-cafe] Inverse of HaskellDB

2010-09-25 Thread Jonathan Geddes
Have you given any thought as to how you want to approach versioning? After giving this some more thought, I realized: 1) One of the best practices (even though I despise the term) of versioning schema is to include a script with the code which checks for each change to the tables, and makes the

Re: [Haskell-cafe] Applicative instances for Monads

2010-09-25 Thread wren ng thornton
On 9/24/10 10:01 PM, Gregory Crosswhite wrote: Hey everyone, There is something that has been bugging me recently about the Applicative class and the Monad class. Any type constructor F that is a Monad has a natural Applicative instance, ($) :: F (a - b) - F a - F b mf $ ma = do f - mf a - ma