96677aa499
I know this is dumb, but it's the best way for be to crystalise my thoughts about how this will work.
13 lines
269 B
Text
13 lines
269 B
Text
deftrait Result, as: ->
|
|
|
|
defstatic ok value: Any, as: -> Result.Ok.new(value)
|
|
defstatic error error: Error, as: -> Result.Error.new(error)
|
|
defstatic none as: -> Result.None.new()
|
|
|
|
def ok?
|
|
def error?
|
|
|
|
def <Any> unwrap
|
|
def <Any> expect message: String
|
|
|
|
end
|