Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-12 Thread Eric Rasmussen
Very helpful -- thanks everyone! The handling of currency amounts in hledger is what I was looking for in terms of alternate ways to parse and represent dollar amounts in Haskell. On Wed, May 11, 2011 at 6:05 PM, Simon Michael si...@joyful.com wrote: On 5/10/11 2:52 PM, Roman Cheplyaka wrote:

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-11 Thread Simon Michael
On 5/10/11 2:52 PM, Roman Cheplyaka wrote: You could read hledger[1] sources for inspiration: it's written in Haskell and contains some (quite generic) currency parsing. Hi Eric.. here's the code in question:

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-10 Thread Roman Cheplyaka
* Eric Rasmussen ericrasmus...@gmail.com [2011-05-09 15:07:57-0700] Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: You could read hledger[1] sources for inspiration: it's written in Haskell and contains

[Haskell-cafe] parsing currency amounts with parsec

2011-05-09 Thread Eric Rasmussen
Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: Positive: $115.33 Negative: ($1,323.42) I'm working on the parser for practical purposes (to convert a 3rd-party generated, most unhelpful format into one I can

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-09 Thread Antoine Latter
On Mon, May 9, 2011 at 5:07 PM, Eric Rasmussen ericrasmus...@gmail.com wrote: Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: Positive: $115.33 Negative: ($1,323.42) I'm working on the parser for

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-09 Thread wren ng thornton
On 5/9/11 10:04 PM, Antoine Latter wrote: On Mon, May 9, 2011 at 5:07 PM, Eric Rasmussenericrasmus...@gmail.com wrote: Hi everyone, I am relatively new to Haskell and Parsec, and I couldn't find any articles on parsing numbers in the following format: Positive: $115.33 Negative: ($1,323.42)

Re: [Haskell-cafe] parsing currency amounts with parsec

2011-05-09 Thread Eric Rasmussen
I'll check out Attoparsec, thanks! My first attempt may work for this particular task, but I'm warming up for a more intense parsing project and it sounds like Attoparsec with Bytestrings may work best. Also, just in case anyone reads this thread later and is looking for a quick Parsec solution,