polarity/std
David Binder 19c82473ea
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 (#602)
* 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>
2025-11-20 15:21:04 +00:00
..
codata Add Infix declarations for custom operators (#509) 2025-04-14 20:22:12 +01:00
data Use trailing commas when pretty printing (#508) 2025-03-27 09:13:09 +00:00
prim Add Char, String, I64, F64 extern declarations (#602) 2025-11-20 15:21:04 +00:00
README.md Add Char, String, I64, F64 extern declarations (#602) 2025-11-20 15:21:04 +00:00

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.
  • data and codata declaration names are in CamelCase. 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.