Next merlin protocol should be stateless.
Also worth taking a look: [[https://github.com/Microsoft/language-server-protocol|Microsoft/language-server-protocol]].

The protocol is still implemented as a series of request/answer.

{{{
  request-format:
  {
    uri: "path to current document",
    source: "full source text",
    setup: merlin-setup,
    query: merlin-query,
    configuration: {
      terminal_width: int,
      verbosity: int,
    },
  }
  
  answer-format:
  {
    class: "return" | "failure" | "error" | "exception",
    value: <defined-by-class-and-request>,
    notifications: string list 
  }
  
  merlin-query:
  ...
  
  merlin-setup:
  {
    build_path: string list,
    source_path: string list,
    cmi_path: string list,
    cmt_path: string list,
    findlib: string,
    stdlib: string,
    packages: string list,
    flags: string list,
    reader: string list,
    suffixes: (string * string) list
  }
}}}
