Monocle icon indicating copy to clipboard operation
Monocle copied to clipboard

Should withDefault be available on lenses with a polymorphic source?

Open steinybot opened this issue 2 years ago • 0 comments

It seems to me like the extension methods that are on LensSyntax et al that use andThen (such as withDefault ought to only require A =:= B and not S =:= T. I would expect those to be on something like:

final case class LensTargetSyntax[S, T, A](private val self: PLens[S, T, A, A]) extends AnyVal {
  ...
}

steinybot avatar Feb 23 '23 11:02 steinybot