96677aa499
I know this is dumb, but it's the best way for be to crystalise my thoughts about how this will work.
14 lines
286 B
Text
14 lines
286 B
Text
deftype Result.Ok, value: Any, as: ->
|
|
|
|
defstatic <Result.Ok> new value: Any, as: ->
|
|
Result.Ok { value: value }
|
|
end
|
|
|
|
end
|
|
|
|
defimpl Result, for: Result.Ok, as: ->
|
|
def ok? as: -> true
|
|
def error? as: -> false
|
|
def <Any> unwrap as: -> @value
|
|
def <Any> expect as: -> @value
|
|
end
|