Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. /* @flow */
  2.  
  3. //type Id<T> = (t: T) => T;
  4. //var id: Id<string> = function() {}
  5.  
  6. type IdObj = {
  7. id<T>(t: T): T;
  8. }
  9.  
  10. var ex1: IdObj = {
  11. id: function<T>() {}
  12. };
  13.  
  14. var ex3: IdObj = {
  15. id: function<T>(t):string {
  16. return t;
  17. }
  18. };
  19.  
  20. var a = ex3.id(7);
  21. a;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement