Source/Packages

Std.Foundation

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

329 lines52 declarations12.3 KiBSHA-256 7818c29d5c7c

def · lines 292–302

stdResultToOption

Full file
A result as an option, dropping the error.
292def stdResultToOption =
293  (lambda erased errorType : Type 0 .
294    (lambda erased valueType : Type 0 .
295      (lambda unrestricted value : (family StdResult errorType valueType) .
296        (eliminate
297          StdResult
298          (lambda unrestricted current : (family StdResult errorType valueType) .
299            (family StdOption valueType))
300          value
301          (branch StdFailure held . (constructor StdOption StdNone valueType))
302          (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.