{"size": 1390, "ext": "scrbl", "max_stars_repo_path": "docs/written/lang/brands.scrbl", "max_stars_repo_name": "jpolitz/pyret-lang", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "docs/written/lang/brands.scrbl", "max_issues_repo_name": "jpolitz/pyret-lang", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "docs/written/lang/brands.scrbl", "max_forks_repo_name": "jpolitz/pyret-lang", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.2727272727, "max_line_length": 88, "alphanum_fraction": 0.5374100719}
#lang scribble/base
@(require "../../scribble-api.rkt" "../abbrevs.rkt")

@(append-gen-docs
  `(module "brands"
    (path "src/js/base/runtime-anf.js")
    (data-spec
      (name "Brand")
      (type-vars (a-id "a"))
      (variants ("brander"))
      (shared
        ((method-spec
          (name "brand")
          (arity 2)
          (params [list: leaf("b")])
          (args ("self" "arg"))
          (return (a-id "a"))
        )
        (method-spec
          (name "test")
          (arity 2)
          (params [list: leaf("a")])
          (args ("self" "arg"))
          (return (a-id "Boolean" (xref "<global>" "Boolean")))
        ))))
    (fun-spec
      (name "brander")
      (arity 0)
      (args ())
      (return (a-app (a-id "Brand" (xref "brands" "Brand")) "a"))
      (doc ""))
        ))

@(define BR (a-id (a-id "Brand" (xref "<global>" "Brand"))))

@docmodule["brands" #:friendly-title "Brands"]{

Brands are a mostly internal language concept, useful for implementing custom datatypes.

@type-spec["Brand" (list "a")]

@function["brander" #:contract (a-arrow (a-app BR (list "a")))]

Creates a new brand.

@method-doc["Brand" "brander" "brand" #:alt-docstrings "" #:contract (a-arrow BR A "a")]

Produce a copy of the value with this brand.

@method-doc["Brand" "brander" "test" #:alt-docstrings "" #:contract (a-arrow BR A B)]

Test if the value has this brand.

}
