polarity/std
2025-12-09 15:56:25 +01:00
..
codata Add Infix declarations for custom operators (#509) 2025-04-14 20:22:12 +01:00
data Replace Nat literals with I64 literals (#613) 2025-12-09 15:56:25 +01: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.