This bit of code:
open System
open System.Collections.Generic
type INode =
interface
inherit IEqualityComparer<INode>
inherit IEquatable<INode>
end
let myFun<'N when 'N :> INode> (n:'N) = n = n
generates the following build error:
A type parameter is missing a constraint 'when 'N : equality'
I know I can appease the compiler at the function level with
let myFun<'N when 'N :> INode and 'N : equality> (n:'N) = n = n
but I'd prefer to let the type constraint as it was in myFun and "fix" the issue at INode, so as to make it easier in case I want to have several functions taking on the very same constraint.
Is it possible?