active-pattern

F# match active pattern as expanded tuple

I get the following error in diff with a red squiggle under Subset. Type mismatch. Expecting a Range -> Choice but given a Range * Range -> Choice Is there some sort of type annotation I can add to the SubSet match so I don't have to use fst and snd? If not is there any intention to support this syntax? type Range = {min : int64; max ...

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> // N...

F# Active Pattern List.filter or equivalent

I have a records of types type tradeLeg = { id : int ; tradeId : int ; legActivity : LegActivityType ; actedOn : DateTime ; estimates : legComponents ; entryType : ShareOrDollarBased ; confirmedPrice: DollarsPerShare option; actuals : legComponents option ; type trade = { id : int ; securityId ...

overloading F# active patterns

I am fairly new to F# and active patterns, and I ran across an anomoly that I can't explain. module Eval = let (|Bet|Pass|) (test:BetChoice) = match test with | BetChoice.Bet -> Bet | BetChoice.Pass -> Pass let (|NoBet|Bet|Pass|) (test:Nullable<BetChoice>) : Choice<unit, unit, unit> = match test.HasValue with ...