Here is a trait in package p
package p
trait Aliases { type Env = A with B }
In Scala 2, you could do this:
package object p extends Aliases
Error:Abnormal build process termination: | |
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java -Xmx700m -Djava.awt.headless=true -Djdt.compiler.useSingleThread=true -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djava.net.preferIPv4Stack=true -Dio.netty.initialSeedUniquifier=3593707791657959617 -Dfile.encoding=UTF-8 -Djps.file.types.component.name=FileTypeManager -Duser.language=en -Duser.country=GB -Didea.paths.selector=IntelliJIdea2016.3 "-Didea.home.path=/Applications/IntelliJ IDEA.app/Contents" -Didea.config.path=/Users/Jamie/Library/Preferences/IntelliJIdea2016.3 "-Didea.plugins.path=/Users/Jamie/Library/Application Support/IntelliJIdea2016.3" -Djps.log.dir=/Users/Jamie/Library/Logs/IntelliJIdea2016.3/build-log "-Djps.fallback.jdk.home=/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre" -Djps.fallback.jdk.version=1.8.0_112-release -Djava.io.tmpdir=/Users/Jamie/Library/Caches/IntelliJIdea2016.3/compile-server/_temp_ -Dkotlin.incremental.compilation.experimental=tr |
type StackT = List[String] | |
type StatT = StackT => StackT | |
type ProgT = List[StatT] | |
def prettyPrint( | |
a: Any, | |
indentSize: Int = 2, | |
maxElementWidth: Int = 60, | |
depth: Int = 0): String = { |
Here is a trait in package p
package p
trait Aliases { type Env = A with B }
In Scala 2, you could do this:
package object p extends Aliases
object Notarisation: | |
private case object Proven | |
opaque type Proof <: Singleton = Proven.type | |
given Proof = Proven | |
end Notarisation | |
import Notarisation.Proof |
// using scala 3.1.0 | |
// using lib org.typelevel::cats-core:2.6.1 | |
package good | |
import cats.Semigroup | |
import cats.syntax.all.* | |
enum Maybe[+A]: | |
case Just(a: A) |
// using scala 3.1.0 | |
package mycats: | |
trait Semigroup[A]: | |
def combine(a1: A, a2: A): A | |
class SemigroupOps[A](a1: A)(implicit ev: Semigroup[A]): | |
def combine(a2: A): A = ev.combine(a1, a2) |
{ | |
"coursier": { | |
"repositories": [ | |
"central" | |
], | |
"dependencies": [ | |
"io.get-coursier::coursier-cli:2.1.0-M2" | |
] | |
}, | |
"scala-cli" : { |
// using scala 3.0.2 | |
package day22 | |
import scala.util.Using | |
import scala.io.Source | |
import scala.collection.mutable |
// using scala 3.0.2 | |
package day22Wu | |
import scala.util.Using | |
import scala.io.Source | |
import scala.collection.mutable |
//> using dep io.get-coursier:coursier_2.13:2.1.8 | |
//> using dep com.lihaoyi::os-lib:0.9.3 | |
//> using dep com.lihaoyi::sourcecode:0.3.1 | |
//> using scala 3.3.1 | |
//> using buildInfo | |
import scala.sys.process.* | |
import java.nio.file.{Files, Paths, Path} | |
import java.io.File.pathSeparator as cpSep | |
import scala.annotation.threadUnsafe as tu |