diff --git a/core/src/main/scala/magnolia1/magnolia.scala b/core/src/main/scala/magnolia1/magnolia.scala index 78ddf6b..e911f5b 100644 --- a/core/src/main/scala/magnolia1/magnolia.scala +++ b/core/src/main/scala/magnolia1/magnolia.scala @@ -946,7 +946,16 @@ private[magnolia1] object CompileTimeState { } object CallByNeed { + + /** Initializes a class that allows for suspending evaluation of a value until it is needed. Evaluation of a value via `.value` can only + * happen once. Evaluation of a value via `.valueEvaluator` will return None. For evaluating a value multiple times, please construct a + * CallByNeed via CallByNeed.withValueEvaluator(value) + */ def apply[A](a: => A): CallByNeed[A] = new CallByNeed(() => a, () => false) + + /** Initializes a class that allows for suspending evaluation of a value until it is needed. Evaluation of a value via `.value` can only + * happen once. Evaluation of a value via `.valueEvaluator.map(evaluator => evaluator())` will happen every time the evaluator is called + */ def withValueEvaluator[A](a: => A): CallByNeed[A] = new CallByNeed(() => a, () => true) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 9e7d965..7e83c66 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -6,5 +6,5 @@ addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.1") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")