How to explicitely use the stdlib's list module when working inside a module also called list?

I’m in there:

and currently it does not compile:

(cd _build/default && /home/berenger/.opam/default/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.onelist.objs -no-alias-deps -open Onelist -o src/.onelist.objs/onelist__List.cmo -c -impl src/list.ml)
File "src/list.ml", line 58, characters 8-16:
Error: The module List is an alias for module Onelist__List, which is missing

You could add a sub-library that just contains a module alias to the original List. Or, if you’re willing to use labeled arguments, you could use ListLabels instead?

1 Like

Ok, using ListLabels instead is a neat trick.

Once 4.07 is released, it will be possible to use Stdlib.List.

5 Likes