Menu
  • HOME
  • TAGS

Multi-case parameterized active patterns returning error FS0722 Only active patterns returning exactly one result may accept arguments

compiler-errors,f#,active-pattern

The simplest solution would be refactoring this into a partial active pattern: let (|InRangeInclusive|_|) lo hi x = if lo <= x && x <= hi then Some () else None Then you may even combine them in something like this: let test i = match i with | InRangeInclusive...

Appropriate use of active patterns in F#

f#,active-pattern

To add to @Petr's answer - UsageEvent cases and your active pattern cases have the same names, so the active pattern which is defined later shadows the union type. That's where the string list thing comes from, most likely. I would just drop the active pattern altogether, and add a...