recursion-schemes

What does “coalgebra” mean in the context of programming?

狂风中的少年 提交于 2019-11-27 08:54:29
问题 I have heard the term "coalgebras" several times in functional programming and PLT circles, especially when the discussion is about objects, comonads, lenses, and such. Googling this term gives pages that give mathematical description of these structures which is pretty much incomprehensible to me. Can anyone please explain what coalgebras mean in the context of programming, what is their significance, and how they relate to objects and comonads? 回答1: Algebras I think the place to start would

What is a catamorphism and can it be implemented in C# 3.0?

断了今生、忘了曾经 提交于 2019-11-27 04:15:12
问题 I'm trying to learn about catamorphisms and I've read the Wikipedia article and the first couple posts in the series of the topic for F# on the Inside F# blog. I understand that it's a generalization of folds (i.e., mapping a structure of many values to one value, including a list of values to another list). And I gather that the fold-list and fold-tree is a canonical example. Can this be shown to be done in C#, using LINQ's Aggregate operator or some other higher-order method? 回答1: LINQ's