scala.caps

package scala.caps

Members list

Type members

Classlikes

sealed trait Capability

Base trait for classes that represent capabilities in the [object-capability model](https://en.wikipedia.org/wiki/Object-capability_model).

Base trait for classes that represent capabilities in the [object-capability model](https://en.wikipedia.org/wiki/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.

Capability has exactly two subtraits: Shared and Exclusive.

Attributes

Source
package.scala
Supertypes
class Any
Known subtypes
trait Mutable
trait Read
trait Exists
trait Control
class ReturnThrowable[T]
class Label[T]
class CanThrow[E]
object cap
Show all
trait Classifier

A marker trait for classifier capabilities that can appear in .only qualifiers.

A marker trait for classifier capabilities that can appear in .only qualifiers. Capability classes directly extending Classifier are treated as classifier capbilities.

Classifier has a formal meaning when Capture Checking is turned on. It should not be used outside of capture checking.

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Control
class ReturnThrowable[T]
class Label[T]
class CanThrow[E]
trait Mutable
trait Read
Show all

Marker trait for capabilities that capture some continuation or return point in the stack.

Marker trait for capabilities that capture some continuation or return point in the stack. Examples are exceptions, labels, CanThrow or Async contexts.

Control has a formal meaning when Capture Checking is turned on.

Attributes

Source
package.scala
Supertypes
trait Classifier
trait Capability
class Object
trait Matchable
class Any
Show all
Known subtypes
class ReturnThrowable[T]
class Label[T]
class CanThrow[E]
trait Pure

A marker trait that declares that all inheriting classes are "pure" in the sense that their values retain no capabilities including capabilities needed to perform effects.

A marker trait that declares that all inheriting classes are "pure" in the sense that their values retain no capabilities including capabilities needed to perform effects. This has formal meaning only under capture checking.

NOTE: If an upper bound is Pure, we check that an argument conforms to it only in sources where capture checking is enabled. For instance,

def f[C <: Pure]() f[Object]()

would give an error only under capture checking. Pure is also dropped in upper bounds if it forms part of an &-type, or is under a type lambda.

Attributes

Source
Pure.scala
Supertypes
class Any
Known subtypes
class ArraySeq[A]
class ofBoolean
class ofByte
class ofChar
class ofDouble
class ofFloat
class ofInt
class ofLong
class ofRef[T]
class ofShort
class ofUnit
trait IndexedSeqOps[A, CC, C]
trait IndexedSeq[A]
class NumericRange[T]
class Exclusive[T]
class Inclusive[T]
class Range
class Exclusive
class Inclusive
class Vector[A]
trait MapOps[K, V, CC, C]
trait Map[K, V]
class AbstractMap[K, V]
class HashMap[K, V]
class IntMap[T]
class ListMap[K, V]
class LongMap[T]
class Map1[K, V]
class Map2[K, V]
class Map3[K, V]
class Map4[K, V]
class WithDefault[K, V]
class WithDefault[K, V]
class TreeMap[K, V]
class TreeSeqMap[K, V]
class VectorMap[K, V]
trait SeqMap[K, V]
trait SortedMap[K, V]
trait SortedMapOps[K, V, CC, C]
trait StrictOptimizedSortedMapOps[K, V, CC, C]
trait StrictOptimizedMapOps[K, V, CC, C]
trait SeqOps[A, CC, C]
trait LinearSeqOps[A, CC, C]
class LazyList[A]
trait LinearSeq[A]
class List[A]
class ::[A]
object Nil
class Queue[A]
class Stream[A]
class Cons[A]
object Empty
trait Seq[A]
class AbstractSeq[A]
trait StrictOptimizedSeqOps[A, CC, C]
trait IndexedSeqOps[A, CC, C]
class ArrayBuffer[A]
class ArrayDeque[A]
class Queue[A]
class Stack[A]
class ArraySeq[T]
class ofBoolean
class ofByte
class ofChar
class ofDouble
class ofFloat
class ofInt
class ofLong
class ofRef[T]
class ofShort
class ofUnit
trait IndexedBuffer[A]
trait IndexedSeq[T]
trait MapOps[K, V, CC, C]
class TrieMap[K, V]
class AnyRefMap[K, V]
class CollisionProofHashMap[K, V]
class HashMap[K, V]
class LinkedHashMap[K, V]
class ListMap[K, V]
class LongMap[V]
trait Map[K, V]
trait Map[K, V]
class AbstractMap[K, V]
class WithDefault[K, V]
class WithDefault[K, V]
class OpenHashMap[Key, Value]
class TreeMap[K, V]
trait MultiMap[K, V]
trait SeqMap[K, V]
trait SortedMap[K, V]
trait SortedMapOps[K, V, CC, C]
trait SeqOps[A, CC, C]
trait Buffer[A]
class AbstractBuffer[A]
class ListBuffer[A]
class UnrolledBuffer[T]
trait Seq[A]
class AbstractSeq[A]
class Accumulator[A, CC, C]
class AnyAccumulator[A]
trait EvidenceIterableFactory[CC, Ev]
class Delegate[CC]
class Delegate[CC]
trait ClassTagSeqFactory[CC]
object ArraySeq
object ArraySeq
class Delegate[CC, Ev]
class Delegate[CC]
object SortedSet
object SortedSet
object SortedSet
object TreeSet
object PriorityQueue
object TreeSet
trait IndexedSeq[A]
trait IterableFactory[CC]
object HashSet
object ListSet
object Set
object HashSet
object LinkedHashSet
class AnySeqDelegate[CC]
class Delegate[CC]
object Iterable
object Iterable
object Set
object Iterable
object Set
object Iterator
trait SeqFactory[CC]
object LazyList
object Stream
class Delegate[CC]
object IndexedSeq
object LinearSeq
object Seq
object Buffer
object IndexedBuffer
object IndexedSeq
object Seq
object IndexedSeq
object LinearSeq
object Seq
object List
object Queue
object Vector
object ArrayBuffer
object ArrayDeque
object ListBuffer
object Queue
object Stack
object View
trait LinearSeqOps[A, CC, C]
trait LinearSeq[A]
trait StrictOptimizedLinearSeqOps[A, CC, C]
trait Map[K, V]
class AbstractMap[K, V]
trait DefaultMap[K, V]
trait SeqMap[K, V]
trait SortedMap[K, V]
trait Seq[A]
class AbstractSeq[A]
trait Set[A]
trait Set[A]
class AbstractSet[A]
class BitSet
class BitSet1
class BitSet2
class BitSetN
class HashSet[A]
class ListSet[A]
class Set1[A]
class Set2[A]
class Set3[A]
class Set4[A]
class TreeSet[A]
class Enumeration.this.ValueSet
trait SortedSet[A]
trait Set[A]
class AbstractSet[A]
class BitSet
class HashSet[A]
class LinkedHashSet[A]
class TreeSet[A]
trait SortedSet[A]
class AbstractSet[A]
trait SortedSet[A]
trait BitSet
trait SetOps[A, CC, C]
trait SetOps[A, CC, C]
trait SortedSetOps[A, CC, C]
trait StrictOptimizedSortedSetOps[A, CC, C]
trait StrictOptimizedSetOps[A, CC, C]
trait SetOps[A, CC, C]
trait SortedSetOps[A, CC, C]
trait SortedSetOps[A, CC, C]
trait BitSetOps[C]
trait SortedSetFactoryDefaults[A, CC, WithFilterCC]
trait StrictOptimizedSortedSetOps[A, CC, C]
trait StrictOptimizedSetOps[A, CC, C]
trait SortedMapFactoryDefaults[K, V, CC, WithFilterCC, UnsortedCC]
trait SortedMapOps[K, V, CC, C]
trait StrictOptimizedSortedMapOps[K, V, CC, C]
trait StrictOptimizedSeqOps[A, CC, C]
trait ArrayDequeOps[A, CC, C]
Show all
Self type

Marker trait for capabilities that can be safely shared in a concurrent context.

Marker trait for capabilities that can be safely shared in a concurrent context.

SharedCapability has a formal meaning when Capture Checking is turned on. During separation checking, shared capabilities are not taken into account.

Attributes

Source
package.scala
Supertypes
trait Classifier
trait Capability
class Object
trait Matchable
class Any
Known subtypes
trait Control
class ReturnThrowable[T]
class Label[T]
class CanThrow[E]

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
sealed trait Contains[+C^, 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

Marker trait for capabilities that should only be used by one concurrent process at a given time.

Marker trait for capabilities that should only be used by one concurrent process at a given time. For example, write-access to a shared mutable buffer.

ExclusiveCapability has a formal meaning when Capture Checking is turned on. During separation checking, exclusive usage of marked capabilities will be enforced.

Attributes

Experimental
true
Source
package.scala
Supertypes
trait Classifier
trait Capability
class Object
trait Matchable
class Any
Known subtypes
trait Mutable
trait Read
sealed trait Exists extends Capability

A trait that used to allow expressing existential types.

A trait that used to allow expressing existential types. Replaced by root.Result instances.

Attributes

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

Marker trait for classes with methods that require an exclusive reference.

Marker trait for classes with methods that require an exclusive reference.

Attributes

Experimental
true
Source
package.scala
Supertypes
trait Classifier
trait Capability
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Read
trait Read extends Mutable, Classifier

Marker trait for classes with reader methods, typically extended by Mutable classes

Marker trait for classes with reader methods, typically extended by Mutable classes

Attributes

Experimental
true
Source
package.scala
Supertypes
trait Mutable
trait Classifier
trait Capability
class Object
trait Matchable
class Any
Show all
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
final class reserve extends StaticAnnotation

An annotation on capset parameters C stating that the method's body does not have C in its use-set.

An annotation on capset parameters C stating that the method's body does not have C in its use-set. C might be accessed under a box in the method or in the result type of the method. Consequently, when calling the method we do not need to charge the 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
object unsafe

Attributes

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

Allowed only for source versions up to 3.7: An annotation on parameters x stating that the method's body makes use of the reach capability x*.

Allowed only for source versions up to 3.7: 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.

Attributes

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

Types

Attributes

Source
package.scala

Attributes

Source
package.scala