Skip to content

Commit

Permalink
expand readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdotink committed Dec 14, 2023
1 parent 70e812a commit 36bff3d
Showing 1 changed file with 76 additions and 1 deletion.
77 changes: 76 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,93 @@ At this time Zap has not been benchmarked, as it progresses through development
While buffers may only support a small number of types, zap has complex type support. Below is a list of all supported types:

- Booleans

```
type t = bool
```

- Numbers (all sizes)

```
type t = f32
type t = f64
type t = u8
type t = u16
type t = u32
type t = u64
type t = i8
type t = i16
type t = i32
type t = i64
```

Numbers can also have range contraints:

```
type Health = u8 (0..=100)
```

- Strings

```
type t = String
```

Strings can have a length range constraint:

```
type Username = String (3..20)
```

- Arrays

```
type t = u8[]
```

Arrays can have a length range constraint:

```
type t = u8[10..20]
```

- Maps

```
type t = { [string]: u8 }
```

- Structs
- Enums (string literal unions)

```
type Item = {
Name: string,
Price: u16,
}
```

- Enums

```
type t = { One, Two, Three }
```

- Optionals

```
type t = u8?
```

## Documentation

As Zap is still in early development, documentation is not yet available. Once Zap is more stable and has a more complete feature set documentation will be added.

## Contributing

Contributions are welcome! Please open an issue before you start working on a feature or bug fix so we can discuss it.

```
```

0 comments on commit 36bff3d

Please sign in to comment.