Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Types 为什么';这个有区别的联合不接受集合类型的情况吗?_Types_F#_Set_Discriminated Union - Fatal编程技术网

Types 为什么';这个有区别的联合不接受集合类型的情况吗?

Types 为什么';这个有区别的联合不接受集合类型的情况吗?,types,f#,set,discriminated-union,Types,F#,Set,Discriminated Union,我正在尝试创建一个新的集合类型: type MySet<'t> = | List of list<'t> | Sequence of seq<'t> | Array of 't [] 我猜这应该很容易修复,但即使我尝试了几件事,我还是无法做到。设置的实现 |序列 type MySet<'t> = | List of list<'t>

我正在尝试创建一个新的
集合
类型:

type MySet<'t> = | List of list<'t>
                 | Sequence of seq<'t>
                 | Array of 't []

我猜这应该很容易修复,但即使我尝试了几件事,我还是无法做到。

设置
的实现
|序列
type MySet<'t> = | List of list<'t>
                 | Sequence of seq<'t>
                 | Array of 't []
                 | Set of Set<'T>
type MySet<'t when 't : comparison> =
    | List of list<'t>
    | Sequence of seq<'t>
    | Array of 't []
    | Set of Set<'t>