Skip to content

Commit

Permalink
Merge pull request #728 from emberian/patch-1
Browse files Browse the repository at this point in the history
codebase overview: typo + formatting issue
  • Loading branch information
barriebyron authored Nov 16, 2023
2 parents 418c356 + 7bd971b commit 97e5a8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/node-developers/codebase-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ Now we an use these primitives to reimplement the imperative example above as fo
fun x -> if x mod 2 = 0 then Some x else None
let example x = x >>| add_one >>= bind_even;
```

OCaml has a `ppx` that makes writing monads much easier to follow, using the let syntax.

```
let%bind x = y in
f x
Expand All @@ -142,7 +144,7 @@ Essentially, this syntax takes the value from the let statement and places it on

## Async

Under the hood, async uses Monads. However, ivars are the low-level async primitive. `a' Ivar.t` is essentially a mutex that can only be filled once. After the value from a computation returns, it then fills the ivar. The rest of the syntactic sugar takes the ivar and passes them through `Deferred` monads.
Under the hood, async uses Monads. However, ivars are the low-level async primitive. `'a Ivar.t` is essentially a mutex that can only be filled once. After the value from a computation returns, it then fills the ivar. The rest of the syntactic sugar takes the ivar and passes them through `Deferred` monads.

A `yield` function exists, but avoid using it since it has some weird behavior. Instead, operate on the wrapped values that happen in between `Deferred` bindings.

Expand Down

2 comments on commit 97e5a8e

@vercel
Copy link

@vercel vercel bot commented on 97e5a8e Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs2 – ./

docs2-minadocs.vercel.app
docs2-git-main-minadocs.vercel.app
docs.minaprotocol.com

@vercel
Copy link

@vercel vercel bot commented on 97e5a8e Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

07-oracles – ./examples/zkapps/07-oracles/oracle

07-oracles.vercel.app
07-oracles-git-main-minadocs.vercel.app
07-oracles-minadocs.vercel.app

Please sign in to comment.