15 lines
225 B
Text
15 lines
225 B
Text
|
defimpl Result for: Ok, as: ->
|
||
|
|
||
|
def ok? as: -> true end
|
||
|
def error? as: -> false end
|
||
|
|
||
|
def <Any> ok as: ->
|
||
|
@value
|
||
|
end
|
||
|
|
||
|
def <Any> error as: ->
|
||
|
Huia.Primitive.panic("Attempt to access error from Ok")
|
||
|
end
|
||
|
|
||
|
end
|