I have a record type that includes a function:
{foo : int; bar : int -> int}
I want this type to have structural equality. Is there some
To answer more specifically your original question, you can create a custom type whose comparison between instances is always true:
[]
type StructurallyNull<'T> =
{ v: 'T }
override x.Equals(yobj) =
match yobj with
| :? StructurallyNull<'T> -> true
| _ -> false
override x.GetHashCode() = 0
You can then use it this way:
type MyType = {
foo: int;
bar: StructurallyNull int>
}