Skip to content

Instantly share code, notes, and snippets.

@latkin

latkin/ops.fsx

Created Apr 30, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.