Skip to content

Make model conform to Hashable #158

Description

@danielrhammond

Building on the work in #157 we can remove ModelVersion and ModelVersionMixer entirely from Pilot by making model conform to Hashable as part of its requirements.

Pros:

  • Very common that we want Hashable (or at bare minimum Equatable) for our models,
  • Swift 4.2 autogen'ing conformance for simple structs makes this not a pain for most models
  • Makes things feel more swifty (having a separate hasher is definitely a drag in the post 4.2 world)

Cons:

  • Forces Equatable for models (not sure this is actually bad but could be perceived to be higher bar than ModelVersion implementation)
  • Can't separate out hashing for pilots benefit from generic hashing function (this is mostly a good thing, but we exploited this once or twice in $RIP_SECRET_PROJECT to drop noisy user updates for example)
  • Breaking change

I'm solidly pro but wanted to check for feedback before proceeding (cc @wkiefer)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions