When you use an operator, F# looks for it in order:
- as a
let
-defined operator; - as a
static member
-defined operator on one of the two arguments' types. Here, the arguments you are passing to the operator arestring list
andTestDI -> string
, so it won't look at the one you defined onTestDI
.
So here the solution would be to let
-define it instead:
type TestDI = private | A of string list | B of int listlet (>>=) (x: string list) (f: TestDI -> 'a) = f <| A x