edmundsmith / type-plugs

Emulating Higher-Kinded Types in Rust via Plug/Unplug. Also, Monads.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type Plugs - A Method for emulating Higher-Kinded Types in Rust

This is a small demonstration of a technique for emulating Higher-Kinded Types (HKTs)/Generalised Associated Types(GATs) through existing language features. Basically, you can emulate T::F<X> as being <T::F as Plug<X>>::result_t with the Plug trait, and you can destructure F<X> down to F<_>, A through the Unplug trait.

You can read more about how this works with the original post and the followup.

About

Emulating Higher-Kinded Types in Rust via Plug/Unplug. Also, Monads.

License:MIT License


Languages

Language:Rust 100.0%