Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic version of for-comprehensions #4

Merged
merged 1 commit into from
Apr 4, 2017

Conversation

linusnorton
Copy link
Contributor

This PR adds a basic implementation of Scala's for-comprehension.

It will only apply flatMap and map. Any filtering must be done manually.

Example usage can be seen in the tests but I would be happy to add documentation.

There is one limitation in that the type information is of the final result is lost and returned as Option<any>. In theory it should be Option<B> where B is the result type of the last function. Unfortunately it is not possible to get the type information of the last element of an array defined by a rest argument.

@shogogg shogogg merged commit a83c0ff into shogogg:master Apr 4, 2017
@linusnorton
Copy link
Contributor Author

@shogogg thanks for merging, let me know if you want me to update the docs

@shogogg
Copy link
Owner

shogogg commented Apr 4, 2017

@linusnorton Thanks to PR, and please give me the PR that update docs if you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants