Koans

From HaskellWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

#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

Unattributed

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

See also

External links