在哪里可以学习先进的Haskell? [英] Where can I learn advanced Haskell?

查看:90
本文介绍了在哪里可以学习先进的Haskell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在对我的答案之一,SO用户sdcwc基本上指出以下代码:

  comb 0 = [[]] 

comb n =
let rest = comb(n-1)
在map('0':) rest
+ +地图('1':)休息

可以替换为:

  comb n = replicateM n01

这让我非常震惊。



现在我正在寻找教授这些高级概念的教程,书籍或PDF。我不是寻找一个针对初学者或在线参考的什么是monad教程,以解释 replicateM 的类型。我想学习如何在单体中思考并有效地使用它们,如果你愿意,单体模式。

解决方案

从我的角度(这肯定不是普遍的),我对列表monad无动于衷 - 在你的例子中,我(弱)认为,由于有很多列表功能,它是一个巧合,解决方案是一个单一的功能而不仅仅是列表功能(或通过Data.Traversable或Data.Foldable功能的列表的泛化)。对于单体模式,我想更多的关于效果比特定组合器 - 状态模型读写状态,Reader模型只读状态,Writer模型只写状态,也许模型偏袒(所以它可以模拟错误而不出现错误信息),两者/错误模型错误与有形的错误代码或消息。当你得到一个效果的处理 - 你很快意识到你需要结合它们,所以单变量变压器变得重要。



除了The编程的乐趣 - 这是一本多作者的书,收集了一些相当不同的作品,所以值得浏览一个副本,然后再决定一下你想要的书。理查德·伯德(Richard Bird)的新书有许多高级编码的例子,但它使用简单优雅的代码来实现。它是一本很好的书,虽然它不是一本关于高级语言功能的书。



在没有书籍的情况下,论文是比博客更好的地方。最相关的是Haskell研讨会(以前称为Haskell研讨会),请查看下面的链接以列出所提交论文的程序,然后搜索您感兴趣的内容 - 在大多数情况下,作者将该文件公开



http://haskell.org/haskell-symposium/


In a comment to one of my answers, SO user sdcwc essentially pointed out that the following code:

comb 0 = [[]]

comb n =
    let rest = comb (n-1)
    in  map ('0':) rest
     ++ map ('1':) rest

could be replaced by:

comb n = replicateM n "01"

which had me completely stunned.

Now I am looking for a tutorial, book or PDF that teaches these advanced concepts. I am not looking for a "what's a monad" tutorial aimed at beginners or online references explaining the type of replicateM. I want to learn how to think in monads and use them effectively, monadic "patterns" if you will.

解决方案

From my perspective (which certainly isn't universal), I'm indifferent to the list monad - in your example I'd (weakly) argue that as there are lots of list functionals it was as good as a coincidence that the solution was a monadic functional rather than just a list functional (or a generalization of a list functional through Data.Traversable or Data.Foldable).

For monadic patterns I think more about the effect than particular combinators - State models read-write state, Reader models read-only "state", Writer models write only "state", Maybe models partiality (so it can model errors without error messages), Either/Error models errors with tangible error codes or messages. As you get a handle on effects - you quickly realize you need to combine them so monad transformers become important.

There aren't any books yet on advanced Haskell except "The Fun of Programming" - this is a multi-author book collecting some quite disparate work, so it is worth browsing a copy before deciding whether or not its a book you'd want. Richard Bird's new book has many examples of advanced coding but it does this with simple, elegant code. Its a very good book though it isn't a book about advanced language features.

In the absence of books, papers are the best place as they are more polished than blogs. Most relevant is the Haskell Symposium (which used to be called the Haskell Workshop), check the link below for the proceedings which will list the papers presented, then do a search for anything you find interesting - in most cases the authors make the paper publicly available.

http://haskell.org/haskell-symposium/

这篇关于在哪里可以学习先进的Haskell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆