In C# one can state that a generic parameter must implement a certain interface like so:
public class Something<T> where T : IComparable
{
...
}
How does one specify this in F#?
In C# one can state that a generic parameter must implement a certain interface like so:
public class Something<T> where T : IComparable
{
...
}
How does one specify this in F#?
Generic constraints use "when" in F#:
type Foo<'a when 'a :> IComparable> =
member x.Bla = 0