Structural-typing 2.0.5
Define types by giving descriptions (perhaps incomplete) of how they're built. "...by how they're built" means applying arbitrary predicates (especially ones about existence) to parts of structures. The top-level namespaces contain what you need to use the library, including simpler customizations. The .assist namespaces are useful for more in-depth customizations.
structural-typing.assist.lifting
Lifting is a core concept, though one only writers of fairly unusual custom predicates need worry about.
Public variables and functions:
structural-typing.assist.oopsie
The declaration of the core data structure: the oopsie. It is produced when a predicate is applied to a value and fails. Also utility functions.
Public variables and functions:
structural-typing.assist.predicate-defining
Helpers for defining custom predicates. See structural-typing.preds
for examples of use.
Public variables and functions:
structural-typing.assist.special-words
There are a number of symbols that have special meanings. They are aggregated here for convenience.
Public variables and functions:
structural-typing.assist.testutil
Useful shorthand for tests of new code, like custom predicates.
structural-typing.assist.type-repo
The TypeRepo
structure and its functions.
Public variables and functions:
structural-typing.global-type
If you want to mutate the state of a single global type repo, these functions support that.
Public variables and functions:
structural-typing.preds
A few predefined predicates, but also functions that take expected values and generate predicates.
Public variables and functions:
structural-typing.type
Structural types, loosely inspired by Elm’s way of looking at records.
Public variables and functions:
- <>all-built-like
- <>built-like
- ALL
- all-built-like
- built-like
- built-like?
- default-error-handler
- default-success-handler
- description
- each-of
- empty-type-repo
- ensure-standard-functions
- explain-with
- includes
- named
- not-nil
- origin
- paths-of
- RANGE
- reject-missing
- reject-nil
- replace-error-handler
- replace-success-handler
- required-path
- requires
- requires-mentioned-paths
- show-as
- through-each
- throwing-error-handler