polarity/std
David Binder c786a6704f
Add Infix declarations for custom operators (#509)
* Add CST and parsing for infix declarations

* Add infix declarations to symbol table

* Add Infix decls to ast

* Make testsuite run through again

* Implement infix declarations

* Validate binding structure of infix decls

* Generate docs

* Add testcases

* Make tests run through again

* Add checking of infix declarations

* Add testcases

* Check that RHS is defined

* Fix clippy hints

* Add hover information

* Add infix to syntax of web editor

---------

Co-authored-by: Tim Süberkrüb <dev@timsueberkrueb.io>
2025-04-14 20:22:12 +01: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
README.md Add initial stdlib (#336) 2024-11-06 11:53:08 +01: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

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.