Skip to content

Instantly share code, notes, and snippets.

View tatsuya6502's full-sized avatar

Tatsuya Kawano tatsuya6502

  • Shanghai, China
  • 06:23 (UTC +08:00)
View GitHub Profile
@tatsuya6502
tatsuya6502 / hkt.rs
Created May 31, 2017 15:44 — forked from 14427/hkt.rs
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {