I find myself creating constructors for variant types so that I am able to curry and do partial application:
type thing
= ThingOne of int * int
| ThingTwo of string
let thing_one v1 v2 = ThingOne (v1, v2)
let thing_two s = ThingTwo s
I find this less verbose than using anon functions everywhere…
func (v1, v2) -> ThinkOne (v1, v2)
We have to do quite a bit of partial application with variants like this in our app. Is there a better way to do this in OCaml, or is this the generally accepted method?