我有我自己的数据类型:Haskell的数据类型字段
type Types = String
data MyType = MyType [Types]
我有一个效用函数:
initMyType :: [Types] -> MyType
initMyType types = Mytype types
现在我创建:
let a = MyType ["1A", "1B", "1C"]
我如何获得列表["1A", "1B", "1C"]
从a
?一般来说,我如何从数据构造函数中获取数据?