Skip to content

[nit] GADTs: add #require directives for abstracting code listings#3680

Open
dijkstracula wants to merge 1 commit intorealworldocaml:masterfrom
dijkstracula:master
Open

[nit] GADTs: add #require directives for abstracting code listings#3680
dijkstracula wants to merge 1 commit intorealworldocaml:masterfrom
dijkstracula:master

Conversation

@dijkstracula
Copy link
Copy Markdown

In the GADT chapter, the sum_file_sizes code makes use of Sys_unix.ls_dir and Core_unix.lstat. However, those modules are unbound for readers who are following along in the REPL.

utop # Sys_unix.ls_dir;;
Error: Unbound module Sys_unix
utop # Core_unix.lstat;;
Error: Unbound module Core_unix
Hint: Did you mean Core__Pid?
utop #

This patch simply adds a code listing #requireing them, and removes the TODO indicating that there perhaps ought to be such a code listing.

utop # #require "core_unix";;
utop # #require "core_unix.sys_unix";;

utop # Core_unix.lstat;;
- : string -> Core_unix.stats = <fun>
utop # Sys_unix.ls_dir;;
- : string -> string list = <fun>

Thank you for an enjoyable book.

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

Successfully merging this pull request may close these issues.

1 participant