Home
Insert
Update snippet 'Between operators'
Title
Description
A couple of operators for 'between, inclusive' and 'between, exclusive'.
Source code
/// Exclusive 'between' operator: let (><) x (min, max) = (x > min) && (x < max) /// Inclusive 'between' operator: let (>=<) x (min, max) = (x >= min) && (x <= max) // Examples let four = [0..9] |> List.filter (fun x -> x >< (3, 5)) // val four : int list = [4] let threeToFive = [0..9] |> List.filter (fun x -> x >=< (3, 5)) // val threeToFive : int list = [3; 4; 5]
Tags
operator overloading
operator overloading
Author
Link
Reference NuGet packages
If your snippet has external dependencies, enter the names of NuGet packages to reference, separated by a comma (
#r
directives are not required).
Update