kowainik / stan

🕵️ Haskell STatic ANalyser
https://kowainik.github.io/projects/stan
Mozilla Public License 2.0
565 stars 48 forks source link

Wrong order of fields/missing fields in serialisation instances #292

Open chshersh opened 4 years ago

chshersh commented 4 years ago

Sometimes, when the code is polymorphic, it's very easy to use the wrong order of fields:

data User = User
    { userName :: !Text
    , userAge :: !Int
    }

instance Binary User where
  put User{..) = put userAge >> put userName
  get = User <$> get <*> get