Question about of_string restricting result type to [`Msg]
I apologise if that's not the right place for this question but I wonder why Fpath.of_string restricts the type of its result:
val of_string : string -> (t, [`Msg of string]) Result.result
instead of
val of_string : string -> (t, [> `Msg of string]) Result.result
Because of that I have to use double coercion in my code where I have other variants in the error side of the result.
I'm no longer sure exactly why. Some type error messages may be a bit less unwidely if you proceed that way but it might not be a good reason to do this and maybe this should be opened (I'm a bit unsure how much code that would break though).
Note that if you are using rresult you can use R.open_error_msg rather than coercions.
Thanks for clarification and for suggestion to use R.open_error_msg!