Skip to content

Instantly share code, notes, and snippets.

@latkin
Created April 30, 2015 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save latkin/361c59a7582e390167c7 to your computer and use it in GitHub Desktop.
Save latkin/361c59a7582e390167c7 to your computer and use it in GitHub Desktop.
Scoping nonstructural operators
[<AutoOpen>]
module Ops =
open NonStructuralComparison
let inline nsHash x = hash x
let inline nsCompare x = compare x
let inline (=&) a b = a = b
let inline (<>&) a b = a <> b
let inline (<&) a b = a < b
let inline (>&) a b = a > b
let inline (<=&) a b = a <= b
let inline (>=&) a b = a >= b
let now = System.DateTime.Now
let tom = now.AddDays(1.)
(now = now) |> printfn "%b"
(now =& now) |> printfn "%b"
(now <> tom) |> printfn "%b"
(now <>& tom) |> printfn "%b"
(now < tom) |> printfn "%b"
(now <& tom) |> printfn "%b"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment