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
2018-09-11 18:40:17 +12:00

14 lines
231 B
Text

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