greggyb, I came up with a thing in #fsharp today and I am unsure about it. I don't know if it's cute, useless, or useful; I cannot see far enough ahead to understand its implications.
type ErrExn = | Err of DomainError | Exn of System.Exception
This DU unifies domain errors (that are represented in a user-written DU) and exceptions.
I'd expect it to be in a function with a signature of
'a -> Result<'b, ErrExn>
.I don't know if this gives value over separate domain errors and exceptions.
Thoughts?