Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with pretty-printing of lists in toplevel when opening List module #9337

Closed
tofgarion opened this issue Feb 26, 2020 · 1 comment
Closed

Comments

@tofgarion
Copy link

I am using OCaml 4.09.0 from OPAM and I have just noticed something peculiar using the toplevel.

When evaluating 1 :: 2 :: [], the list is pretty-printed as usual:

# 1 :: 2 :: 3 :: [] ;;
- : int list = [1; 2; 3]

If I open first the List module, then the printing is different:

# let open List in 1 :: 2 :: 3 :: [] ;;
- : int List.t = (::) (1, [2; 3])

The list is now typed with the type t used in the List module signature
and the list representation is different.

Florian Angeletti has just posted an explanation on caml-list (see https://inbox.ocaml.org/caml-list/87v9ntdpx4.fsf@port-garion.isae.fr/T/#m81832d8a041da3a1306426ecd78944e95d47fd54) and a PR with a solution, see #9336.

Best,

Christophe

@mshinwell
Copy link
Contributor

The discussion on #9336 can supercede this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants