[Haskell-cafe] sorting and merging in haskell

jjoshua jjoshua2 at gmail.com
Tue Jan 19 03:56:49 EST 2010

So I defined a type called term which is a coefficient and degree of x. int a
int b.
I want to write a method/methods in haskell to sort them and combine ones
with same degree. I think I need to combine somehow, and then use sortby
method? I'm just learning haskell, but I now java and c# pretty well and I'm
having a hard term converting to functional thinking.
its of type [(Int a Int b)] and if b1< b2 put tuple 1 before tuple2, else if
= combine by adding a1 to a2, else place 2 before 1. I know how to do it
logically, just not the syntax I guess.
Thanks so much guys!
View this message in context: http://old.nabble.com/sorting-and-merging-in-haskell-tp27222668p27222668.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list