首页 > 解决方案 > 如何定义包含名为“类型”的字段的记录?

问题描述

有没有办法定义包含“类型”字段的记录?例如 :

type ProjectType= 
    | ObjectDetection 
    | Classification

type Domain =  {
    name:string;
    type: ProjectType; // How can I achieve this ?
    enabled:bool;
}

标签: f#

解决方案


推荐阅读