10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 12:56:14 +01:00
quantum_package/ocaml/Id.ml
Yann Garniron 9bb0c90a40 merged
2016-01-25 16:11:26 +01:00

34 lines
515 B
OCaml

open Core.Std
module Id : sig
type t
val of_int : int -> t
val to_int : t -> int
val of_string : string -> t
val to_string : t -> string
val increment : t -> t
val decrement : t -> t
end
= struct
type t = int
let of_int x =
assert (x>0); x
let to_int x = x
let of_string x =
Int.of_string x
|> of_int
let to_string x =
Int.to_string x
let increment x = x + 1
let decrement x = x - 1
end
module Task = struct
include Id
end
module Client = struct
include Id
end