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
230 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: ->
Huia.Primitive.panic("Attempt to convert error into value")
end
def <Any> error as: ->
self
end
end