Permalink
Browse files

[enhance] stdlib: added succ and pred to the Int module

  • Loading branch information...
1 parent de2f6b7 commit 5a3ed844e365e8d1341dd0782e5eb58d220a4ac6 @Aqua-Ye Aqua-Ye committed Sep 21, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/stdlib/core/number.opa
View
@@ -1,5 +1,5 @@
/*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -96,6 +96,16 @@ Int = {{
`*` = %% BslPervasives.int_mul %%
`/` = %% BslPervasives.int_div %%
+ /**
+ * Add 1 to the int given in parameter
+ */
+ succ(i) = i+1
+
+ /**
+ * Subtract 1 to the int given in parameter
+ */
+ pred(i) = i-1
+
/**
* Check equality of two int
*/

0 comments on commit 5a3ed84

Please sign in to comment.