Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. datatype 'a num_dict
  2.   = NumD of {plus : 'a * 'a -> 'a, neg : 'a -> 'a}
  3.  
  4. fun sub (NumD {plus, neg}) (m, n) = plus (m, neg n)
  5.  
  6. val x = sub (NumD {plus=op+, neg=op ~}) (0, 1)
  7. val y = sub (NumD {plus=op+, neg=op ~}) (0.0, 1.0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement