The inet type exists already [here](https://hackage.haskell.org/package/postgresql-simple-0.7.0.0/docs/src/Database.PostgreSQL.Simple.TypeInfo.Static.html#inet) postgresql-binary has examples of [encoding](https://hackage.haskell.org/package/postgresql-binary-0.13.1.2/docs/src/PostgreSQL.Binary.Encoding.Builders.html#inet) and [decoding](https://hackage.haskell.org/package/postgresql-binary-0.13.1.2/docs/src/PostgreSQL.Binary.Decoding.html#inet)