Without being too knowledgeable on the topic, but with a little math background - you'd need a bijective function to that. On a quick search for bijective lenses https://arxiv.org/abs/1710.03248
In other words, you couldn't have a bijective function between an integer and a boolean, because there are fewer possible boolean values than integer values.
Demanding bijective functions is probably more restrictive than you want to be for building real-world systems. We discuss this a bit in the paper -- I think look for "convert".