feat(els): support module renaming

This commit is contained in:
Shunsuke Shibayama 2023-02-14 16:23:45 +09:00
parent 38f34edbf0
commit f3fd5e3eeb
13 changed files with 222 additions and 39 deletions

View file

@ -6,13 +6,13 @@ class Error:
# T = TypeVar("T")
# @_SpecialForm
def Result(self, parameters):
"""Result type.
Result[T] is equivalent to Union[T, Error].
"""
# arg = _type_check(parameters, f"{self} requires a single type.")
return [arg, Error]
# def Result(self, parameters):
# """Result type.
#
# Result[T] is equivalent to Union[T, Error].
# """
# arg = _type_check(parameters, f"{self} requires a single type.")
# return [arg, Error]
def is_ok(obj) -> bool:
return not isinstance(obj, Error)

View file

@ -1,5 +1,5 @@
from _erg_range import Range, LeftOpenRange, RightOpenRange, OpenRange, ClosedRange, RangeIterator
from _erg_result import Result, Error, is_ok
from _erg_result import Error, is_ok
from _erg_float import Float, FloatMut
from _erg_int import Int, IntMut
from _erg_nat import Nat, NatMut