aboutsummaryrefslogtreecommitdiff
path: root/date.mli
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2017-11-07 15:44:40 +0100
committerSébastien Dailly <sebastien@chimrod.com>2017-11-08 14:05:56 +0100
commit6f6ff0e39eb6d771ef5336394079646ccdc18bd5 (patch)
treef06907f88972e8e87c5924de8eb225362a4a775b /date.mli
parent50c16c8fc79d349f9db9d7975d1ae4e57050b648 (diff)
Use Zarith instead of Num for computing numbers
Diffstat (limited to 'date.mli')
-rwxr-xr-xdate.mli38
1 files changed, 38 insertions, 0 deletions
diff --git a/date.mli b/date.mli
new file mode 100755
index 0000000..dd24124
--- /dev/null
+++ b/date.mli
@@ -0,0 +1,38 @@
+module type CALCULABLE = sig
+
+ type t
+
+ val add: t -> t -> t
+
+ val sub: t -> t -> t
+
+ val mult: t -> t -> t
+
+ val div: t -> t -> t
+
+ val floor: t -> t
+
+ val of_int: int -> t
+
+ val to_int: t -> int
+
+ val to_float: t -> float
+
+end
+
+module Make(C:CALCULABLE): sig
+
+ (** Create a date from a year month day *)
+ val get_julian_day : int -> int -> int -> C.t
+
+ (** Return the year, month and day from a date *)
+ val date_from_julian_day : C.t -> int * int * int
+
+ val time_from_julian_day : C.t -> int * int * C.t
+
+ val from_string: string -> C.t
+
+ (** Print out the date *)
+ val to_string: C.t -> string
+
+end