Skip to content

Commit

Permalink
Migrate to Scala 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
b-studios committed Nov 23, 2023
1 parent 11218d9 commit 0702a1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lazy val noPublishSettings = Seq(
)

lazy val commonSettings = Seq(
scalaVersion := "3.2.0",
scalaVersion := "3.3.1",
scalacOptions ++= Seq(
"-encoding", "utf8",
"-deprecation",
Expand Down
30 changes: 10 additions & 20 deletions effekt/shared/src/main/scala/effekt/Intelligence.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,20 @@ trait Intelligence {

SymbolInfo(c, "Resumption", signature, Some(ex))

case s: VarBinder =>
case c: VarBinder =>
val signature = C.blockTypeOption(c).map(TState.extractType).orElse(c.tpe).map { tpe => pp"${c.name}: ${tpe}" }

val ex =
s"""|Each variable declaration introduces a new scope.
s"""|Like in other languages, mutable variable binders like `${c.name}`
|can be modified (e.g., `${c.name} = VALUE`) by code that has `${c.name}`
|in its lexical scope.
|
|Variables must only be accessed while they are still live.
|""".stripMargin
|However, as opposed to other languages, variable binders in Effekt
|are stack allocated and show the right backtracking behavior in
|combination with effect handlers.
""".stripMargin

SymbolInfo(s, "Local variable", None, Some(ex))
SymbolInfo(c, "Mutable variable binder", signature, Some(ex))

case s: RegBinder =>

Expand All @@ -228,21 +233,6 @@ trait Intelligence {
val signature = C.valueTypeOption(c).orElse(c.tpe).map { tpe => pp"${c.name}: ${tpe}" }
SymbolInfo(c, "Value binder", signature, None)

case c: VarBinder =>
val signature = C.blockTypeOption(c).map(TState.extractType).orElse(c.tpe).map { tpe => pp"${c.name}: ${tpe}" }

val ex =
s"""|Like in other languages, mutable variable binders like `${c.name}`
|can be modified (e.g., `${c.name} = VALUE`) by code that has `${c.name}`
|in its lexical scope.
|
|However, as opposed to other languages, variable binders in Effekt
|are stack allocated and show the right backtracking behavior in
|combination with effect handlers.
""".stripMargin

SymbolInfo(c, "Mutable variable binder", signature, Some(ex))

case c: DefBinder =>
val signature = C.blockTypeOption(c).orElse(c.tpe).map { tpe => pp"${c.name}: ${tpe}" }
SymbolInfo(c, "Block binder", signature, None)
Expand Down
2 changes: 1 addition & 1 deletion kiama

0 comments on commit 0702a1e

Please sign in to comment.