Add doc/note/effects.md

This commit is contained in:
Nigel Tao committed 2019-12-06 17:36:47 +11:00
1 parent 688e947016
commit 39d7ced75f
2 files changed
+35 -8

No files matched your search

+3 -8
View File
@@ -16,14 +16,9 @@ but they're not the only way. Wuffs does not use them.
#### Effect
An extension of the type system, applied to functions. Wuffs has three effect
categories: pure, impure and coroutine. Pure means that the function has no
side effects - it does not change any observable state. The other two
categories may have side effects, with [coroutines](/doc/note/coroutines.md)
also being able to suspend and resume.
Impure functions are marked with a `!` at their definition and at call sites.
Coroutines are similarly marked, with a `?`. Pure functions have no mark.
An extension of the type system, such as purity (freedom from side effects),
applied to functions. See the [effects](/doc/note/effects.md) note for more
details.
#### Fact