Skip to content

Conversation

@rlycx
Copy link
Owner

@rlycx rlycx commented Sep 14, 2022

Introduces the io! macro, which allows users to compose IO effects more easily.

Some things are copied from Haskell verbatim, while other things have a touch more Rust to them. For example, whitespace is not significant in Rust, so everything must be semicolon-terminated (except for the last expression).

Future extensions could be to allow ? on functions that return std::io::Result in let-bindings to allow lifting imperative io functions into the monad in an ad-hoc fashion.

Resolves #4.

@rlycx rlycx force-pushed the io-macro branch 2 times, most recently from 057c2ed to 470c1ec Compare September 16, 2022 19:15
- Introduce `return x` to `pure(x)` transformation
- Make `do` mandatory when performing a side-effect
- Fix up a non-portable test
@rlycx rlycx marked this pull request as ready for review September 16, 2022 19:22
@rlycx rlycx requested a review from CalliEve September 19, 2022 12:30
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.

Do-notation macro

2 participants