Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion design/high-level/UseCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ use cases that require additional features:
can encapsulate `i32` pointers to linear memory allocations that need to be
safely freed when the last handle goes away.
3. Developers import or export functions with signatures containing
concurrency-oriented types (e.g., async, future and stream) to address
concurrency-oriented types (e.g., future and stream) to address
concurrency use cases like non-blocking I/O, early return and streaming. Both
developers (the caller and callee) are able to use their respective languages'
native concurrency support, if it exists, using the concurrency-oriented types
Expand Down
9 changes: 3 additions & 6 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ keyword ::= 'use'
| 'static'
| 'interface'
| 'tuple'
| 'async'
| 'future'
| 'stream'
```
Expand Down Expand Up @@ -336,19 +335,17 @@ union-cases ::= ty,
## Item: `func`

Functions can also be defined in a `wit` document. Functions have a name,
parameters, and results. Functions can optionally also be declared as `async`
functions.
parameters, and results.

```wit
thunk: func() -> ()
fibonacci: func(n: u32) -> u32
sleep: async func(ms: u64) -> ()
```

Specifically functions have the structure:

```wit
func-item ::= id ':' 'async'? 'func' func-vec '->' func-vec
func-item ::= id ':' 'func' func-vec '->' func-vec

func-vec ::= ty
| '(' func-named-type-list ')'
Expand Down Expand Up @@ -377,7 +374,7 @@ resource file-descriptor
resource request {
static new: func() -> request

body: async func() -> list<u8>
body: func() -> future<list<u8>>
headers: func() -> list<string>
}
```
Expand Down