[Haskell-cafe] Applicative combinators from Parsec

2009-03-13 Thread Martijn van Steenbergen
Hello, Looking at Parsec 3 I see: chainr1 :: (Stream s m t) = ParsecT s u m a - ParsecT s u m (a - a - a) - ParsecT s u m a chainr1 p op = scan where scan = do x - p; rest x rest x = (do f - op; y - scan; return (f x y)) | return x But if I remove the type signature and let

Re: [Haskell-cafe] Applicative combinators from Parsec

2009-03-13 Thread andy morris
2009/3/13 Martijn van Steenbergen mart...@van.steenbergen.nl: Hello, Looking at Parsec 3 I see: chainr1 :: (Stream s m t) = ParsecT s u m a -           ParsecT s u m (a - a - a) - ParsecT s u m a chainr1 p op = scan where  scan = do x - p; rest x  rest x = (do f - op; y - scan; return (f

Re: [Haskell-cafe] Applicative combinators from Parsec

2009-03-13 Thread Brandon S. Allbery KF8NH
On 2009 Mar 13, at 9:57, andy morris wrote: (Currently the functions in Parsec have the more specific type as Martijn says, but if they're generalised then I don't really see why they need to be duplicated.) Possibly so Parsec has decent performance on Haskell compilers that don't do {-#