This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
huia/packages/core/error/result.huia

15 lines
231 B
Text
Raw Normal View History

2018-09-01 11:44:59 +12:00
defimpl Result for: Error, as: ->
def ok? as: -> false end
def error? as: -> true end
def <Any> ok as: ->
2018-09-11 18:40:17 +12:00
Huia::Primitive.panic("Attempt to convert error into value")
2018-09-01 11:44:59 +12:00
end
def <Any> error as: ->
self
end
end