Skip to content

Instantly share code, notes, and snippets.

//This trait is not used, but is useful for type equality constraints
trait ID {
type Out;
}
impl<T> ID for T {
type Out = T;
}
trait CanApply {
type Out: CanUnapply;
//This trait is not used, but is useful for type equality constraints
trait ID {
type Out;
}
impl<T> ID for T {
type Out = T;
}
trait CanApply {
type Out: CanUnapply;
@dylanede
dylanede / hkt.rs
Last active August 29, 2015 14:24 — forked from anonymous/playground.rs
trait Apply {
type Out;
}
trait Unapply {
type Out;
}
type Applied<F, T> = <(F, T) as Apply>::Out;
type Unapplied<T> = <T as Unapply>::Out;