Personal tools

Koans

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
m (User:Gwern/Koans moved to Koans)
(fix link to koans)
 
(2 intermediate revisions by one user not shown)
Line 18: Line 18:
 
'Nothing', replied the noob.<br>
 
'Nothing', replied the noob.<br>
 
'Then take it away!'"[http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/c04uzsl]</blockquote>
 
'Then take it away!'"[http://www.reddit.com/r/programming/comments/6tytl/functional_programming_koans/c04uzsl]</blockquote>
  +
  +
<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==
Line 31: Line 36:
 
* [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/c04v086 The lazy deadlock koan]
 
* [http://www.reddit.com/r/programming/comments/6twbn/the_koan_of_lazy_evaluation/c04v774 Lazy enlightenment]
 
* [http://www.reddit.com/r/programming/comments/6twbn/the_koan_of_lazy_evaluation/c04v774 Lazy enlightenment]
*[http://web.archive.org/web/20041012103936/http%3a//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://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]
 
* [http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html Rich men have objects & closures]
   

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