learn haskell

Coding/Explaining Session  — 1 year ago

I was over at my Haskell buddy Olav’s, and he talked Haskell with me for a couple hours.

His definition of monads was very good, at least to growing my understanding: “They implement the imperative programming paradigm that is going to be used in the imperative parts of your program.”

We looked at the List monad, the IO monad, and also some random-number generation stuff. He had done a Markov chain maker, which we ran on some text. Pretty neat: the thing that took up most of the code was getting a new Random number each time you entered the Random monad (is there one of those?).

The Markov chain program used “take 50” from an infinite list. Infinite lists, they seem to be a staple of functional style. How do you use them?

Comments:

Olle Jonsson has gotten 1 cheer on this entry.

 

I want to: