Editing
Talk:Corecursion
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Major expansion: non-technical introduction, imperative examples (Python) == Iβve just completed a significant expansion (more than doubling) of the article, as of [http://en.wikipedia.org/w/index.php?title=Corecursion&oldid=504128625 this edit]. This consists essentially of: * Rewriting and expanding the non-technical lede (introduction), * Giving two detailed example, contrasting with recursion: factorial and tree traversal, implemented imperatively in Python, (together with various cleanup and formatting, and a brief note on history, AFAICT). Corecursion seems a very interesting topic, and perhaps a useful fundamental viewpoint, which appears to be only recently appreciated and not yet widely-known (certainly not outside functional programming community). I am no expert on this subject β I just reworked the existing article (discussion and Haskell examples), expanding the wording and giving explicit examples, and looked at the references. The non-technical discussion is perhaps a bit glib (it very sharply delimits the recursion/corecursion duality), but hopefully accurate and readable. The key points β corecursion useful for infinite data, and works ''forward'' (''synthetically,'' in contrast to ''analytically,'' as regular recursion) β seem easy enough to state clearly in non-technical terms. As for the examples: * Factorial is very simple β itβs basic recursion example, and simpler than Fibonacci, so seems a good base case from the recursion point of view * Tree traversal seems a great contrast example β depth-first traversal is fundamental non-trivial example of recursion (and very well-known), while breadth-first traversal is a basic motivating example of corecursion, which thus should have similar prominence. As this topic is potentially very abstract, and functional programming is often unfamiliar, concrete examples with imperative code (the Python is virtually pseudo-code, with the only confusing point being βyieldβ) should clarify it. Hope this helps, and please improve as you see fit! :βNils von Barth ([[User:Nbarth|nbarth]]) ([[User talk:Nbarth|talk]]) 17:50, 25 July 2012 (UTC) : In my opinion the difference between recursion and corecursion is best demonstrated in languages that make an explicit distinction between them (e.g. Coq or Agda). In Haskell the distinction is vague (because—ignoring strictness annotations—all data is codata), imperative language are perhaps even worse because recursion is less "natural" in those languages and they don't have algebraic data types. In Coq a "recursive function" is one that operates by structural recursion over data (i.e. its domain is data), while a "corecursive function" is one that has codata as it's result/range and operates by guarded recursion. Perhaps a strict function language such as ML or Scheme work better as all data their data is data and have to codata by explicit delay and forces. β''[[User:Ruud Koot|Ruud]]'' 19:22, 25 July 2012 (UTC)
Summary:
Please note that all contributions to Eurovision Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Eurovision Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit source
Add topic
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Tools
What links here
Related changes
Page information