F# active pattern as non-static member
问题 I'm not sure if non-static public member active patterns are allowed but you can define them without the compiler complaining. If they are allowed what's the syntax for matching against one? The compiler is giving me a type mismatch for Foo in FooBar2.doSomething. Expecting a 'a -> Choice<'b,'c> given 'a -> 'd -> Choice<unit,unit> // No error in this class, static works great type FooBar() = static member (|Foo|Bar|) (x, y) = match x = y with | true -> Foo | false -> Bar member x.doSomething