2013-10-10 53 views
3

我是Haskell的新手,我注意到@在阅读代码时具有特定的作用,有人知道确切地做了什么?语法在Haskell中@是什么?

+3

[在Haskell中,可能\'this @(Sentence string \ _)='是什么意思?](http://stackoverflow.com/questions/15278980/in-haskell-what-c​​ould- thissentence串-DO均值) –

回答

9

@用于模式匹配以保持对整个事物的绑定。

实施例:

[email protected](a:as)x将指整个列表a:as

在上例中,您可以通过x获取整个列表,而不是再次输入自己的a:as