As active pattern
let inline (|As|_|) (input: obj) : 't option =
match input with
| :? 't as value -> Some value
| _ -> NoneUse case: BusinessError(As OrderCannotBeCancelledAfterShipping)
BusinessError(As OrderCannotBeCancelledAfterShipping)[<Interface>]
type IBusinessError =
abstract member Code: string
abstract member Message: string
type Error =
| BusinessError of IBusinessError
| Bug of exn
// ...Last updated