Closed tchoutri closed 1 year ago
Adding
instance
( a ~ Operation, b ~ Operation
) => LabelOptic "allOperations" A_Traversal OpenApi OpenApi a b where
labelOptic = #paths % traversed % gplate
{-# INLINE labelOptic #-}
to OpenApi.Optics
should do it.
It's perfect, thank you very much!!
I am trying to reimplement this HasOpenApi instance with Optics instead Lens. Most of the transition is pretty smooth, the usual "replacing (.) with (%)", and using the correct overloaded labels.
So far this looks like:
My last problem is the
#allOperations
label. It is:And this Traversal is obviously a
lens
thing and this is where my knowledge of lens & optics falls short. How could I re-implement it with optics?