Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jezza/type_pipe
Curry types
https://github.com/jezza/type_pipe
Last synced: 7 days ago
JSON representation
Curry types
- Host: GitHub
- URL: https://github.com/jezza/type_pipe
- Owner: Jezza
- License: mit
- Created: 2024-10-22T10:52:54.000Z (16 days ago)
- Default Branch: master
- Last Pushed: 2024-10-22T11:05:22.000Z (16 days ago)
- Last Synced: 2024-10-23T10:13:31.096Z (16 days ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypePipe!
### Ever wanted the ability to curry type signatures?
Then wait no longer!
With this crate, you can do things like:```rust
type_pipe! [
T,
MyType<_>,
MyWrapper<_>,
]
```
and this produces:
```rust
MyWrapper>,
```There's three main macros:
`type_pipe`: This replaces all `_` with the resulting type from the previous line.
This is the example I demonstrated above.
Another example:
* `T, Wrapped<_, String>, Outer` -> `Outer>``type_pipe_pre`: This inserts the resulting type from the previous line into the first position.
* `T, Wrapped, Outer` -> `Outer, String>`
* `T, Wrapped, Outer` -> `Outer, String>``type_pipe_post`: This inserts the resulting type from the previous line into the last position.
* `T, Wrapped, Outer` -> `Outer>`