Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jezza/type_pipe

Curry types
https://github.com/jezza/type_pipe

Last synced: 7 days ago
JSON representation

Curry types

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>`