Make constraint case classes generic