Chinaunix首页 | 论坛 | 博客
  • 博客访问: 337179
  • 博文数量: 105
  • 博客积分: 2730
  • 博客等级: 少校
  • 技术积分: 1110
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-20 12:09
文章分类

全部博文(105)

文章存档

2013年(3)

2012年(2)

2011年(36)

2010年(34)

2009年(6)

2008年(20)

2007年(4)

分类: IT业界

2011-05-28 12:30:12

列一下, 有空的时候再回来慢慢解释
7.3.1. Unicode syntax
可以使用Unicode字符当操作符
7.3.2. The magic hash
在类型后面加#unboxed type时更方便, 不用引用一堆库
7.3.3. New qualified operator syntax
XXX.(<$>)这样的qualified语法
7.3.4. Hierarchical Modules
没啥意思
7.3.5. Pattern guards
用 | a=1 -> 1 这样的语法, 比case-of更省力.
7.3.6. View patterns
在pattern matching时更省力, 语法更优美(全是为了美好的文学性..)
7.3.7. n+k patterns
可以这样来: pred :: Int -> Int
pred (n+1) = n
7.3.8. The recursive do-notation
递归的do块, rec(ursive)
7.3.8.1. Details of recursive do-notation
7.3.8.2. Mdo-notation (deprecated)
7.3.9. Parallel List Comprehensions
[(x,y) | x<-[1,2], y <- [8,9]]  ---- [[1,8],[1,9],[2,8],[2,9]]
[(x,y) | x<-[1,2] | y <- [8,9]]  ----[[1,8],[2,9]]   ---- parallel list comp. 这个就和zip类似了.
7.3.10. Generalised (SQL-Like) List Comprehensions
这个可以在list comp. 的时候用sql类似的语法, 不过挺牵强的, 不是很实用
then group by
then group using

7.3.11. Rebindable syntax and the implicit Prelude import
取消对数值基本操作在Prelude的绑定, 以前说(+)都是Prelude.(+), 这时可以仅定义为(+), 方便自己替换基本库.
7.3.12. Postfix operators
允许定义单参数的后缀操作符.
7.3.13. Tuple sections
tuple中缺失的部分认为是等待apply的参数
(, , ,1)等价于
\x y z -> (x,y,z,1)
不过( ) 依然是( )

7.3.14. Record field disambiguation
对data构造中声明的域提取函数, 可以允许同名, 并且允许没有歧义的使用.
7.3.15. Record puns
7.3.16. Record wildcards
7.3.17. Local Fixity Declarations
7.3.18. Package-qualified imports
import "network" Network.Socket
指定从network包中导入后面的module, 可以解决不同的包都含有同名module的歧义情况.
7.3.19. Summary of stolen syntax
阅读(744) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~