Because I learned OCaml for work, I didn’t have the luxury of giving up. Also, I was excited to learn OCaml because of an experience in a university course I took some years earlier, so I also had determination.
So, I’m not sure if this is something that would have otherwise tempted me to give up, but I found myself repeating myself a lot in OCaml.
One thing that I found myself doing a lot was having failwith cases that I was sure couldn’t happen because I’d already checked those conditions previously. But it was too much trouble to create a new type and a new function to “narrow” the old type to the new type.
I didn’t know, yet, that OCaml has “type narrowing”. I wouldn’t have even known that term except that it featured prominently in the documentation of Mypy, the Python optional typechecker. And one day, it just occurred to me to do a web search to see if there was a way to do that in OCaml.
Another thing I feel might be useful is ad-hoc polymorphism (like traits in Rust or templates or “concepts” in C++). I know from reading elsewhere on this forum that it is controversial, though. Also, I’ve understood that something like that can be done with modules, but I haven’t tried it, yet.
I don’t have a ready example of where it would help me, though, because its been a while since I was working on the OCaml parts of my projects.
I’ve seen elsewhere on this forum concerns raised about the debugger. I thought the debugger was pretty good, and it is clever to be able to step backward in code, but it took some getting used to how to set breakpoints. I think I remember it giving some kind of error about threads, and I had to upgrade to 4.14, then it gave some error(s) (or warning(s)) but still worked. Also, it wasn’t integrated with the IDE (VS Code), except for old versions, but I understand that is being worked on now. I suppose the concerns were targeted at being able to use the debugger on native code or for multicore code.
Also, I had to use ppx_deriving in order to print some things that would be easy to print in other languages.
OCaml syntax took more getting used to than I expected. I think it is because I had to get used to when a form of expression indicates that a function is being applied, and I had to get used to the compiler’s error messages. The Reason syntax might help beginners with that. I haven’t tried it, but now I think I would prefer the standard OCaml syntax, and I think that currying is a really clever and elegant feature.