
Thank you Patrick for posting your code, it helps a lot too see a
complete example!
On Sat, May 7, 2011 at 03:11, Patrick LeBoutillier
instance AbsInteger Integer where a `add` b = (+) a b a `eq` b = absBool $ a == b absInteger a = a
In my code, I did not use "a `eq` b = absBool $ a == b". Instead, I used "a `eq` b = a == b". I thought, since "a == b" is of type Bool, and Bool is an instance of AbsBool, I can just return type Bool. Why isn't this the case? What is it about typeclasses that I'm not understanding? I updated my code to also use "absBool", and it works great without muti-parameter typeclasses and functional dependencies! Patrick and Brent, thank you so much for your help! You have both inspired me to continue my journey with Haskell :) Btw, Patrick, do you have any small Haskell project (or can you recommend some other project) on github (or something similar) that I can read to see more examples of good Haskell code?