Source/Packages

Std.Foundation

packages/foundation/standard/src/Std/Foundation.alpha

325 lines52 declarations11.6 KiBSHA-256 3dcbd3fa87ff

def · lines 288–298

stdResultToOption

Full file
A result as an option, dropping the error.
288def stdResultToOption =
289  (lambda erased errorType : Type 0 .
290    erased valueType : Type 0 .
291    unrestricted value : (family StdResult errorType valueType) .
292    eliminate
293      StdResult
294      (lambda unrestricted current : (family StdResult errorType valueType) .
295        family StdOption valueType)
296      value
297      (branch StdFailure held . constructor StdOption StdNone valueType)
298      (branch StdSuccess held . constructor StdOption StdSome valueType held))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.