Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
80 views

My lwt_reporter is as follows. It compiles and seems to work barring one instance. I am yet to log anything. Since I combine Lwt/Eio this may not work. let lwt_reporter file = let buf_fmt ~like = ...
Mohan Radhakrishnan's user avatar
1 vote
2 answers
71 views

I try to use one these two Date/Time utilities as I don't find any such utility in Stdlib. But here Timedesc prints 2026 Feb 06 16:20:24.641349077 +05:30:00 whereas Mtime prints 1hr10m( for example )....
Mohan Radhakrishnan's user avatar
3 votes
0 answers
74 views

let reverse_curry2 x = fun a b -> x b a;; let twist f = fun x y -> reverse_curry2 f y x;; Considering the above code, I'm not sure whether we can eta-reduce twist to the below, because that ...
Tejasvi Aynor's user avatar
3 votes
2 answers
128 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
108 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
137 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.8k
0 votes
1 answer
181 views

I started using this pattern to obviate the need to repeat the complex type everywhere. Now I don't have many repetitions and the idea works. module type RadixNode = sig type 'a t end module ...
Mohan Radhakrishnan's user avatar
0 votes
0 answers
89 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
134 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
48 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
105 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,450
3 votes
1 answer
100 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
  • 10.1k
0 votes
1 answer
132 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
87 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
61 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

15 30 50 per page
1
2 3 4 5
511