The preferred way to develop mapv and fold is using Nix
and direnv.
direnv allowOnce the development shell is active, the fold binary can either be built
using dune or Nix.
# build and run
dune build --profile release
./_build/install/default/bin/fold
# or
nix build .#fold
./result/bin/fold
# build and run in one go
dune exec --profile release fold
# or
nix run .#foldThe mapv library is available as a package that can be used as follow:
# Add mapv to inputs
inputs.mapv.url = "git+https://codeberg.org/debarchito/mapv";
# Using the overlay
overlays = [
inputs.mapv.overlays.default
];
# then
buildInputs = [
pkgs.ocamlPackages.mapv
]
# or, inline it directly
buildInputs = [
inputs.mapv.packages.${system}.mapv
# ^ don't forget to make sure "system" is defined!
];NOTE: We do not use opam. Instead, add the required dependencies to dune-project and invoke
dune build. This will fail the first time but prepare mapv.opam and/or fold.opam accordingly. Now, to install the dependencies, invokedirenv reloadand they'll be made available for all subsequentdune buildandnix build/nix runinvocations.
nix fmt
# or
nix run .#fmt
# or
fd -e ml -e mli --exclude _build | xargs ocamlformat --inplacemapv is licensed under GNU LGPLv3 only while fold is
licensed under GNU GPLv3 only.