Skip to content

Commit

Permalink
welp
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgk committed Dec 3, 2024
1 parent e630d3e commit c21edef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Modules/RDTs/src/main/scala/rdts/base/Lattice.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ object Lattice {
// Sometimes the merge extension on the lattice trait is not found, and it is unclear what needs to be imported.
// This could be just an extension method, but then would be ambiguous in cases where the extension on the interface is available.
// Thus, we put the extension into this implicit object, when `Lattice.syntax` is imported (or otherwise in the implicit scope) then it is eligible as the receiver for the extension method rewrite. For some reason, this never causes conflicts even if multiple objects are named `syntax` (as opposed to name conflicts with the extension method, which does cause conflicts).
// In case we ever want to fully migrate away from the `implicit` keyword, the first line is equivalent to: `given syntax: {} with`, but that seems just weird.
implicit object syntax:
given syntax: {} with
extension [A: Lattice](left: A)
def merge(right: A): A = Lattice[A].merge(left, right)

Expand Down

0 comments on commit c21edef

Please sign in to comment.