The goal is to have a list of discriminated union types where only one type of a particular case is allowed in the list no matter the underlying data for example:
type Car =
| Honda
| Tesla of string
let carList = [Honda; Tesla("Tesla"); Tesla(""); Tesla("Tesla")]
//List should look like
let correctCarList = [Honda; Tesla ("Tesla")]
In the case above thier should only be one element of type tesla allowed in the list, even if the underlying data associated with that case is different, it's still a duplicate tesla type.
I'm struggling to see if this is possible, if I make a set the set will only prohibit duplicate types where the type and underlying data is the same (so it would remove the extraneous Tesla("tesla") because there are two of them. Is it possible to filter out DS cases just by thier type only? Is there a way to only allow one descriminator to be created from a DS type?