Deriving for phantom and empty types