计算随机序列:过滤与生成(函数Pearl)
Computing Integer Sequences: Filtering vs Generation (Functional Pearl)
摘要:
作为一个教学经验的报告,我们分析了计算两个整数序列的Haskell程序:Hamming序列和Ulam序列。对于这两种情况,我们研究了两种计算策略:第一种是基于过滤掉那些不属于序列的自然数,而第二种是基于直接生成属于序列的数。提倡在不同的编程范式编程时出现的想法之间的交叉施肥,在背景下,我们勾勒出一些考虑相应的C程序解决同样的两个问题。
英文摘要:
As a report of a teaching experience, we analyse Haskell programs computing two integer sequences: the Hamming sequence and the Ulam sequence. For both of them, we investigate two strategies of computation: the first is based on filtering out those natural numbers that do not belong to the sequence, whereas the second is based on the direct generation of num- bers that belong to the sequence. Advocating cross-fertilisation among ideas emerging when programming in different programming paradigms, in the background, we sketch out some considerations about corresponding C programs solving the same two problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。