Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template[F]
- function sin(x:F): F;
- template[F]
- function cos(x:F): F;
- template[F]
- function sincos(x:F): Pair[F,F]
- where sin[F], cos[F]
- {
- return {sin(x), cos(x)};
- }
- instance sin[double](x:double):double{
- // ...
- }
- instance cos[double](x:double):double{
- // ...
- }
- function main():int{
- // looks up sin[double] and cos[double]
- let sc = sincos(1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement