[Haskell-cafe] Re: Parsec and network data

2008-08-30 Thread apfelmus
Johannes Waldmann wrote: Imagine you're writing a parser for a simple programming language. A program is a sequence of statements. Fine, you do readFile (once) and then apply a pure Parsec parser. Then you decide to include import statements in your language. Suddenly the parser needs to

Re: [Haskell-cafe] Re: Parsec and network data

2008-08-30 Thread Johannes Waldmann
apfelmus wrote: Design your language in a way that the *parse* tree does not depend on import statements? I.e. Chasing imports is performed after you've got an abstract syntax tree. OK, that would work. This property does not hold for Haskell, because you need the fixities of the operators

[Haskell-cafe] Re: Parsec and network data

2008-08-30 Thread Aaron Denney
On 2008-08-30, Johannes Waldmann [EMAIL PROTECTED] wrote: apfelmus wrote: Design your language in a way that the *parse* tree does not depend on import statements? I.e. Chasing imports is performed after you've got an abstract syntax tree. OK, that would work. This property does not hold

[Haskell-cafe] Re: Parsec and network data

2008-08-27 Thread brian
I made a small example related to the problem: http://hpaste.org/9957 It's my attempt to run data from the network directly into Parsec without having to fear deadlock due to blocking. The idea is that we feed Parsec from a timeout-enabled Stream based on Handle. As long as Parsec is able to read