Ah, so this is a monoid:
instance Monoid Int where
smash 25 x = x
smash x 25 = x
smash x y = 2*x^2 - 3*x*y
empty = 25
Thanks for explaining!