The ocaml tag has no wiki summary.
1
vote
2answers
55 views
Project Euler problem in ocaml. Looking for idiom feedback rather than algorithmic
I'm currently attempting to learn Ocaml, and I'm working thought the Project Euler problems to do so. Here's some code I knocked together for problem 10
(*
The sum of the primes below 10 is 2 + 3 + ...
2
votes
3answers
331 views
Is this use of (let … and …) in OCaml poor style?
In other languages, I prefer to arrange source files so that simpler and more widely useful concepts are introduced before implementation details, and I try where possible to make complex ...
2
votes
1answer
126 views
Is this binary search close to idiomatic OCaml?
let binsearch ~arr ~cmp x = (
let cmpx = cmp x in
(* Assuming arr is ordered according to cmp, then (bs min max) is an *)
(* index of a value v in arr such that ((cmp x value) = 0) ...
3
votes
2answers
250 views
String Trie in OCaml
I'm pretty new to OCaml, so any feedback is appreciated. The goal is to implement a trie that efficiently stores and sorts strings.
module CharMap = Map.Make(Char)
(* count of members of the set ...
4
votes
0answers
56 views
Timeoutable computations module
Defines a simple module for timeoutable computations, with the ability to return
arbitrary intermediary results on timeout or the final value otherwise. It also
allows default return values.
The ...