函数式编程中的“全麦”是什么?

发布于 2024-11-28 03:14:11 字数 165 浏览 0 评论 0原文

有人能给个明确的解释吗?什么是函数式编程领域的全面编程。我所发现的是全麦

关注整个数据结构而不是其元素

,但如何对其进行归档? (Scala 或 Ocaml 等语言的代码示例非常理想。)

Can anybody give a clear explanation? What is a wholemeal programming in functional programming area. All I've found is that wholemeal is a

focusing on entire data structures rather than their elements

but how can it be archived?
(Code examples in such languages as Scala or Ocaml are very desirable.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荆棘i 2024-12-05 03:14:11

“函数式语言擅长全麦编程,这是由
杰兰特·琼斯.全盘编程意味着要胸怀大志:与
整个列表,而不是元素序列;制定解决方案
空间,而不是单独的解决方案;想象一个图表,而不是
比单一路径。全麦饮食方法通常会提供新的见解
或针对特定问题提供新的视角。很好
补充射影规划的思想:首先解决更多
一般问题,然后通过以下方式提取有趣的点滴
将通用程序转变为更专业的程序。”

我还发现了这一点

它有助于预防一种称为“指数炎”的疾病,并鼓励合法
程序构建(来​​自《函数式算法设计的珍珠》,
理查德·伯德,2010)

另请参阅 (http://www.comlab .ox.ac.uk/ralf.hinze/publications/ICFP09.pdf)

"Functional languages excel at wholemeal programming, a term coined by
Geraint Jones. Wholemeal programming means to think big: work with an
entire list, rather than a sequence of elements; develop a solution
space, rather than an individual solution; imagine a graph, rather
than a single path. The wholemeal approach often offers new insights
or provides new perspectives on a given problem. It is nicely
complemented by the idea of projective programming: first solve a more
general problem, then extract the interesting bits and pieces by
transforming the general program into more specialised ones."

I also found this

it helps prevent a disease called "indexitis" and encourages lawful
program construction (from "Pearls of Functional Algorithm Design",
Richard Bird, 2010)

See also (http://www.comlab.ox.ac.uk/ralf.hinze/publications/ICFP09.pdf)

最近可好 2024-12-05 03:14:11

我总是发现 Hutton/Bird Sudoku 求解器是全麦编程的一个很好的例子:http: //www.cs.nott.ac.uk/~gmh/sudoku.lhs

相当多的功能性珍珠(Code Monkey 引用的 Bird 优秀书籍和此处提供:http://www.haskell.org/haskellwiki/Research_papers/Functional_pearls )可能也会有启发性。

I always found the Hutton/Bird Sudoku solver a good example of wholemeal programming: http://www.cs.nott.ac.uk/~gmh/sudoku.lhs

A fair number of functional pearls (both that in Bird's excellent book that Code Monkey cites and those available here: http://www.haskell.org/haskellwiki/Research_papers/Functional_pearls) will probably also be instructive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文