Note: I may not need to add Scalar to Eq, although it should solve the problem if I could figure out how to do just that.
So I'm trying to add some functionality to the ForceLayout module. Adding mass to Particles like so:
data Particle v = Particle {
_pos :: Point v
, _vel :: v
, _force :: v
, _mass :: Scalar v
}
deriving (Eq, Show)
But Scalar is not in Eq or Show! So this wont compile. Mass should be a scalar "compatible" with the other vectors though. How can I reconcile this? I don't understand type families sufficiently to analyse this situation. I've tried but they are mighty hard to grasp. Not sure if adding Scalar to Eq is necessary or possible.