When you define a custom statement with let, it will always take precedence over type-specific statements. An easy way to handle this is to avoid name clashes in local and global operator names or to limit the scope of the let-bound statements. For example, you can put the global operator =~in a separate module:
module VectorImplementation =
let inline (=~) a b = abs (single a - single b) <= 0.001f
module Vectors =
open VectorImplementation
type Vector =
{ x : single; y : single; z : single }
static member (=~) (v1, v2) =
(v1.x =~ v2.x) && (v1.y =~ v2.y) && (v1.z =~ v2.z)
open System
open Vectors
let v1, v2 =
{ x = 0.1f; y = single Math.PI; z = 0.f },
{ x = 0.1f; y = 3.14159f; z = 0.0001f }
v1 =~ v2
, let, . , - , , , .