{"size": 1420, "ext": "scrbl", "max_stars_repo_path": "algebraic/scribblings/algebraic-racket.scrbl", "max_stars_repo_name": "aqui18/racket-algebraic", "max_stars_repo_stars_event_min_datetime": "2019-03-01T17:40:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-18T10:19:13.000Z", "max_issues_repo_path": "algebraic/scribblings/algebraic-racket.scrbl", "max_issues_repo_name": "aqui18/racket-algebraic", "max_issues_repo_issues_event_min_datetime": "2018-08-07T18:39:35.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-20T00:37:39.000Z", "max_forks_repo_path": "algebraic/scribblings/algebraic-racket.scrbl", "max_forks_repo_name": "aqui18/racket-algebraic", "max_forks_repo_forks_event_min_datetime": "2019-03-31T22:50:06.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-24T00:27:29.000Z"}
{"max_stars_count": 75, "max_issues_count": 91, "max_forks_count": 6, "avg_line_length": 38.3783783784, "max_line_length": 80, "alphanum_fraction": 0.6971830986}
#lang scribble/manual

@title[#:tag "ref"]{Algebraic Racket}

@require{./algebraic-includes.rkt}

@; #############################################################################

@defmodulelang[algebraic/racket/base]

Algebraic Racket is an extension for @hash-lang[racket/base] that provides
free-form, lexically scoped @seclink["ref:data"]{algebraic data structures}
along with several forms for creating @seclink["ref:fun"]{functions} and
@seclink["ref:mac"]{macros} with a uniform and compact destructuring syntax.

It streamlines the functional Racket programming experience in two key areas:

@subsubsub*section{Consistent Syntax}

The destructuring syntax for algebraic data and most other data is the same
for all @tech{function} and @tech{macro} forms.

@subsubsub*section{Transparent, Lexically Scoped Data}

Algebraic data constructors are like type tags. When applied to an argument
list, they produce an @tech[#:key "product instance"]{instance}---a list of
unnamed fields with the constructor at its head. They are easy to print and
easy to parse, just like @rtech{prefab} structs, except algebraic data is
lexically scoped and has a natural ordering.

@; #############################################################################

@include-section{./algebraic-data.scrbl}
@include-section{./algebraic-function.scrbl}
@include-section{./algebraic-macro.scrbl}
@include-section{./algebraic-forms.scrbl}
