Scoop API

scoop:scoop.core:0.1.0

src/operators_access.scoop

Selected production source · src/operators_access.scoop

1/**
2 * The generic operator contract used for `a[index]`. Operand and result types are chosen by the
3 * implementation.
4 */
5public interface IndexGet<Index, Value> {
6 /**
7 * Implements `a[index]` for this receiver; domain restrictions and failure behavior belong to
8 * the implementing type.
9 */
10 public operator fun get(index: Index): Value
13/**
14 * The generic operator contract used for `a[index] = value`. Operand and result types are chosen
15 * by the implementation.
16 */
17public interface IndexSet<Index, Value> {
18 /**
19 * Implements `a[index] = value` for this receiver; domain restrictions and failure behavior
20 * belong to the implementing type.
21 */
22 public operator fun set(index: Index, value: Value): Unit
25/**
26 * The generic operator contract used for `a[first, second]`. Operand and result types are chosen
27 * by the implementation.
28 */
29public interface IndexGet2<I, J, Value> {
30 /**
31 * Implements `a[first, second]` for this receiver; domain restrictions and failure behavior
32 * belong to the implementing type.
33 */
34 public operator fun get(first: I, second: J): Value
37/**
38 * The generic operator contract used for `a[first, second] = value`. Operand and result types are
39 * chosen by the implementation.
40 */
41public interface IndexSet2<I, J, Value> {
42 /**
43 * Implements `a[first, second] = value` for this receiver; domain restrictions and failure
44 * behavior belong to the implementing type.
45 */
46 public operator fun set(first: I, second: J, value: Value): Unit
49/**
50 * The generic operator contract used for `a()`. Operand and result types are chosen by the
51 * implementation.
52 */
53public interface Invoke0<Result> {
54 /**
55 * Implements `a()` for this receiver; domain restrictions and failure behavior belong to the
56 * implementing type.
57 */
58 public operator fun invoke(): Result
61/**
62 * The generic operator contract used for `a(argument)`. Operand and result types are chosen by the
63 * implementation.
64 */
65public interface Invoke<Arg, Result> {
66 /**
67 * Implements `a(argument)` for this receiver; domain restrictions and failure behavior belong
68 * to the implementing type.
69 */
70 public operator fun invoke(argument: Arg): Result
73/**
74 * The generic operator contract used for `a(first, second)`. Operand and result types are chosen
75 * by the implementation.
76 */
77public interface Invoke2<A, B, Result> {
78 /**
79 * Implements `a(first, second)` for this receiver; domain restrictions and failure behavior
80 * belong to the implementing type.
81 */
82 public operator fun invoke(first: A, second: B): Result
85/**
86 * The generic operator contract used for `the first destructured component`. Operand and result
87 * types are chosen by the implementation.
88 */
89public interface Component1<Result> {
90 /**
91 * Implements `the first destructured component` for this receiver; domain restrictions and
92 * failure behavior belong to the implementing type.
93 */
94 public operator fun component1(): Result
97/**
98 * The generic operator contract used for `the second destructured component`. Operand and result
99 * types are chosen by the implementation.
100 */
101public interface Component2<Result> {
102 /**
103 * Implements `the second destructured component` for this receiver; domain restrictions and
104 * failure behavior belong to the implementing type.
105 */
106 public operator fun component2(): Result