Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #![feature(generic_associated_types)]
  2.  
  3. trait Is<T> where T: ?Sized {}
  4.  
  5. impl<T> Is<T> for T {}
  6.  
  7. trait FMapFamily {
  8. type Sub<H>: FMap<Holding=H>;
  9. fn fmap_sub<H, F, I>(subord: Self::Sub<H>, map: F) -> Self::Sub<I> where
  10. F: FnOnce(H) -> I;
  11. }
  12.  
  13. trait FMap {
  14. type Holding;
  15. type Parent: FMapFamily where <<Self as FMap>::Parent as FMapFamily>::Sub<Self::Holding>: Is<Self>;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement