Monocle 3 deprecates lots of methods, it would be great to use scalafix to automatically refactor the ones that have replacements. Here is a list of changes:
[ ] set to replace
[ ] setOption to replaceOption
Shortcuts for popular optics
[ ] composeLens(at(x)) to at(x)
[ ] composePrism(some) to some
[ ] composeOptional(index(x)) to index(x)
[ ] composeTraversal(each) to each
[ ] composeTraversal(filterIndex(predicate)) to filterIndex(predicate)
[ ] composeLens(first) or composeLens(_1) to at(1)
[ ] composeLens(second) or composeLens(_2) to at(2)
[ ] composeLens(third) or composeLens(_3) to at(3)
[ ] composeLens(fourth) or composeLens(_4) to at(4)
[ ] composeLens(fifth) or composeLens(_5) to at(5)
[ ] composeLens(sixth) or composeLens(_6) to at(6)
[ ] composeOptional(headOption) to index(0)
Overloaded compose method
[ ] composeFold(x) to andThen(x)
[ ] composeGetter(x) to andThen(x)
[ ] composeIso(x) to andThen(x)
[ ] composeLens(x) to andThen(x)
[ ] composePrism(x) to andThen(x)
[ ] composeOptional(x) to andThen(x)
[ ] composeTraversal(x) to andThen(x)
[ ] composeSetter(x) to andThen(x)
Remove symbolic compose operators
[ ] ^|->> x to andThen(x)
[ ] ^|-? x to andThen(x)
[ ] ^<-? x to andThen(x)
[ ] ^|-> x to andThen(x)
[ ] ^<-> x to andThen(x)
ApplyOptics
[ ] applyLens(at(x)) to optics.at(x)
[ ] applyPrism(some) to optics.some
[ ] applyOptional(index(x)) to optics.index(x)
[ ] applyTraversal(each) to optics.each
[ ] applyTraversal(filterIndex(predicate)) to optics.filterIndex(predicate)
[ ] applyLens(first) or applyLens(_1) to optics.at(1)
[ ] applyLens(second) or applyLens(_2) to optics.at(2)
[ ] applyLens(third) or applyLens(_3) to optics.at(3)
[ ] applyLens(fourth) or applyLens(_4) to optics.at(4)
[ ] applyLens(fifth) or applyLens(_5) to optics.at(5)
[ ] applyLens(sixth) or applyLens(_6) to optics.at(6)
Monocle 3 deprecates lots of methods, it would be great to use scalafix to automatically refactor the ones that have replacements. Here is a list of changes:
set
toreplace
setOption
toreplaceOption
Shortcuts for popular optics
composeLens(at(x))
toat(x)
composePrism(some)
tosome
composeOptional(index(x))
toindex(x)
composeTraversal(each)
toeach
composeTraversal(filterIndex(predicate))
tofilterIndex(predicate)
composeLens(first)
orcomposeLens(_1)
toat(1)
composeLens(second)
orcomposeLens(_2)
toat(2)
composeLens(third)
orcomposeLens(_3)
toat(3)
composeLens(fourth)
orcomposeLens(_4)
toat(4)
composeLens(fifth)
orcomposeLens(_5)
toat(5)
composeLens(sixth)
orcomposeLens(_6)
toat(6)
composeOptional(headOption)
toindex(0)
Overloaded compose method
composeFold(x)
toandThen(x)
composeGetter(x)
toandThen(x)
composeIso(x)
toandThen(x)
composeLens(x)
toandThen(x)
composePrism(x)
toandThen(x)
composeOptional(x)
toandThen(x)
composeTraversal(x)
toandThen(x)
composeSetter(x)
toandThen(x)
Remove symbolic compose operators
^|->> x
toandThen(x)
^|-? x
toandThen(x)
^<-? x
toandThen(x)
^|-> x
toandThen(x)
^<-> x
toandThen(x)
ApplyOptics
applyLens(at(x))
tooptics.at(x)
applyPrism(some)
tooptics.some
applyOptional(index(x))
tooptics.index(x)
applyTraversal(each)
tooptics.each
applyTraversal(filterIndex(predicate))
tooptics.filterIndex(predicate)
applyLens(first)
orapplyLens(_1)
tooptics.at(1)
applyLens(second)
orapplyLens(_2)
tooptics.at(2)
applyLens(third)
orapplyLens(_3)
tooptics.at(3)
applyLens(fourth)
orapplyLens(_4)
tooptics.at(4)
applyLens(fifth)
orapplyLens(_5)
tooptics.at(5)
applyLens(sixth)
orapplyLens(_6)
tooptics.at(6)
applyOptional(headOption)
tooptics.index(0)
applyFold(x)
tooptics.andThen(x)
applyGetter(x)
tooptics.andThen(x)
applyIso(x)
tooptics.andThen(x)
applyLens(x)
tooptics.andThen(x)
applyPrism(x)
tooptics.andThen(x)
applyOptional(x)
tooptics.andThen(x)
applyTraversal(x)
tooptics.andThen(x)
applySetter(x)
tooptics.andThen(x)
Reference: https://github.com/fthomas/scala-steward/blob/master/docs/scalafix-migrations.md
Originally proposed in https://github.com/optics-dev/Monocle/issues/684