Skip to content

Commit 7104006

Browse files
committed
initial ops commit
1 parent e730243 commit 7104006

1 file changed

Lines changed: 154 additions & 0 deletions

File tree

core/rbs/ops.rbs

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
module RBS
2+
module Ops
3+
# An interface for types implementing the `+` operator
4+
interface _Add[O, R = self]
5+
# Perform the `+` operation
6+
def +: (O other) -> R
7+
end
8+
9+
# An interface for types implementing the `-` operator
10+
interface _Subtract[O, R = self]
11+
# Perform the `-` operation
12+
def -: (O other) -> R
13+
end
14+
15+
# An interface for types implementing the `*` operator
16+
interface _Times[O, R = self]
17+
# Perform the `*` operation
18+
def *: (O other) -> R
19+
end
20+
21+
# An interface for types implementing the `/` operator
22+
interface _Divide[O, R = self]
23+
# Perform the `/` operation
24+
def /: (O other) -> R
25+
end
26+
27+
# An interface for types implementing the `%` operator
28+
interface _Modulo[O, R = self]
29+
# Perform the `%` operation
30+
def %: (O other) -> R
31+
end
32+
33+
# An interface for types implementing the `**` operator
34+
interface _Power[O, R = self]
35+
# Perform the `**` operation
36+
def **: (O other) -> R
37+
end
38+
39+
# An interface for types implementing the `<` operator
40+
interface _LessThan[O, R = bool]
41+
# Perform the `<` operation
42+
def <: (O other) -> R
43+
end
44+
45+
# An interface for types implementing the `>` operator
46+
interface _GreaterThan[O, R = bool]
47+
# Perform the `>` operation
48+
def >: (O other) -> R
49+
end
50+
51+
# An interface for types implementing the `<=` operator
52+
interface _LessThanOrEqual[O, R = bool]
53+
# Perform the `<=` operation
54+
def <=: (O other) -> R
55+
end
56+
57+
# An interface for types implementing the `>=` operator
58+
interface _GreaterThanOrEqual[O, R = bool]
59+
# Perform the `>=` operation
60+
def >=: (O other) -> R
61+
end
62+
63+
# An interface for types implementing the `<=>` operator
64+
interface _Compare[O = untyped, R = (-1 | 0 | 1)?]
65+
# Perform the `<=>` operation
66+
def <=>: (O other) -> R
67+
end
68+
69+
# An interface for types implementing the `&` operator
70+
interface _And[O, R = self]
71+
# Perform the `&` operation
72+
def &: (O other) -> R
73+
end
74+
75+
# An interface for types implementing the `|` operator
76+
interface _Or[O, R = self]
77+
# Perform the `|` operation
78+
def |: (O other) -> R
79+
end
80+
81+
# An interface for types implementing the `^` operator
82+
interface _Xor[O, R = self]
83+
# Perform the `^` operation
84+
def ^: (O other) -> R
85+
end
86+
87+
# An interface for types implementing the `<<` operator
88+
interface _LeftShift[O, R = self]
89+
# Perform the `<<` operation
90+
def <<: (O other) -> R
91+
end
92+
93+
# An interface for types implementing the `>>` operator
94+
interface _RightShift[O, R = self]
95+
# Perform the `>>` operation
96+
def >>: (O other) -> R
97+
end
98+
99+
# An interface for types implementing the `~` operator
100+
interface _Not[R = self]
101+
# Perform the `~` operation
102+
def ~: () -> R
103+
end
104+
105+
# An interface for types implementing the `+@` operator
106+
interface _UnaryPos[R = self]
107+
# Perform the `+@` operation
108+
def +@: () -> R
109+
end
110+
111+
# An interface for types implementing the `-@` operator
112+
interface _UnaryNeg[R = self]
113+
# Perform the `-@` operation
114+
def -@: () -> R
115+
end
116+
117+
# An interface for types implementing the `!` operator
118+
interface _LogicalNot[R = bool]
119+
# Perform the `!` operation
120+
def !: () -> R
121+
end
122+
123+
# An interface for types implementing the `==` operator
124+
interface _Equal[O = untyped, R = bool]
125+
# Perform the `==` operation
126+
def ==: (O other) -> R
127+
end
128+
129+
# An interface for types implementing the `===` operator
130+
interface _CaseEqual[O, R = bool]
131+
# Perform the `===` operation
132+
def ===: (O other) -> R
133+
end
134+
135+
# An interface for types implementing the `=~` operator
136+
interface _Matches[O, R]
137+
# Perform the `=~` operation
138+
def =~: (O other) -> R
139+
end
140+
141+
# An interface for types implementing the `!=` operator
142+
interface _NotEqual[O = untyped, R = bool]
143+
# Perform the `!=` operation
144+
def !=: (O other) -> R
145+
end
146+
147+
# An interface for types implementing the `!~` operator
148+
interface _NotMatches[O, R = bool]
149+
# Perform the `!~` operation
150+
def !~: (O other) -> R
151+
end
152+
end
153+
end
154+

0 commit comments

Comments
 (0)