2.0.0 • Published 7 years ago

loquat-qo v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

loquat-qo

Allow friendly syntax for loquat using generators , like do-notation in Haskell.

Before:

const parser = parserA.bind(x =>
    parserB.bind(y =>
        perserC.bind(z =>
            pure(something(x, y, z))
        )
    )
);

After:

const parser = qo(function* () {
    const x = yield parserA;
    const y = yield parserB;
    const z = yield parserC;
    return something(x, y, z);
});

See loquat repository for more information.

License

MIT License

Author

Susisu (GitHub, Twitter)