Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. type 'a vector = { size: int; vec : 'a array; }
  2.  
  3. let get v i =
  4. if i < 0 || i >= v.size then failwith "Vector.get";
  5. Array.unsafe_get v.vec i
  6.  
  7.  
  8.  
  9. let get1 v i =
  10. match v with
  11. {size=l; vec=v1} ->
  12. if i < 0 || i >= l then failwith "Vector.get"
  13. else Array.unsafe_get v1 i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement