Questions tagged [utop]

utop (Universal toplevel) is an improved toplevel (REPL) for OCaml. Not to be confused with [tag:ocaml-toplevel] which ships with the OCaml compiler.

utop is an improved toplevel for . It can run in a terminal or in . It supports line editing, history, real-time and context sensitive completion, colors, and more.

Useful resources

93 questions
0
votes
1 answer

Can't run utop in the terminal

I have to start learning OCaml language. In order to practice it at home we have to install some devices following the tutorial made by our University. Since we use Debian at school, it's a bit different when I have to use windows at home and here…
Rokhy
  • 1
0
votes
2 answers

Can't run utop after installation

I've just installed utop on openSUSE but when i type utop in terminal i have If 'utop' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf utop Typing eval 'opam config env' gives me…
Jadw1
  • 139
  • 1
  • 2
  • 3
0
votes
0 answers

Problems with installing utop for OCaml

I can't install utop because it requires lambda-term, but it seems like I can't install lambda-term because of some conflict.
Jennifer Zhou
  • 323
  • 1
  • 7
  • 20
0
votes
1 answer

How to build a custom utop-based toplevel with ocamlbuild?

I want to create a utop-based toplevel for my project, which is built by ocamlbuild. However, ocamlbuild supports only mktoplevel, built from *.mltop. It doesn't mention utop anywhere in the docs. Also, the utop manual explains just toplevel…
vog
  • 23,517
  • 11
  • 59
  • 75
0
votes
1 answer

I can't access the OCaml [open Core.std] library despite downloading it from Github

I'm learning OCaml with the textbook "Real World OCaml." I'm running into a continuous problem though: I can't seem to access Jane Street's OCaml standard library package. I went to Jane Street's Github page and downloaded the core package from…
Sean
  • 2,890
  • 8
  • 36
  • 78
0
votes
1 answer

Trying to install utop for OCaml in Fedora 26; got an error about installing LWT

I currently have Fedora 26 installed, and I have installed the following packages: sudo dnf install opam ocaml gcc gcc-c++ m4 make ocamldoc sqlite-devel libcurl-devel fuse-devel zlib-devel ocaml-camlp4-devel redhat-rpm-config This is the error I…
zeldangit
  • 45
  • 4
0
votes
1 answer

How can I build a version of utop that uses the native toplevel ocamlnat?

ocamlnat is distributed with the compiler but not built by default. I can only start it by typing make natruntop in the ocaml compiler build directory. How can I make this into a fully functional native utop?
user3240588
  • 1,252
  • 9
  • 16
0
votes
1 answer

Error trying to `#require "ctypes.foreign";;` in utop on Windows (Cygwin)

I managed to install and run OCaml + OPAM + utop on Windows (in Cygwin) thanks to the awesome guide by Jonathan Protzenko. In utop, I especially want to be able to use ctypes + ctypes.foreign to quickly experiment and prototype accessing various…
akavel
  • 4,789
  • 1
  • 35
  • 66
0
votes
2 answers

Embed top-level directive in ml files

I might be thinking about the top-level the wrong way. What is the preferred way to maintain a collection of top-level directives as part of a project? Is there a way to include top-level directives like #install_printer in an OCaml source file so…
Greg Nisbet
  • 6,710
  • 3
  • 25
  • 65
0
votes
1 answer

Integrate utop with emacs using tuareg (OCaml) on Mac OS

I'm trying to learn OCaml, and install the environment. I'm using: https://github.com/realworldocaml/book/wiki/Installation-Instructions I'm literally on the last step [Editors, Emacs] and can't get tuareg working. I downloaded the .tar file, and…
0
votes
2 answers

Pattern matching in utop is more strict?

For example, there is a function that testing if a list is monotonically increasing, the source code and testing cases is: open Printf let rec mon_inc (numbers : int list) : bool = match numbers with | [] -> true | _ :: [] -> true |…
alwaysday1
  • 1,683
  • 5
  • 20
  • 36
0
votes
1 answer

Error: Unbound module Core when attempting to open Core module with utop from command line

I am trying to follow along with Real World OCaml by setting up opam, utop, and the Core modules as well. I've followed these directions with some success. In particular, when I run utop without specifying the file to load, I can load Core with no…
pseudoramble
  • 2,541
  • 22
  • 28
0
votes
1 answer

OCaml : Simple function with conditionals doesn't work

I am new to OCaml and I am just in process of learning it. I am trying to execute a simple function that calculates (a+b)^2 or (a-b)^2 based on the values of a and b I am trying to have a function that is as below let a_squared_b a b = if(a<0 ||…
g0c00l.g33k
  • 2,458
  • 2
  • 31
  • 41
0
votes
1 answer

(wrong-type-argument arrayp nil) on starting emacs

Emacs 24 and Mac OSX Mavericks, and my emacs file is as follows: (setq debug-on-error t) ;; -- common-lisp compatibility if not added earlier in your .emacs (require 'cl) ;; -- Tuareg mode ----------------------------------------- ;; Add Tuareg to…
0
votes
1 answer

OCaml recursively print to the toplevel

I have written some code in OCaml which performs actions similar to the following let rec main() = DO STUFF... let print_time() = let time = Unix.localtime (Unix.time()) in let hour = string_of_int…
Thomas
  • 347
  • 3
  • 19