anchor.diff:  
   #if FX_ATLEAST_40 // should probably create some compilation flag for this stuff
               module GenericSpecializeEquals =
  -                let standardTypes (ty:Type) : obj =
  -                    match ty with
  -                    | t when t.Equals typeof<bool>       -> upcast Func<IEqualityComparer,bool      ,bool      ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<sbyte>      -> upcast Func<IEqualityComparer,sbyte     ,sbyte     ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<int16>      -> upcast Func<IEqualityComparer,int16     ,int16     ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<int32>      -> upcast Func<IEqualityComparer,int32     ,int32     ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<int64>      -> upcast Func<IEqualityComparer,int64     ,int64     ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<byte>       -> upcast Func<IEqualityComparer,byte      ,byte      ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<uint16>     -> upcast Func<IEqualityComparer,uint16    ,uint16    ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<uint32>     -> upcast Func<IEqualityComparer,uint32    ,uint32    ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<uint64>     -> upcast Func<IEqualityComparer,uint64    ,uint64    ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<nativeint>  -> upcast Func<IEqualityComparer,nativeint ,nativeint ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<unativeint> -> upcast Func<IEqualityComparer,unativeint,unativeint,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<char>       -> upcast Func<IEqualityComparer,char      ,char      ,bool>(fun _ x y -> (# "ceq" x y : bool #))
  -                    | t when t.Equals typeof<string>     -> upcast Func<IEqualityComparer,string    ,string    ,bool>(fun _ x y -> System.String.Equals((# "" x : string #),(# "" y : string #)))
  -                    | t when t.Equals typeof<decimal>    -> upcast Func<IEqualityComparer,decimal   ,decimal   ,bool>(fun _ x y -> System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #)))
  -                    | _ -> null
  +                let standardTypes (t:Type) : obj =
  +                    if   t.Equals typeof<bool>       then box (Func<IEqualityComparer,bool      ,bool      ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<sbyte>      then box (Func<IEqualityComparer,sbyte     ,sbyte     ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<int16>      then box (Func<IEqualityComparer,int16     ,int16     ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<int32>      then box (Func<IEqualityComparer,int32     ,int32     ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<int64>      then box (Func<IEqualityComparer,int64     ,int64     ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<byte>       then box (Func<IEqualityComparer,byte      ,byte      ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<uint16>     then box (Func<IEqualityComparer,uint16    ,uint16    ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<uint32>     then box (Func<IEqualityComparer,uint32    ,uint32    ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<uint64>     then box (Func<IEqualityComparer,uint64    ,uint64    ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<nativeint>  then box (Func<IEqualityComparer,nativeint ,nativeint ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<unativeint> then box (Func<IEqualityComparer,unativeint,unativeint,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<char>       then box (Func<IEqualityComparer,char      ,char      ,bool>(fun _ x y -> (# "ceq" x y : bool #)))
  +                    elif t.Equals typeof<string>     then box (Func<IEqualityComparer,string    ,string    ,bool>(fun _ x y -> System.String.Equals((# "" x : string #),(# "" y : string #))))
  +                    elif t.Equals typeof<decimal>    then box (Func<IEqualityComparer,decimal   ,decimal   ,bool>(fun _ x y -> System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #))))
  +                    else null
   
                   let makeEqualsReturnType ty =
                       mos.makeGenericType<Func<_,_,_,_>> [| typeof<IEqualityComparer>; ty; ty; typeof<bool> |]
  
positive.code:                 | false -> false
  
  #if FX_ATLEAST_40 // should probably create some compilation flag for this stuff
              type private EquivalenceRelation = class end
              type private PartialEquivalenceRelation = class end
  
              module mos =
                  let makeEquatableType ty =
                      let equatableTypedef = typedefof<IEquatable<_>>
                      equatableTypedef.MakeGenericType [|ty|]
  
                  let makeComparableType ty =
                      let comparableTypedef = typedefof<IComparable<_>>
                      comparableTypedef.MakeGenericType [|ty|]
  
                  // TODO: Copy to a Comparable version
                  let rec tryFindObjectsInterfaceMethod (objectType:Type) (interfaceType:Type) (methodName:string) (methodArgTypes:array<Type>) =
                      if not (interfaceType.IsAssignableFrom objectType) then null
                      else
                          let methodInfo = interfaceType.GetMethod (methodName, methodArgTypes) 
  
negative.code:                     elif t.Equals typeof<decimal>    then box (Func<IComparer,decimal   ,decimal   ,int>(fun _ x y -> System.Decimal.Compare((# "" x:decimal #), (# "" y:decimal #))))
                      else null
  
                  let compilerGenerated tyRelation ty =
                      match tyRelation with
                      | r when r.Equals typeof<EquivalenceRelation> ->
                          if mos.hasFSharpCompilerGeneratedComparison ty then
                              if ty.IsValueType
                                  then makeCompareDelegate ty ty Exemplars.valueTypeComparableGeneric
                                  else makeCompareDelegate ty ty Exemplars.refTypeComparableGeneric
                          else null
                      | r when r.Equals typeof<PartialEquivalenceRelation> -> null
                      | _ -> raise (Exception "invalid logic")
  
                  let comparisonInterfaces (t:Type) : obj =
                      let make = makeCompareDelegate t t
  
                      let comparableGeneric = mos.makeComparableType t
  
                      if t.IsArray || typeof<System.Array>.IsAssignableFrom t then
                          // TODO: Future
                          null
  
                      elif t.IsGenericType && ((t.GetGenericTypeDefinition ()).Equals typedefof<System.Nullable<_>>) then
                          let underlyingType = get (t.GetGenericArguments()) 0
                          let make = makeCompareDelegate t underlyingType 
                          let underlyingComparableGeneric = mos.makeComparableType underlyingType
                          
                          if typeof<IStructuralComparable>.IsAssignableFrom underlyingType   then make Exemplars.nullableStructualComparable
                          elif underlyingComparableGeneric.IsAssignableFrom underlyingType   then make Exemplars.nullableComparableGeneric
                          else                                                                    make Exemplars.nullableComparable
  
                      elif t.IsValueType && typeof<IStructuralComparable>.IsAssignableFrom t then make Exemplars.valueTypeStructualComparable
                      elif t.IsValueType && comparableGeneric.IsAssignableFrom t             then make Exemplars.valueTypeComparableGeneric
                      elif t.IsValueType && typeof<IComparable>.IsAssignableFrom t           then make Exemplars.valueTypeComparable
  
                      elif typeof<IStructuralComparable>.IsAssignableFrom t                  then make Exemplars.refTypeStructualComparable
  
                      // only sealed as a derived class might inherit from IStructuralComparable
                      elif t.IsSealed && comparableGeneric.IsAssignableFrom t                then make Exemplars.refTypeComparableGeneric
                      elif t.IsSealed && typeof<IComparable>.IsAssignableFrom t              then make Exemplars.refTypeComparable
  
                      else null
  
                  type GenericComparerObj<'a>() =
                      member __.CompareTo (comp:IComparer, x:'a, y:'a) = comp.Compare (box x, box y)
  
                  let defaultCompare ty =
                      makeCompareDelegate ty ty typedefof<GenericComparerObj<_>>
  
                  let createCompareDelegate (tyRelation:Type) (ty:Type) : obj =
                      mos.takeFirstNonNull [|
                          fun () -> floatingPointTypes tyRelation ty
                          fun () -> standardTypes ty
                          fun () -> compilerGenerated tyRelation ty
                          fun () -> comparisonInterfaces ty
                          fun () -> defaultCompare ty
                      |]
  
                  type Function<'relation, 'a>() =
                      static let func : Func<IComparer,'a, 'a, int> =
                          match createCompareDelegate typeof<'relation> typeof<'a> with
                          | null -> raise (Exception "invalid logic")
                          | f -> unboxPrim f
  
  