Skip to content

Commit

Permalink
docs: Mention prelude in core spec
Browse files Browse the repository at this point in the history
Closes #737
  • Loading branch information
ss2165 committed Jan 9, 2024
1 parent 87933ab commit 9b0a46b
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions specification/hugr.md
Original file line number Diff line number Diff line change
@@ -1555,8 +1555,29 @@ implementation of this design document is available on GitHub.

## Standard Library

`panic`: panics unconditionally; no inputs, any type of outputs (these
are never produced)
A collection of extensions form the "standard library" for HUGR, and are defined
in this repository.

### Prelude

The prelude extension is assumed to be valid and available in all contexts, and
so must be supported by all third-party tooling.

#### Types

`usize`: a positive integer size type.

`array<N, T>`: a known-size (N) array of type T.

`qubit`: a linear (non-copyable) qubit type.

`error`: error type. See [`ErrorType`](#errortype).

### Operations
| Name | Inputs | Outputs | Meaning |
|--------------------------------|-----------|----------------------------|-----------------------------------------------------------------|
| `new_array<N, T>` | `T` x N | `array<N, T>` | Create an array from all the inputs |
| `panic` | ErrorType | - | Immediately end execution and pass contents of error to context |

### Logic Extension

0 comments on commit 9b0a46b

Please sign in to comment.