Closed glennsl closed 6 years ago
Closing to avoid using issues as TODO list, since open issues are penalized by npms.io and issues badge
@glennsl I'd love to see this implemented. I wouldn't mind putting in the work. Do you have some thoughts/suggestions on the changes needed to make this happen?
I don't, unfortunately. Extensibility in OCaml in general is something I've been meaning to look into, but I'm not using OCaml at all these days so it's unlikely I'm going to do so in the foreseeable future.
More generally, using polymorphic variants in place of ordinary variants can be very useful since they're structural and can be composed in an ad-hoc manner. But they come with significant costs, like leaking implementation details, confusing error messages and no GADTs, which is used here (though it doesn't necessarily need to I think).
Using functors is another possibility, but composing several unrelated extensions using functors will likely involve quite a bit of boilerplate. Like the kind of delegation used to scale the Elm Architecture, if you're familiar with that.
Sorry I can't be of more help, but feel free to hack around and propose changes. But if you do, please try to explore and explain the trade-offs, so it's easier for me to decide whether or not to merge them. Otherwise it might take some time :)
To replace
expect.extend
. It'll most likely just be ordinary functions, but would need to use some kind of API.