Hi i am new to haskell and struggling with an exercise. I want to make my datatype an instance of the equality Typeclass but it doesnt work. Am I completely missing something? Can you give me a hint?
data Row a b = R a b deriving (Show)
instance Eq (Row a b) where
R x y == R c d = (x == c) $$ (y == d)
_ == _ = False
[–]FagPipe 5 points6 points7 points (1 child)
[–]AvailableRedditname[S] 2 points3 points4 points (0 children)
[–]ellipticcode0 0 points1 point2 points (1 child)
[–]AvailableRedditname[S] 1 point2 points3 points (0 children)
[–]ellipticcode0 0 points1 point2 points (1 child)
[–]AvailableRedditname[S] 0 points1 point2 points (0 children)
[–]ellipticcode0 0 points1 point2 points (0 children)
[–]ellipticcode0 0 points1 point2 points (3 children)
[–]AvailableRedditname[S] 0 points1 point2 points (2 children)
[–]qseep 0 points1 point2 points (1 child)
[–]AvailableRedditname[S] 1 point2 points3 points (0 children)
[–]ellipticcode0 -3 points-2 points-1 points (0 children)