Recommend using RAG for this. Make the Haskell or OCaml documentation your knowledge base and index it for RAG. Then it makes a heck of a lot more sense!
You can get pretty good results by copying the output from Firefox's Reader View into your project, for example:
about:reader?url=https://learnxinyminutes.com/ocaml/