Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. signature print_position =
  2. sig
  3.     type position
  4.     val print = position -> ()
  5. end
  6.  
  7. datatype position2D =
  8.     Position2D of real * real;
  9.  
  10. datatype position3D =
  11.     Position3D of real * real * real;
  12.  
  13. structure Pos2D : print_position =
  14. struct
  15.     type position = position2D
  16.     val print pos = print("Position2D[" ^ Real.toString(#1 pos) ^ "," ^ Real.toString(#2 pos) ^ "]\n");
  17. end
  18.  
  19. structure Pos3D : print_position =
  20. struct
  21.     type position = position3D
  22.     val print pos = print("Position3D[" ^ Real.toString(#1 pos) ^ "," ^ Real.toString(#2 pos) ^ "," ^ Real.toString(#3 pos) ^ "]\n");
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement