Last active
August 29, 2015 14:05
-
-
Save aturon/e5813687e90be860d02c to your computer and use it in GitHub Desktop.
An updated HKT encoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait StarToStar<Input> { | |
type Output; | |
} | |
type Apply<Name, Elt> where Name: StarToStar<Elt> = Name::Output; | |
struct Vec_; | |
struct DList_; | |
impl<T> StarToStar<T> for Vec_ { | |
type Output = Vec<T>; | |
} | |
impl<T> StarToStar<T> for DList_ { | |
type Output = DList<T>; | |
} | |
trait Mappable | |
{ | |
type E; | |
type HKT where Apply<HKT, E> = Self; | |
fn map<F>(self, f: E -> F) -> Apply<HKT, F>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment