scala.caps

package scala.caps

Members list

Type members

Experimental classlikes

trait CapSet

Carrier trait for capture set type parameters

Carrier trait for capture set type parameters

Attributes

Experimental
true
Source
package.scala
Supertypes
class Any
trait Capability

Base trait for classes that represent capabilities in the object-capability model.

Base trait for classes that represent capabilities in the object-capability model.

A capability is a value representing a permission, access right, resource or effect. Capabilities are typically passed to code as parameters; they should not be global objects. Often, they come with access restrictions such as scoped lifetimes or limited sharing.

An example is the Label class in scala.util.boundary. It represents a capability in the sense that it gives permission to break to the enclosing boundary represented by the Label. It has a scoped lifetime, since breaking to a Label after the associated boundary was exited gives a runtime exception.

Capability has a formal meaning when Capture Checking is turned on. But even without capture checking, extending this trait can be useful for documenting the intended purpose of a class.

Attributes

Experimental
true
Source
package.scala
Supertypes
class Any
Known subtypes
trait Exists
object cap
class CanThrow[E]
sealed trait Contains[+C >: CapSet <: CapSet, R <: Singleton]

A type constraint expressing that the capture set C needs to contain the capability R

A type constraint expressing that the capture set C needs to contain the capability R

Attributes

Companion
object
Experimental
true
Source
package.scala
Supertypes
class Object
trait Matchable
class Any
object Contains

Attributes

Companion
trait
Experimental
true
Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Contains.type
sealed trait Exists extends Capability

A trait to allow expressing existential types such as

A trait to allow expressing existential types such as

(x: Exists) => A ->{x} B

Attributes

Experimental
true
Source
package.scala
Supertypes
trait Capability
class Object
trait Matchable
class Any
object cap extends Capability

The universal capture reference.

The universal capture reference.

Attributes

Experimental
true
Source
package.scala
Supertypes
trait Capability
class Object
trait Matchable
class Any
Self type
cap.type
object internal

Attributes

Experimental
true
Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
internal.type
object unsafe

Attributes

Experimental
true
Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
unsafe.type
final class use extends StaticAnnotation

An annotation on parameters x stating that the method's body makes use of the reach capability x*. Consequently, when calling the method we need to charge the deep capture set of the actual argiment to the environment.

An annotation on parameters x stating that the method's body makes use of the reach capability x*. Consequently, when calling the method we need to charge the deep capture set of the actual argiment to the environment.

Note: This should go into annotations. For now it is here, so that we can experiment with it quickly between minor releases

Attributes

Experimental
true
Source
package.scala
Supertypes
class Annotation
class Object
trait Matchable
class Any