SHARE
TWEET

Untitled

tinyevil Nov 14th, 2018 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template[F]
  2. function sin(x:F): F;
  3.  
  4. template[F]
  5. function cos(x:F): F;
  6.  
  7. template[F]
  8. function sincos(x:F): Pair[F,F]
  9. where sin[F], cos[F]
  10. {
  11.     return {sin(x), cos(x)};
  12. }
  13.  
  14. instance sin[double](x:double):double{
  15.     // ...
  16. }
  17.  
  18. instance cos[double](x:double):double{
  19.     // ...
  20. }
  21.  
  22. function main():int{
  23.     // looks up sin[double] and cos[double]
  24.     let sc = sincos(1.0);
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top