mirror of
https://github.com/polarity-lang/polarity.git
synced 2025-12-23 09:19:50 +00:00
|
Some checks failed
Rust CI / package (push) Has been cancelled
Rust CI / Check line endings (push) Has been cancelled
Rust CI / Clippy (push) Has been cancelled
Codecov Coverage / coverage (push) Has been cancelled
Rust CI / Build with MSRV (push) Has been cancelled
Rust CI / Check (push) Has been cancelled
Rust CI / Tests (push) Has been cancelled
Rust CI / Rustfmt (push) Has been cancelled
Build and deploy web demo / deploy (push) Has been cancelled
Lint Code Base / Lint Code Base (push) Has been cancelled
Check nix code / Check nix code (push) Has been cancelled
* Add Char, String, I64, F64 extern declarations * Apply suggestions from code review Co-authored-by: Tim Süberkrüb <dev@timsueberkrueb.io> * Update definition of Char * Update README.md * Format std::prim * Bikeshed prim names * append is more useful than prepend --------- Co-authored-by: Tim Süberkrüb <dev@timsueberkrueb.io> |
||
|---|---|---|
| .. | ||
| codata | ||
| data | ||
| prim | ||
| README.md | ||
Standard Library
The Polarity Standard Library.
Overview
├── std The Polarity Standard Library
│ ├── codata A collection of commonly used codata types
│ ├── data A collection of commonly used data types
│ └── prim Primitive numeric and textual types provided by the system
Conventions
We follow the following naming conventions in the standard library:
- Polarity filenames and folder names are in
snake_case. Example:data/option.pol. dataandcodatadeclaration names are inCamelCase. Example:data Option.- Destructors and top-level let bindings are in
snake_case. Example:Fun.ap. - Constructors are in
CamelCase. Example:Some.
Where syntax and naming decisions are arbitrary, we loosely follow the Rust conventions.
All declarations use ASCII characters only. This is to ensure that there is always a unique natural language term to refer to any given declaration. It also ensures the standard library can easily be searched and indexed. There may be non-ASCII Unicode characters in shorthand notation, comments and documentation strings.