Skip to main content
3 votes
2 answers
104 views

I was creating a simple concat, and thought that this might work. (** [foldl fun init lst] the [fun] gets applied, left to right: {[foldl fun init [e1;e2;e3;e4] -> fun e4 (fun e3 (fun e2 (fun e1 ...
Ashok Kimmel's user avatar
0 votes
1 answer
76 views

I use OCaml/Dream to create a simple HTML form (No sensitive data at all). let form_page request = let _csrf_token = Dream.csrf_token request in Dream.html (Printf.sprintf {| <form action="/...
Abdelghani's user avatar
0 votes
1 answer
102 views

This seems like it should be obvious bug how do I have a conditional dependency in dune-project? Specifically I want to depend on a library but only on Unix-like systems: (package (name foo) (...
Timmmm's user avatar
  • 99.2k
0 votes
0 answers
116 views

I started using this pattern to obviate the need to repeat the complex type everywhere. Now I don't have many repetitions but the idea works. The Iterator is a small type with 2 functions. module type ...
Mohan Radhakrishnan's user avatar
0 votes
0 answers
81 views

I am developing a server with Ocaml/Dream. The server can be installed with Opam and called from anywhere in the disk. For the server icon, I use : Dream.get (favicon_path) (fun request -> ...
Abdelghani's user avatar
3 votes
2 answers
126 views

I wrote a module with a signature but got an error when executing a function from within this module. module Empty: sig type t val double: t -> t end = struct type t = int let double (x: ...
ibx's user avatar
  • 31
0 votes
1 answer
43 views

I'm trying to build the incr_dom examples from here. I've succeeded with text_input, now I've moved on to ts_gui. I copied the ts_gui directory into a directory outside of the incr_dom repo, added the ...
ixb's user avatar
  • 72
3 votes
2 answers
87 views

In C, one can write: printf("%.3s", "foobar"); To get foo printed as a result (that is, print the initial part of a string). In OCaml, Printf.printf "%.3s" "foobar&...
anol's user avatar
  • 9,400
2 votes
0 answers
60 views

I'm trying to port an open source existing ocaml app from Makefiles to dune. The application includes some C and C++ stubs. I tried to add a test.c file in a library like this: (library (name cdk) ...
Luca Carlon's user avatar
0 votes
1 answer
108 views

Im trying to follow the tutorial for oxcaml but the provided code copied directly from said tutorial has multiple errors let result = Scheduler.schedule scheduler ~monitor ~f in ...
nukeLEAR's user avatar
1 vote
1 answer
78 views

Coming from Java, it's useful to be able to pass PrintStream instances around instead of directly writing to System.out or System.err deep in a call stack. That way output can either be captured in a ...
user avatar
3 votes
1 answer
59 views

My use-case is that I am writing tests for a parser. The parser outputs an AST which I convert to an s-expression of sexplib type. I want to compare this s-expression to an expected parse tree, also ...
user avatar
0 votes
0 answers
40 views

Is there a way in the OCaml Z3 API to detect, after optimizing a problem and getting a model, to check if the objective was actually unbounded? One method I see is to add a constraint "I want ...
David Monniaux's user avatar
2 votes
1 answer
105 views

I am creating a tool that transpiles a language that is pretty much OCaml to valid OCaml code. Now, I absolutely need to keep comments (in the correct places) when transpiling to OCaml. The problem is ...
João Nini's user avatar
1 vote
0 answers
66 views

I'm trying to install things to start doing stuff using OCaml, but somehow on Windows 11 it can't find "git" that is apparently installed I've tried a lot of stuff: installing stuff from ...
Illia Shuldieshov's user avatar

15 30 50 per page
1
2 3 4 5
511