mirror of
https://github.com/erg-lang/erg.git
synced 2025-07-15 00:55:21 +00:00
11 lines
577 B
Python
11 lines
577 B
Python
.Container = Trait { .__contains__ = (self: Self) -> Bool }
|
|
.Hashable = Trait { .__hash__ = (self: Self) -> Nat }
|
|
.Sized = Trait { .__len__ = (self: Self) -> Nat }
|
|
# TODO: varargs
|
|
.Callable = Trait { .__call__ = (self: Self) -> Obj }
|
|
.Iterator T = Trait { .__next__ = (self: Self) -> T }
|
|
.Iterable T = Trait { .__iter__ = (self: Self) -> .Iterator(T) }
|
|
.Collection T = Subsume .Container and .Iterable(T)
|
|
.Reversible T = Trait { .__reversed__ = (self: Self) -> .Iterator(T) }
|
|
.Genertor T = Subsume .Iterator T
|
|
.Sequence T = Subsume .Collection(T) and .Sized and .Reversible(T)
|