Converting code from Eq.contramap example in fp-ts docs - Effect Community