mantra / runtime /stdlib /result.py
SNAPKITTYWEST's picture
Mirror from SNAPKITTYWEST: runtime/stdlib/result.py
9527ace verified
Raw
History Blame Contribute Delete
289 Bytes
from runtime.types import Result, Option
def ok(v) -> Result:
return Result(tag='ok', value=v)
def err(e) -> Result:
return Result(tag='err', value=e)
def some(v) -> Option:
return Option(tag='some', value=v)
def none() -> Option:
return Option(tag='none', value=None)