Double tilda in dune file

What does a double tilda mean in a dune file?


(lang dune 2.8)
(name decathlon-stock)
(generate_opam_files true)

 (name decathlon-stock)
 (synopsis "Check Decathlon online stock availability")
 (maintainers "Thibault Suzanne <>")
 (authors "Thibault Suzanne <>")
 (homepage "")
 (bug_reports "")
  (core_kernel (>= ~~))
  (cmdliner (>= ~~))
  (async_smtp (>= ~~))
  (cohttp-lwt-unix (>= ~~))
  (cohttp-lwt (>= ~~))
  (lambdasoup (>= ~~))
  (fmt (>= ~~))
  (ppx_let (>= ~~))
  (yojson (>= ~~))


Thank you.

1 Like

As far as I know, the double tilde has no special meaning. Dune interprets it as a version “number” the same as any other & emits an .opam file to that effect.

Opam adopts Debian’s versioning policy, which uses ASCII-like lexical comparison with the modification that tilde characters sort before all other characters, including the empty string. (This has the convenience of making e.g. 1.0.0~alpha sort before 1.0.0.) In this light, the version number “~~” is just a particularly early version number – earlier even than "".

It was likely picked to mean “TODO: set lower bounds later”, but I can’t speak for the author :slight_smile:


That’s the correct answer. As far as I know dune forces me to be explicit about dependency versions, then when I’m too lazy to check them I’ll just write a constraint that is basically always fulfilled.

1 Like

Thank you @CraigFe @thizanne

So basically same as not have any dependency specified. Relying on the file doesnt add any information about dependency versions. Is that correct?

That’s correct, these lines don’t add any dep version information.

1 Like

You can omit dependency versions in dune-project, for example the following is accepted:

  (a (>= va))
  (c (>= vc))

and it will emit:

depends: [
  "a" { >= va }
  "c" { >= vc }
1 Like

Τhanks. I guess I didn’t try that syntax.

@emillon what does va and vc mean here?

Those are placeholders for version numbers. A more realistic example would be:

  (lwt (>= 3.2.1))
  (ocaml (>= 4.08))
1 Like