forked from wavesplatform/Waves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Lens to allow for easy transition to Scala3 (wavesplatform#3970)
- Loading branch information
1 parent
1fa1513
commit d51a17f
Showing
9 changed files
with
61 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 4 additions & 13 deletions
17
lang/shared/src/main/scala/com/wavesplatform/lang/v1/estimator/v2/EstimatorContext.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
package com.wavesplatform.lang.v1.estimator.v2 | ||
|
||
|
||
import com.wavesplatform.lang.v1.FunctionHeader | ||
import com.wavesplatform.lang.v1.compiler.Terms.FUNC | ||
import com.wavesplatform.lang.v1.estimator.EstimationError | ||
import com.wavesplatform.lang.v1.estimator.v2.EstimatorContext.EvalM | ||
import com.wavesplatform.lang.v1.task.TaskM | ||
import shapeless.{Lens, lens} | ||
|
||
private[v2] case class EstimatorContext( | ||
letDefs: Map[String, (Boolean, EvalM[Long])], | ||
predefFuncs: Map[FunctionHeader, Long], | ||
userFuncs: Map[FunctionHeader, FUNC] = Map.empty, | ||
overlappedRefs: Map[String, (Boolean, EvalM[Long])] = Map.empty | ||
letDefs: Map[String, (Boolean, EvalM[Long])], | ||
predefFuncs: Map[FunctionHeader, Long], | ||
userFuncs: Map[FunctionHeader, FUNC] = Map.empty, | ||
overlappedRefs: Map[String, (Boolean, EvalM[Long])] = Map.empty | ||
) | ||
|
||
private[v2] object EstimatorContext { | ||
type EvalM[A] = TaskM[EstimatorContext, EstimationError, A] | ||
|
||
object Lenses { | ||
val lets: Lens[EstimatorContext, Map[String, (Boolean, EvalM[Long])]] = lens[EstimatorContext] >> Symbol("letDefs") | ||
val userFuncs: Lens[EstimatorContext, Map[FunctionHeader, FUNC]] = lens[EstimatorContext] >> Symbol("userFuncs") | ||
val predefFuncs: Lens[EstimatorContext, Map[FunctionHeader, Long]] = lens[EstimatorContext] >> Symbol("predefFuncs") | ||
val overlappedRefs: Lens[EstimatorContext, Map[String, (Boolean, EvalM[Long])]] = lens[EstimatorContext] >> Symbol("overlappedRefs") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.