[Haskell-cafe] Parse error on input "|"

Robin Green greenrd at greenrd.org
Thu May 31 12:52:36 EDT 2007


You neglected a ) - remember to count your parentheses in future when
you get an error directly after a parenthesised expression.

-- 
Robin

On Thu, 31 May 2007 08:09:23 -0700 (PDT)
Akijmo <sippy at gmx.de> wrote:

> 
> Hi everyone.
> I am new to this Forum, Haskell and i am german, so i am sorry for
> "noob" failures or spelling mistakes.
> 
> I am currently learning for an informatic exam (11th class) and i
> tried to code a function to sum a polynom with a pair of polynoms...
> (I actually want to to code a polynomdivision in which i need this)
> 
> But I get the parse error mentioned in the headline. It is referring
> to the first line of the case differentiation.
> Hopefully you can help me, here's the code:
> 
> polyplusd :: Polynom -> (Polynom, Polynom) -> Polynom
> polyplusd [] p = p
> polyplusd p [] = p
> polyplusd p@((g1,e1):p1) (n, (q@((g2,e2):p2))
> 				| g1>g2 = (g1,e1):(polyplusd p1 (n,q))
> 				| g2>g1 = (g2,e2):(polyplusd p (n,p2))
> 				| g1==g2 && e1+e2 /=0 =(g1,
> e1+e2):(polyplusd p1 (n,p2)) | otherwise = polyplusd p1 (n,p2)



More information about the Haskell-Cafe mailing list