Search code examples
haskellhaskell-lenslenses

Haskell - iso on newtype


If I have a newtype

newtype Foo = Foo Int

is there an automatic way to get an Iso' Foo Int?

I saw I could use makeLenses ''Foo, but I don't know what is the name of the generated iso.


Solution

  • coerced :: (Coercible s a, Coercible t b) => Iso s t a b