
thx much green... this helped for the parser failure. Dan you were right too, cause now i got the interfering types [(Int,Int)] and Polynom for line 2. But i fixed this by replacing it with ([],[]) So thx much guys :D greenrd wrote:
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
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)
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- View this message in context: http://www.nabble.com/Parse-error-on-input-%22%7C%22-tf3847082.html#a1089912... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.