DEV Community

Discussion on: Actually, callbacks are fine

Collapse
 
joelnet profile image
JavaScript Joel

Very interesting. A few things I like...

I like how verifyUser has now become Lazy.

I love the M[">>="] function. First time I have seen an object used like this.

Without Promises, you have eliminated a round trip to the event loop (for sync functions).

I had a hard time finding the @masaeedu/mdo package. I did find @masaeedu/do though. Typo? Could you throw me a link?

Cheers!

Collapse
 
masaeedu profile image
Asad Saeeduddin

Hi @joelnet . Yeah, sorry. That's a typo on my part. The repo is here: github.com/masaeedu/do. There's no README yet, sadly, but here is a slightly more fleshed our runkit with usage examples for various monads: runkit.com/masaeedu/do-notation

Collapse
 
joelnet profile image
JavaScript Joel

Awesome thanks. There's some magic in that lib that I'm gonna have to play with to fully understand. I didn't know it was possible to do something like this:

({ x, y }) => [
    [x, () => [1, 2]]
]

Those proxies are some interesting things.

I recently did something related with the W Combinator. I also need to improve the docs :( But I like how your implementation allows you to assign values.