Ok, I am finally writing non-trivial #ocaml ...

type _ Effect.t +=
| GetAccounts : (account_summary, fetch_error) result Effect.t
| GetBalance : account_id -> (account_balance, fetch_error) result Effect.t
| GetPositions : account_id -> (position list, fetch_error) result Effect.t

...

I still don't love the syntax which I know is such a stupid/surface annoyance.

@SusanPotter: ReasonML might be more your speed. It is a syntax translation for OCaml that makes it more "JS like" (I think "more modern" is more appropriate, but it does happen to look more like JavaScript, so it isn't an incorrect characterization at all.)

It is how I started writing OCaml about 5 years ago and I still prefer the syntax.

@BryanBennett I am still deciding if I want to build with OCaml, Scala, or maybe F# at this point for what I am trying to build out. OCaml's strengths are incremental lib, first class algebraic effects, and as a minor benefit for my needs, MirageOS (though for different use cases I think MirageOS would be a huge benefit). I have experience with Scala and Haskell and a little recent F# experience with my quant adventures.

@SusanPotter: well, I like F# and Haskell quite a bit, but have trouble recommending Scala for the fact that interacting with Java is rife with NPE problems and mappings over those are necessarily imperfect (and I have found Java/Scala devs to be worse with mapping these than C#/F# devs...)

But if you choose to go with OCaml, I should clarify that Reason is trivial to add to a "standard" OCaml stack. Just add reason as a dune dependency and change the syntax and file extension to ".re".

@BryanBennett yeah, I am aware of ReasonML though lib docs will all be in OCaml. I have had very different experiences with Scala in the ZIO or Type level pure FP sect than what you outline (for many years), but Scala has other issues... Non-technical in nature IME.