Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
-1 votes
1 answer
65 views

(I am learning the OCaml and this may be a naive question.) I use below code to define a named function a: utop # let a = fun x -> x+1;; val a : int -> int = <fun> Note that the leading ...
smwikipedia's user avatar
  • 65.1k
1 vote
1 answer
135 views

How can I disable the autocomplete suggestion bar in the utop OCaml toplevel?
Jack Humphries's user avatar
-1 votes
1 answer
343 views

When I start my utop interpreter and then say #quit;; I get the answer Error: unbound value quit The command #Topfind.reset();; doesn't recompile the ml-files, that I have changed I always need to ...
flori10's user avatar
  • 536
0 votes
2 answers
977 views

So basically I am trying to follow these instructions https://dev.realworldocaml.org/install.html I followed them literally. I have a working utop. I have a working VS Code environment. I can run code ...
v_head's user avatar
  • 825
0 votes
1 answer
234 views

(*redefining the power function for integers*) let rec ( ** ) v n = if n = 0 then 1 else v * (( ** ) v (n-1));; let rec sommation n = if n = 0 then 0 else -1**(n/3) * n**(2+ (-1)**n) + sommation (...
0 votes
1 answer
117 views

What is the namespace of the test0 definition in dune utop . environment, given the following ocaml code with dune build definition: ~/_ocaml_/n01$ cat bin/dune (executable (public_name n01) (name ...
0 votes
1 answer
164 views

I tried this in utop but since I am not familar with a dune project, it failed and report the error This expression has type int list but an expression was expected of type unit. This is for the ...
2 votes
3 answers
268 views

I downloaded and executed utop as guided here, and I ran the following code: Scanf.scanf "%d %d" (fun a b -> Printf.printf "%d\n" (a - b));; On the first time I input 3 1, it ...
1 vote
1 answer
83 views

I am trying to understand the following behaviour of OCaml Format module and semantic tags. My code: let prepare_ppf ppf = let original_stag_functions = Format.pp_get_formatter_stag_functions ppf () ...
Anentropic's user avatar
  • 34.2k
-1 votes
1 answer
405 views

In Haskell we can enter multi-line code at the terminal, by enclosing it between " :{ " and " :} ". For example, typing > :{ main = do > print("Hello") :} in ghci, ...
user65526's user avatar
  • 705
0 votes
0 answers
211 views

In Haskell we can search for the type of an expression, such as "+" by entering :t + at the terminal. In utop, how can we determine the type of an expression such as "+"? I have ...
user65526's user avatar
  • 705
2 votes
1 answer
722 views

How can I use ppx derive (https://github.com/ocaml-ppx/ppx_deriving) in my utop? For example, I have to following code: module A = struct module T = struct type t = int [@@deriving hash, sexp, ...
0 votes
1 answer
813 views

As a newbie in functional programming (OCaml), I stuck with that problem. I came up with a code shown below: let rec height tr = match tr with | Node(d,[]) -> 1 | Node(d,[t1]) -> 1 + height ...
0 votes
1 answer
706 views

I am used to using the standard function print_int in OCaml, but when I open the library Base by Jane Street, as recommended in the book Real World OCaml, I obtain a deprecation warning: utop # ...
user0's user avatar
  • 195
1 vote
1 answer
515 views

I have some code that uses the module Big_int, like in: open Big_int;; Big_int.gcd_big_int 5 6;; However, when I compile this with utop dune utop --release (I use release to avoid some warnings), ...

15 30 50 per page
1
2 3 4 5
...
7

AltStyle によって変換されたページ (->オリジナル) /