[Haskell-cafe] Parse text difficulty

Derek Elkins ddarius at hotpop.com
Thu Dec 9 12:34:13 EST 2004


> Robert Dockins <robdockins at fastmail.fm> writes:
> 
> >  > And I thought that most programmers used "zipWith", which has to
> >  > be prefix.
> 
> > [1..5] `zipWith (+)` [7..]
> 
> You don't have a computer at your end of the internet? :-)
> 
>   Prelude> [1..5] `zipWith (+)` [7..]
>   <interactive>:1: parse error on input `('
>   Prelude>  let zwp = zipWith (+) in [1..5] `zwp` [7..]
>   [8,10,12,14,16]

A way to accomplish the above is given on
http://www.haskell.org/hawiki/InfixExpression

Also for those who haven't looked too hard at the wiki (or at all), 
http://www.haskell.org/hawiki/CommonHaskellIdioms
is probably the most densely packed page of information on it and makes
a great starting point for finding answers on the wiki.  The above link
is on it, and also the perennial questions about making functions strict
is on it under section "Efficiency" "ForcingEagerEvaluation" (where
you'll find things like DeepSeq), and some documentation on
Control.Monad.* modules under MonadTemplateLibrary.  So, just in
general, it's a useful and interesting page, and many posts to
haskell(-cafe) can be avoided just by perusing it.


More information about the Haskell-Cafe mailing list