Forked from anonymous/FBoundedSimplification.scala
Last active
December 10, 2015 20:28
-
-
Save Sciss/4488722 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// does this work out? | |
trait Txn[S <: Sys] { | |
def newVar[A](init: A): S#Vr[A] | |
} | |
trait Var[Tx, A] { | |
def get(implicit tx: Tx): A | |
def set(value: A)(implicit tx: Tx): Unit | |
} | |
trait Sys { | |
type S = this.type // ! yes ?? | |
type Tx <: Txn[S] | |
type Vr[A] <: Var[S#Tx, A] | |
} | |
// nope... | |
trait Txn[S <: Sys] { | |
def newVar[A](init: A): S#Vr[A] | |
} | |
trait Var[Tx, A] { | |
def get(implicit tx: Tx): A | |
def set(value: A)(implicit tx: Tx): Unit | |
} | |
trait Identifier[Tx] { | |
def dispose()(implicit tx: Tx): Unit | |
} | |
trait Sys { | |
type S = this.type | |
type Tx <: Txn[S] | |
type Vr[A] <: Var[S#Tx, A] | |
type ID <: Identifier[S#Tx] | |
} | |
trait Identifiable[+ID] { def id: ID } | |
trait Test[S <: Sys] extends Identifiable[S#ID] { | |
def dispose()(implicit tx: S#Tx) { | |
id.dispose() // !Fail! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment