{"size": 1463, "ext": "scrbl", "max_stars_repo_path": "cur-doc/cur/scribblings/stdlib/bool.scrbl", "max_stars_repo_name": "jsmaniac/cur", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "cur-doc/cur/scribblings/stdlib/bool.scrbl", "max_issues_repo_name": "jsmaniac/cur", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "cur-doc/cur/scribblings/stdlib/bool.scrbl", "max_forks_repo_name": "jsmaniac/cur", "max_forks_repo_forks_event_min_datetime": "2021-10-02T16:05:54.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-02T16:05:54.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 26.6, "max_line_length": 209, "alphanum_fraction": 0.6589200273}
#lang scribble/manual

@(require
  "../defs.rkt"
  scribble/eval)

@(define curnel-eval (curnel-sandbox "(require cur/stdlib/bool cur/stdlib/sugar)"))

@title{Bool}
@defmodule[cur/stdlib/bool]
This library defines the datatype @racket[Bool] and several functions and forms for using them.

@; TODO: Define a @defdata macro for Cur
@deftogether[(@defthing[Bool Type]
              @defthing[true Bool]
	      @defthing[false Bool])]{
The boolean datatype.
}

@defform[(if test-expr c-expr alt-expr)]{
A syntactic form that expands to the inductive eliminator for @racket[Bool]. This form is currently non-dependent---the branches do not know that @racket[test-expr] is equal to @racket[true] or @racket[false].

@examples[#:eval curnel-eval
          (if true false true)
	  (elim Bool (λ (x : Bool) Bool) () (false true) true)]
}

@defproc[(not [x Bool])
         Bool]{
Negates the boolean @racket[x].

@examples[#:eval curnel-eval
          (not true)
	  (not false)]
}

@defproc[(and [x Bool] [y Bool])
         Bool]{
The boolean @racket[and]. True if and only if @racket[x] and @racket[y] are both either @racket[true] or @racket[false].

@examples[#:eval curnel-eval
          (and true true)
	  (and false true)]
}

@defproc[(or [x Bool] [y Bool])
         Bool]{
The boolean @racket[or]. True if and only if either @racket[x] or @racket[y] is @racket[true].

@examples[#:eval curnel-eval
          (or true true)
	  (or false true)
	  (or false false)]
}
