mno2
Haskell 趣學指南

Updated 2 years ago

murphy meng (@murphymeng) started discussion #8

3 years ago · 0 comments

Open

与原先让那些项一个挨一个的空格隔开不同,这里用了花括号 {}。先写出项的名字,如 firstName,后跟两个冒号(也叫 Paamayim Nekudotayim,哈哈~(译者不知道什么意思~囧)),标明其型别,返回的数据型别仍与以前相同。这样的好处就是,可以用函数从中直接按项取值。通过 Record Syntax,Haskell 就自动生成了这些函数:firstName, lastName, age, height, phoneNumber 和 flavor。

Build Our Own Type and Typeclass (Edit this file)

Paamayim Nekudotayim 是范围解析操作符的意思,然而知道这个并没有什么卵用:)

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