Haskell学习笔记--type

type 类型别名

type IntList = [Int]

注意大写

 

newtype 类似data

但只允许有一个构造函数,构造函数只能有一个参数

newtype Cm = Cm double deriving Eq

优点:快

 

posted @ 2021-10-23 12:56  liankewei123456  阅读(58)  评论(0编辑  收藏  举报