mno2
Haskell 趣學指南

Updated 2 years ago

xiaoyulong (@peterxiao) started discussion #27

a year ago · 0 comments

Open

再度重申,类型构造子和值构造子的区分是相当重要的。在声明数据类型时,等号=左端的那个是类型构造子,右端的(中间可能有|分隔)都是值构造子。拿 Vector t t t -> Vector t t t -> t 作函数的类型就会产生一个错误,因为在类型声明中只能写类型,而 Vector 的类型构造子只有个参数,它的值构造子才是有三个。我们就慢慢耍:

Build Our Own Type and Typeclass (Edit this file)

Vector 的类型构造子只有一个参数

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant