Active patterns are just simple functions.
Like functions you can define additional parameters:
let (|HasExtension|_|) expected (uri : string) =
let result = uri.EndsWith (expected, StringComparison.CurrentCultureIgnoreCase)
match result with
| true -> Some true
| _ -> None
This can be used in a pattern matching this way:
let isXMLFile uri =
match uri with
| HasExtension ".xml" _ -> true
| _ -> false