{"size": 655, "ext": "scrbl", "max_stars_repo_path": "elle-doc/scribblings/core-data/optional.scrbl", "max_stars_repo_name": "tail-reversion/elle", "max_stars_repo_stars_event_min_datetime": "2021-01-07T04:34:50.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-08T01:07:58.000Z", "max_issues_repo_path": "elle-doc/scribblings/core-data/optional.scrbl", "max_issues_repo_name": "tail-reversion/elle", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "elle-doc/scribblings/core-data/optional.scrbl", "max_forks_repo_name": "tail-reversion/elle", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.4782608696, "max_line_length": 225, "alphanum_fraction": 0.7129770992}
#lang scribble/manual

@(require "../util.rkt")


@title{Optional Values}

@defidform[#:kind "type" optional]{
 An optional value encapsulates a result that either is present or absent. This data type is particularly useful for the return value of element lookups in collections, or for procedures that have a trivial notion of failure.

 @defsubform[#:kind "constructor" #:id present (present value)]{
  Container for a value.
 }

 @defsubform[#:kind "constructor" #:id absent absent]{
  Represents a lack of a value.
 }
}

@defproc[(option-case [opt option?] [#:present present-proc (λ/c any/c → any/c)] [#:absent absent-proc (λ/c → any/c)]) any/c]{

}
