|
|
|
|
|
by lacampbell
2423 days ago
|
|
Haven't had a coffee yet so go easy on me - doesn't this solve your issue? interface Functor<A> {
map<B>(f: (a: A) => A): Functor<A>;
}
You map over an option, you get an option. You map over an either, you get an either. etc etc. |
|
So you end up with
where `Self` needs to recognize that the type being defined to implement this interface has a "slot". This tends to make things tough.