-1
(从哈斯克尔开胃小点讲座)自定义列表定义
module Part2a where
data List α = EndOfList
| Link α (List α)
deriving Show -- makes printing out results possible
应用实例:
empty = EndOfList
oneWord = Link "apple" EndOfList
twoWords = Link "banana" (Link "cantaloupe" EndOfList)
问: 在哪里 “链接” 函数的定义?
我到处搜索,找不到它。
也许显示GADT语法会有帮助吗? –