@@ -203,7 +203,7 @@ pub fun test-with1()
203203```
204204
205205The ` with ` statement essentially puts all statements that follow it into
206- an anynomous function block and passes that as the last parameter. In general:
206+ an anonymous function block and passes that as the last parameter. In general:
207207
208208~ translate
209209``` unchecked
@@ -493,7 +493,7 @@ Hover over `square6` to see the inferred effect for `:_e`.
493493The inferred effects are not just considered as some extra type information on
494494functions. On the contrary, through the inference of effects, &koka; has a very
495495strong connection to its denotational semantics. In particular, _ the full type
496- of a &koka; functions corresponds directly to the type signature of the
496+ of a &koka; function corresponds directly to the type signature of the
497497mathematical function that describes its denotational semantics_ . For example,
498498using 〚 ; ` :t ` 〛 ; to translate a type ` :t ` into its corresponding
499499mathematical type signature, we have:
@@ -906,7 +906,7 @@ value struct argb{ alpha: int; color-red: int; color-green: int; color-blue: int
906906To support generic polymorphism, sometimes value types are _ boxed_ . For example, a list
907907is polymorphic in its elements. That means that if we construct a list of tuples, like
908908` [(1,True)] ` , that the element ` (1,2) ` will be boxed and heap allocated -- essentially
909- the compiler transforms this expression into ` [Box((1,True)] ` internally.
909+ the compiler transforms this expression into ` [Box((1,True)) ] ` internally.
910910
911911Note that for regular data types and ` :int ` 's boxing is free (as in isomorphic). Moreover, value types
912912up to 63 bits (on a 64-bit platform) are boxed in-place and do not require heap allocation
@@ -1242,7 +1242,7 @@ For example, the type of `pretty` becomes:
12421242``` unchecked
12431243fun pretty( d : doc ) : width string
12441244```
1245- as is requires the ` :width ` effect to be handled (aka,
1245+ as it requires the ` :width ` effect to be handled (aka,
12461246the "dynamic binding for ` width : int ` to be defined",
12471247aka, the "` :width ` capability").
12481248
@@ -1327,7 +1327,7 @@ This is a total handler and only discharges the `:emit` effect.
13271327{.learn}
13281328
13291329As another example, consider a generic ` catch ` handler that
1330- applies an handling function when ` :raise ` is called on our
1330+ applies a handling function when ` :raise ` is called on our
13311331exception example:
13321332
13331333```
@@ -1349,7 +1349,7 @@ fun catch-example()
13491349The ` catch ` handler has an interesting type where the action can
13501350have a ` :raise ` effect (` : () -> <raise|e> a ` ) and maybe further effects ` :e ` ,
13511351while the handling function ` hnd ` only has effect ` :e ` . Now consider
1352- supplying a handing function that itself calls ` raise ` : in that case, the
1352+ supplying a handling function that itself calls ` raise ` : in that case, the
13531353type of ` catch ` would be instantiated to: ` : (hnd: (string) -> <raise> a, action : () -> <raise, raise> a ) : <raise> a ` .
13541354This is correct: the (outer) ` :raise ` effect of ` action ` is handled and discharged, but since
13551355the handling function ` hnd ` can still cause ` raise ` to be called, the final effect still contains ` :raise ` .
@@ -1396,7 +1396,7 @@ fun div42()
13961396
13971397#### A State Effect { #sec-state; }
13981398
1399- For more examples of the use of ` return ` operations, we look at a the state effect.
1399+ For more examples of the use of ` return ` operations, we look at the state effect.
14001400In its most general form it has just a ` set ` and ` get ` operation:
14011401
14021402```
@@ -1490,7 +1490,7 @@ with regard to other approaches:
14901490 of this is the continuation monad (which can express `` call/cc `` ).
14911491
14921492The &koka; compiler internally uses monads and ` shift ` /` reset ` to compile effect handlers though, and
1493- it compiles handlers into to an internal free monad based on multi-prompt delimited control [ @Xie : evp ;@Gunter : mprompt ] .
1493+ it compiles handlers into an internal free monad based on multi-prompt delimited control [ @Xie : evp ;@Gunter : mprompt ] .
14941494By inlining the monadic _ bind_ we are able to generate efficient C code that only allocates continuations
14951495in the case one is actually yielding up to a general ` ctl ` operation.
14961496~
0 commit comments