Skip to content

Commit 929bd2b

Browse files
committed
Integrate review feedback into wit.md
1 parent 766a966 commit 929bd2b

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

  • component-model/src/design

component-model/src/design/wit.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ This is similar to Rust `Option`, C++ `std::optional`, or Haskell `Maybe`.
155155
`result<T, E>` for any types `T` and `E`
156156
may contain a value of type `T` _or_ a value of type `E`
157157
(but not both).
158-
This is typically used for "value or error" situations:
159-
for example, a HTTP request function might return a result,
158+
For example, a HTTP request function might return a result,
160159
with the success case (the `T` type) representing a HTTP response,
161160
and the error case (the `E` type) representing the various kinds of error that might occur:
162161

@@ -182,7 +181,8 @@ result<_, u32> // no data associated with the success case
182181
result // no data associated with either case
183182
```
184183

185-
The underscore `_` stands in "no data" and is generally represented as the unit type in a target language (e.g. `()` in rust, `null` in Javsacript).
184+
The underscore `_` stands in "no data" and is generally represented as
185+
the unit type in a target language (e.g. `()` in Rust, `null` in JavaScript).
186186

187187
### Tuples
188188

@@ -199,8 +199,7 @@ This is similar to tuples in Rust or OCaml.
199199

200200
## User-defined types
201201

202-
You can define your own types within an `interface` or `world`.
203-
WIT offers several ways of defining new types.
202+
New domain-specific types can be defined within an `interface` or `world`.
204203

205204
### Records
206205

@@ -271,8 +270,8 @@ For example, a WIT `enum` can translate directly to a C/C++ `enum`.
271270
### Resources
272271

273272
A resource is a handle to some entity that exists outside of the component.
274-
Resources describe entities that can't or shouldn't be copied; entities that should
275-
be passed by reference rather than by value.
273+
Resources describe entities that can't or shouldn't be copied:
274+
entities that should be passed by reference rather than by value.
276275
Components can pass resources to each other via a handle.
277276
They can pass ownership of resources, or pass non-owned references to resources.
278277

@@ -386,7 +385,7 @@ lookup: func(store: kv-store, key: string) -> option<string>;
386385
```
387386

388387
To express a function that returns multiple values,
389-
you can use any compound type ([tuples](#tuple), [record](#record), etc).
388+
you can use any compound type (such as [tuples](#tuple) or [records](#record)).
390389

391390
```wit
392391
get-customers-paged: func(cont: continuation-token) -> tuple<list<customer>, continuation-token>;

0 commit comments

Comments
 (0)