Monads, Do style
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Hijacks do expressions with bitwise left shift (<<) to implement the for/yield syntax we all know and ❤️ from scala.

If you don't like using the tasiest syntax sugar available, then stay away!

However, if you like feeling alive and the taste of the kool-aid they're handing out in fp land, then look no further!

You can turn:

getFoo("/api/foo").chain(foo => {
  return getBar("/api/bar").chain(bar => {
    const lol =;
    return getBaz("/api/baz/" + lol).map(baz => {
      return foo + bar + baz;


do {
  foo << getFoo("/api/foo")
  bar << getBar("/api/bar")
  const lol =;
  baz << getBaz("/api/baz/" + lol)

  foo + bar + baz;


  1. Top expression must be a 'bind' expression, i.e. x << y
  2. Last line must be a plain expression (not a bind expression)
  3. Coworkers will loathe you when you try to explain monads to them.