kitfre/OCaml-Primes

The opam package is broken.

Opened this issue · 0 comments

This repo is mentioned as the upstream for the opam package called primes. However, for some reason I failed to see, the package available on opam (OCaml 4.06.1) is not at all in sync with this repo.

me@home:~$ opam update
me@home:~$ opam show primes
             package: primes
             version: 1.3.5
          repository: default
        upstream-url: https://github.com/KitFreddura/OCaml-Primes/archive/1.3.5.tar.gz
       upstream-kind: http
   upstream-checksum: 583f2e27c00a06465719ae84aa4f79f2
            homepage: https://github.com/KitFreddura/OCaml-Primes
         bug-reports: https://github.com/KitFreddura/OCaml-Primes/issues/new
            dev-repo: https://github.com/KitFreddura/OCaml-Primes.git
              author: Kit Freddura <kitfreddura@gmail.com>
             license: MIT License
             depends: ocamlfind & zarith & gen
   installed-version: 
  available-versions: 1.3.3, 1.3.5
         description: A small library for dealing with primes.

Primes is a library for finding and testing prime numbers in OCaml, see the .mli file for interface details. Please check out the git for issues, concerns, suggestions or if you wish to contribute!
me@home:~$ opam install primes

So I got version 1.3.5, although the latest version is 1.3.3 according to the opam file in this repo. The interface I got through opam is missing important bits:

utop # #show Primes ;;
module Primes :
  sig
    val big_primes : int -> Z.t list
    val primes : int -> int list
    val is_prime : int -> bool
    val prime_factors : int -> int list
  end

Functions big_is_prime and miller_rabin_test are missing (the first one is missing from the .mli file even in this repo).

Even worse, function is_prime is seriously flawed (but seemingly not because of a dummy implementation, because returning true still takes quite a long time):

utop # for n = 1 to 4_000 do assert (Primes.is_prime n) done ;;
- : unit = ()

So what’s going on?