Personal tools

Koans

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(begin fmt)
(fix link to koans)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
See [[Haikus]] for similar humor.
+
==#haskell==
  +
<blockquote><gwern> 'Once, a programmer came to sclv, saying I wish to learn the ways of Haskell.<br>
  +
How long would it take me, assiduously studying [[RWH]]?'<br>
  +
<gwern> 'sclv replied sagely, surely you could learn in 3 months.<br>
  +
The programmer replied, three months is too long!<br>
  +
What if I carefully recollect everything I know of my Java experience and study my computer science?'<br>
  +
<gwern> 'sclv thought, and told him, in that case, it will be no less than 4 months.<br>
  +
The programmer despaired, and said, no!<br>
  +
What if I study Knuth ferociously, and every minute of the day hack on C and Java and rewrite my programs in haskell?<br>
  +
Surely I will learn Haskell much quicker than 4 months!'<br>
  +
<gwern> 'sclv said, alas, in that case you will never learn Haskell.<br>
  +
If you wish to learn Haskell, empty your mind of all knowledge, and then you will be enlightened within the month.'</blockquote>
   
https://secure.wikimedia.org/wikipedia/en/wiki/Hacker_koan#Master_Foo
+
<blockquote><sclv> A student asks master wadler, what is the nature of a recursive type? Wadler replies: Mu.</blockquote> <!-- http://www.cse.unsw.edu.au/~dons/irc/haskell/08.05.22 -->
http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/
 
http://www.reddit.com/r/programming/comments/6twbn/the_koan_of_lazy_evaluation/
 
http://web.archive.org/web/20041012103936/http%3a//www.bagley.org/~doug/ocaml/Notes/okoans.shtml
 
http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/c04uzsl
 
http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html
 
   
==#haskell==
+
<blockquote>"gwern> a young novice spoke to #haskell, asking to be taught about the ways of the Maybe monad.<br>
<pre><gwern> 'Once, a programmer came to sclv, saying I wish to learn the ways of Haskell.
+
'What have you brought me to see?' asked the #haskeller.<br>
How long would it take me, assiduously studying RWH?'
+
'Nothing', replied the noob.<br>
<gwern> 'sclv replied sagely, surely you could learn in 3 months.
+
'Then take it away!'"[http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/c04uzsl]</blockquote>
The programmer replied, three months is too long!
 
What if I carefully recollect everything I know of my Java experience and study my computer science?'
 
<gwern> 'sclv thought, and told him, in that case, it will be no less than 4 months.
 
The programmer despaired, and said, no!
 
What if I study Knuth ferociously, and every minute of the day hack on C and Java and rewrite my programs in haskell?
 
Surely I will learn Haskell much quicker than 4 months!'
 
20:24:49 <gwern> 'sclv said, alas, in that case you will never learn Haskell.
 
If you wish to learn Haskell, empty your mind of all knowledge, and then you will be enlightened within the month.'</pre>
 
   
<pre><sclv> A student asks mater wadler, what is the nature of a recursive type? Wadler replies: Mu.</pre> <!-- http://www.cse.unsw.edu.au/~dons/irc/haskell/08.05.22 -->
+
<blockquote> -- undo -- The master Cale sometimes included do block examples while teaching new initiates. A very young student began to imitate him, and every time Cale typed 'do', this boy would type an example in imperative style. Everybody laughed.<br><br>
  +
One day Cale smiled and remained silent, listening to the laughter. The master leaned over and typed a private message to roshi lambdabot. The next time the boy typed to the roshi... she SHOUTED BACK HER REPLY. The boy began howling, and threatened to leave the temple. "Stop!" shouted Cale, and nodded to the roshi. The boy stopped, and looked at the master through his tears.<br><br>
  +
Cale typed 'do'. The boy pasted his usual do block enumerating paired martial artists' names. Then suddenly he realized it wasn't there, for lambdabot had applied (?pl . ?undo) to the paste. The boy hesitated a moment:<br><br>
  +
Then he bowed.<code> -- from a story about the master Gutei, adapted by sereven</code></blockquote>
   
 
==Unattributed==
 
==Unattributed==
A good programmer can write FORTRAN in any language; a great one could write Haskell.
+
<blockquote>"A good programmer can write FORTRAN in any language; a great one could write Haskell."</blockquote>
  +
  +
==See also==
  +
*[[Haskell haikus]]
  +
  +
==External links==
  +
*[http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/c04v5pc x=x+1 koan]
  +
*[https://secure.wikimedia.org/wikipedia/en/wiki/Hacker_koan AI Lab koans]
  +
** [https://secure.wikimedia.org/wikipedia/en/wiki/Hacker_koan#Master_Foo Imperative koan]
  +
* [http://www.reddit.com/r/programming/comments/6twbn/the_koan_of_lazy_evaluation/c04v086 The lazy deadlock koan]
  +
* [http://www.reddit.com/r/programming/comments/6twbn/the_koan_of_lazy_evaluation/c04v774 Lazy enlightenment]
  +
*[http://web.archive.org/web/20041012103936/http://www.bagley.org/~doug/ocaml/Notes/okoans.shtml "Functional Programming Koans, in OCaml"] -(and [http://web.archive.org/web/20040604082616/www.bagley.org/~doug/ocaml/Notes/okoans_answered.shtml answers])
  +
* [http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html Rich men have objects & closures]
   
<!-- [[Category:Humor]] -->
+
[[Category:Humor]]

Latest revision as of 16:58, 19 May 2012

Contents

[edit] 1 #haskell

<gwern> 'Once, a programmer came to sclv, saying I wish to learn the ways of Haskell.
How long would it take me, assiduously studying RWH?'
<gwern> 'sclv replied sagely, surely you could learn in 3 months.
The programmer replied, three months is too long!
What if I carefully recollect everything I know of my Java experience and study my computer science?'
<gwern> 'sclv thought, and told him, in that case, it will be no less than 4 months.
The programmer despaired, and said, no!
What if I study Knuth ferociously, and every minute of the day hack on C and Java and rewrite my programs in haskell?
Surely I will learn Haskell much quicker than 4 months!'
<gwern> 'sclv said, alas, in that case you will never learn Haskell.
If you wish to learn Haskell, empty your mind of all knowledge, and then you will be enlightened within the month.'
<sclv> A student asks master wadler, what is the nature of a recursive type? Wadler replies: Mu.
"gwern> a young novice spoke to #haskell, asking to be taught about the ways of the Maybe monad.
'What have you brought me to see?' asked the #haskeller.
'Nothing', replied the noob.
'Then take it away!'"[1]
-- undo -- The master Cale sometimes included do block examples while teaching new initiates. A very young student began to imitate him, and every time Cale typed 'do', this boy would type an example in imperative style. Everybody laughed.

One day Cale smiled and remained silent, listening to the laughter. The master leaned over and typed a private message to roshi lambdabot. The next time the boy typed to the roshi... she SHOUTED BACK HER REPLY. The boy began howling, and threatened to leave the temple. "Stop!" shouted Cale, and nodded to the roshi. The boy stopped, and looked at the master through his tears.

Cale typed 'do'. The boy pasted his usual do block enumerating paired martial artists' names. Then suddenly he realized it wasn't there, for lambdabot had applied (?pl . ?undo) to the paste. The boy hesitated a moment:

Then he bowed. -- from a story about the master Gutei, adapted by sereven

[edit] 2 Unattributed

"A good programmer can write FORTRAN in any language; a great one could write Haskell."

[edit] 3 See also

[edit] 4 External links