https://github.com/dpc/insideout
Wrap composed types inside-out (library for Rust)
https://github.com/dpc/insideout
Last synced: about 1 year ago
JSON representation
Wrap composed types inside-out (library for Rust)
- Host: GitHub
- URL: https://github.com/dpc/insideout
- Owner: dpc
- Created: 2017-11-19T22:06:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-31T18:01:25.000Z (about 7 years ago)
- Last Synced: 2025-03-29T05:48:20.830Z (about 1 year ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# insideout - Wrap composed types inside-out
Update: As of 1.33 a functionality like this is available in stdlib (at least for simple type). For iterators you can use `iterator.map(Result::transpose)` or `iterator.map(Option::transpose)` ([thread](https://internals.rust-lang.org/t/transpose-for-iterators/10321/2)).
Turn `Option>` into `, E>>` and the other way around.
Also for `Iterator`s and potentially other types.
Feel free to submit PR for other types where this operation makes sense.