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
//> using scala 3.3 | |
import scala.util.{Failure, NotGiven, Success, Try, boundary} | |
import boundary.{Label, break} | |
import scala.annotation.targetName | |
/** | |
* Proof of concept implementation of a syntax similar to Kotlin and | |
* typescript. Within the context provided by [[getEither]], you can call | |
* `?` on any optional/failable type (currently supports [[Option]], |
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
//> using scala 3.3.0 | |
import scala.util.{Try, Success, Failure} | |
import scala.reflect.Typeable | |
import scala.util.NotGiven | |
import scala.annotation.implicitNotFound | |
type Opt[T] = Opt.Opt[T] | |
object Opt: |
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
sealed trait Bool | |
object Bool: | |
sealed trait True extends Bool | |
sealed trait False extends Bool | |
sealed trait Nat | |
object Nat: | |
sealed trait _0 extends Nat | |
sealed trait Succ[N <: Nat] extends Nat |