{"size": 2251, "ext": "scrbl", "max_stars_repo_path": "alexis-util/alexis/scribblings/alexis-util-extras.scrbl", "max_stars_repo_name": "lexi-lambda/racket-alexis", "max_stars_repo_stars_event_min_datetime": "2015-07-09T19:27:40.000Z", "max_stars_repo_stars_event_max_datetime": "2015-07-09T19:27:40.000Z", "max_issues_repo_path": "alexis-util/alexis/scribblings/alexis-util-extras.scrbl", "max_issues_repo_name": "lexi-lambda/racket-alexis", "max_issues_repo_issues_event_min_datetime": "2015-07-05T17:31:57.000Z", "max_issues_repo_issues_event_max_datetime": "2017-08-10T22:26:27.000Z", "max_forks_repo_path": "alexis-util/alexis/scribblings/alexis-util-extras.scrbl", "max_forks_repo_name": "lexi-lambda/racket-alexis", "max_forks_repo_forks_event_min_datetime": "2015-07-09T17:19:32.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-06T06:04:37.000Z"}
{"max_stars_count": 1, "max_issues_count": 11, "max_forks_count": 4, "avg_line_length": 29.2337662338, "max_line_length": 102, "alphanum_fraction": 0.6197245669}
#lang scribble/manual

@(require (for-label racket/base
                     racket/list
                     racket/function
                     racket/contract
                     racket/match
                     racket/math
                     (only-in typed/racket/base
                              Any Boolean)
                     alexis/bool
                     alexis/util/abbreviations
                     alexis/util/match
                     threading
                     match-plus)
          scribble/eval)

@title{Extra Utilities}

@section{The @code{true?} Predicate}

@defmodule*[(alexis/bool
             typed/alexis/bool)]

@defproc*[([(true? [v any/c]) boolean?]
           [(true? [v Any]) Boolean])]{
Equivalent to @racket[(if v #t #f)]. Useful for casting values to booleans.}

@section{Pattern Matching in Simple Functions}

@defmodule[alexis/util/match]

@deprecated[@racketmodname[match-plus]]{
  This module re-exports @racket[define/match*] from @racketmodname[match-plus] for
  backwards-compatibility.}

@section{Abbreviation Macros}

@defmodule[alexis/util/abbreviations]

This module provides various simple abbreviations to make writing Racket code clearer and easier.
These forms should work in both Racket and Typed Racket.

@defform[(loop-forever body)]{
Equivalent to:
@(racketblock
  (let loop ()
    body
    (loop)))}

@defform[(async body)]{
Equivalent to:
@(racketblock
  (thread (thunk body)))}

@defform[(async-loop body)]{
Equivalent to:
@(racketblock
  (thread (thunk (loop-forever body))))}

@defform[(with-semaphore semaphore-expr body)]{
Equivalent to:
@(racketblock
  (call-with-semaphore semaphore-expr
    (thunk body)))}

@section{Threading Macros}

@defmodule[alexis/util/threading]

@deprecated[@racketmodname[threading]]{
 This module re-exports @racket[~>], @racket[~>>], @racket[and~>], @racket[and~>>], @racket[lambda~>],
 @racket[λ~>], @racket[lambda~>*], @racket[λ~>*], @racket[lambda~>>], @racket[λ~>>],
 @racket[lambda~>>*], @racket[λ~>>*], @racket[lambda-and~>], @racket[λ-and~>], @racket[lambda-and~>*],
 @racket[λ-and~>*], @racket[lambda-and~>>], @racket[λ-and~>>], @racket[lambda-and~>>*], and
 @racket[λ-and~>>*] from @racketmodname[threading] for backwards-compatibility.}
