See: - https://gcanti.github.io/io-ts/modules/Codec.ts.html#imap - https://hackage.haskell.org/package/invariant-0.5.4/docs/Data-Functor-Invariant.html