Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 445
marcosh Avatar asked Feb 07 '20 08:02

marcosh


1 Answers

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

like image 147
luqui Avatar answered Sep 30 '22 09:09

luqui