CanGet

dev.constructive.eo.CanGet
See theCanGet companion trait
object CanGet

Attributes

Companion
trait
Source
CanGet.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
CanGet.type

Members list

Givens

Givens

given given_CanGet_S_A: [S, T, A, B, F[_, _]] => (Optic[S, T, A, B, F], Accessor[F]) => CanGet[S, A]

Derive from any optic in scope whose carrier can always read. The optic parameter precedes the gate typeclass in the same using clause deliberately: same-clause resolution runs left to right, so the optic pins the carrier F before Accessor[F] is searched. (A context bound F[_, _]: Accessor would desugar — SIP-64, Scala 3.6+ — to a clause searched FIRST, with F still free, and fail.) Concrete optic classes implement CanGet directly, and a concrete given wins over this one by specificity, so this instance only serves optics known at the generic Optic[…, F] type.

Derive from any optic in scope whose carrier can always read. The optic parameter precedes the gate typeclass in the same using clause deliberately: same-clause resolution runs left to right, so the optic pins the carrier F before Accessor[F] is searched. (A context bound F[_, _]: Accessor would desugar — SIP-64, Scala 3.6+ — to a clause searched FIRST, with F still free, and fail.) Concrete optic classes implement CanGet directly, and a concrete given wins over this one by specificity, so this instance only serves optics known at the generic Optic[…, F] type.

Attributes

Source
CanGet.scala