Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
Does anyone have a link to a concise introduction to iso, prisms, lens and such things?
optics documentation is really nice and concise
optics
How do you make an 'Iso' for say a newtype over Text?
type Iso s t a b = forall p f. (Profunctor p, Functor f) => p a (f b) -> p s (f t)
How would I construct say Iso' TheNewType Text?
Iso' TheNewType Text
More generally, Iso' (Tagged s b) b
Iso' (Tagged s b) b
So you have to compose lenses, hmm. https://artyom.me/lens-over-tea-4
Ah, maybe I just need Control.Lens.Wrapped
Control.Lens.Wrapped
https://hackage.haskell.org/package/lens-4.19.2/docs/Control-Lens-Wrapped.html#t:Wrapped
generic-lens can also produce these - http://hackage.haskell.org/package/generic-lens-2.0.0.0/docs/Data-Generics-Wrapped.html
generic-lens
Does anyone have a link to a concise introduction to iso, prisms, lens and such things?
optics
documentation is really nice and conciseHow do you make an 'Iso' for say a newtype over Text?
How would I construct say
Iso' TheNewType Text
?More generally,
Iso' (Tagged s b) b
So you have to compose lenses, hmm. https://artyom.me/lens-over-tea-4
Ah, maybe I just need
Control.Lens.Wrapped
https://hackage.haskell.org/package/lens-4.19.2/docs/Control-Lens-Wrapped.html#t:Wrapped
generic-lens
can also produce these - http://hackage.haskell.org/package/generic-lens-2.0.0.0/docs/Data-Generics-Wrapped.html