15 lines
230 B
Text
15 lines
230 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
|