Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 9 of 13

42 minutes, 6 seconds


Right click “Save as…”

In Chapter 9, Interactive Programs, Dr. Meijer will teach us how to make programs in Haskell that are side-effecting:
interactive. Haskell programs are pure mathematical functions with no side effects. That said, you want to be able to write Haskell programs that can read input from the keyboard and write output to the screen which are in fact side effects. So, interactive programs have side effects... Interactive programs can be written in Haskell by using types to distinguish pure expressions from impure actions that may involve side effects.

Consider the following:

IO a
The type of actions that return values of type a

IO Char
The type of actions that return a character

The type of purely side effecting actions that return no result value|

Warning: This lecture may contain the use of the term Monad. Do not fear. Everything will be OK. Smiley

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Get the presentation slides here

Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5

Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13



Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • Until this US Thanksgiving, I never realized that monads and turkey go together so well!  Thank you Erik for your excellent tutorials.  Hopefully the future of code will be more sane from your efforts  =)

  • Bent Rasmussenexoteric stuck in a loop, for a while

    To be sure: once an expression involves IO, is it possible to ever derive a type that is not IO'd from it? I suspect not.


    Thanks for the palm tree. It's a great place to be lazy, as its recursive structure bends over the ever-changing sea of waves.

  • You can do that using my all time favorite non-function unsafePerformIO :: IO a -> a. Keep in mind that as the name warns you, it is unsafe, very unsafe.

  • I'm having a problem downloading or displaying this video. When downloading it gets to 6% and stops.  If I try and display it in the in-line Silverlight player and skip forward to eight minutes or so it has a media failure.  I'm seeing the same problem with many of the PDC videos, e.g (WMV high):




  • In essence, the point of the IO monad is to "tag" values as IO when there's a possibility of state.  Once you enter the dimension of state, you can of course not remove the idea that side effects have occured.  Therefore, it is recommended to keep your code pure.


    Using do-notation and the monadic functions, it isn't too hard to make working with monads not too difficult, and for some, fun  =)

  • Bent Rasmussenexoteric stuck in a loop, for a while

    Now to examine why anyone would want to soil an otherwise clean language, i.e. the use-cases.

  • I cannot download or play WMV file.  Download stops at about 8%.

  • CharlesCharles Welcome Change

    Where are you located?

  • Download of WMV finishes for me after 7.90 MB. Please don't make me download WMV (High) !

    I am in New Zealand.

    In general downloading this video series has been very slow. It looks like the maximum bandwidth is about 200KBytes/s . Normally I can get 900K - 1.2 MBytes/s from microsoft.


    Still - it is an extremely interesting series and very worthwhile. Even if it just turns out (for me) to be background to F# and Linq.


  • Luciano Evaristo GuercheguercheLE guerchele

    Nice you are linking to all previous sessions so it makes easier to get back in time and review what have being said before. You guys rock!

  • Charles,


    I am in New Zealand too.  I'm having problems downloading this file from Channel 9 and a large number of files from the PDC conference.



  • CharlesCharles Welcome Change

    Hmm. Could be do to our CDN (and the distance from you or lack of a node in your region?). I will FW this info to Duncan.


  • I'm in the UK and I had major problems downloading PDC videos. This one seems fine though.

  • I am having the same problems. I live in Australia. The downloading stops after a few minutes (using IE).

  • CharlesCharles Welcome Change

    Interesting. I will pass this info along to our CDN team.


  • I can't download this AVI (using IE). The downloading stops after a few minutes. Same if I use the Silverlight player. I live in Australia and have no problems downloading AVI's from other sites (.NET Rocks, IT Conversations etc.)

  • I'm another C9 member in New Zealand having the same download problems as others here ...

  • Erik has mentioned "the forums" several times now.


    Please can someone supply the Url ?




  • Bent Rasmussenexoteric stuck in a loop, for a while


    ...And of course, most of all, the thread associated with every lecture video (that would be this one, for example.)

    There's also a fb group for this series, but that's mostly for historical reasons, and for disseminating the content...

  • Hi Charles,


    I'm in New Zealand.  I've just tried to download it again and it still does not work.

    WMV and WMV (High) are both broken. Is there and alternative download site?




  • Hi Charles,

    I'm in New Zealand.  I've just re-tried to download WMV and WMV (High) and both downloads fail.

    Is there an alternative download site?





  • I'm in Australia, also can't download any versions of this. Can you let us know what the progress is with resolving this.



    - Des

  • Hi Charles


    Just confirming the experience of others ... downloads to NZ are still broken. The download typically stops after approx 8 MB.


    I have been enjoying this series so hope this can be sorted out soon. Thanks!

  • I just tried downloading it again today and still the same problem. The download stops after a few minutes. I have tried with both IE and Firefox. I live in Australia and can download from other US websites without any problem.

  • Thanks to whoever fixed up the download problem.  I finally have all 400MB of it.

  • Wow, spam comments on a discussion about fundamentalist functional programming. That means we have really hit the mainstream baby!!!!!

  • CharlesCharles Welcome Change



    Banned spammer. Removed spam.


  • Reach Hasan :-)reachhasan Reach Hasan

    I also have the same problems downloading the mp4 or low-res wmv files. I have tried to download them from two different ISPs Sad in Australia.


    I used to be able to download those files within less than 10 minutes. Now, after 3-5 minutes(10-20%)  the connection is lost.

  • CharlesCharles Welcome Change

    We have alerted our CDN provider. We have provided the trace data some of you have shared (thanks for that). Waiting to hear back.


  • Reach Hasan :-)reachhasan Reach Hasan



    I tried again after reading your reply twice downloading the mp4 and low-res wmv. Still could only download 10% of it. The initial speed is very fast  but after 2-3 minutes it started to drop to zero.

  • CharlesCharles Welcome Change

    We do not know what the problem is. Our CDN is supposed to be figuring it out....


  • Especially for all our Australian viewers we have a very special episode 11, so keep on watching and let's hope that the download problems are fixed by then ...

  • CharlesCharles Welcome Change

    We will have the issue resolved by 10 (or close to 10 or not too far from 10). Smiley







  • Reach Hasan :-)reachhasan Reach Hasan

    Hi Charles,


    I could download it now. Though the speed sometimes fluctuated and was slow. It took me 10 minutes just to download the mp4.


    By the way, I wonder whether there will be series talking about F# as this is a "new" language from MS.


    It would be good to compare how to do something in F# and Haskell.



  • CharlesCharles Welcome Change

    This basic problem is currently being fixed by ECN. Sorry for the inconvenience. You should be able to download successfully from locations in Australia and New Zealand.


  • Timothy Walkercat77xx Life is great!

    Overall general comment: Microsoft is the best thing to ever happen to the pursuit of higher knowledge by human beings. It is truly sad when competitors attack Microsoft. Are these same competitors giving even 1/10th of what MS gives for FREE to the average computer users? I think not. 

  • Hey Erik , I love the series, can you do some more advanced topics when you finish the book, maybe analyze some paper you find interesting (like your paper of recursion schemes -titlte was sth like Glasess, Bananas etc - ? I know it might be tiring to do all these casts but i would very much like to see you explain some advanced topics since you are very good at explaining stuff.

  • That is a good idea, do a C9 "study group" on advanced FP. We'll need to convince Charles to provide studio and air time. There is plenty more to discuss!

  • CharlesCharles Welcome Change

    No need for covincing, my friend. You got it! I love this idea. I would also like to get some other folks involved in the advanced study group series of conversations/lectures (like Luke Hoban and the F# people). We could do this for C# as well. And, dare I say, C++ Smiley



  • Charles, thanks for the support of the Idea , here are some of the topics i would love for Erik to cover or anyone have a discussion about them (from the top of my head) : 


    Applicative functors and Parsec

    Monads (Writer, State, ST) and MonadTransformers




    STM examples (there are some videos explaining the basics by SPJ)

    Recursion Schemes (anamorphisms , catamorphisms)

    Combinators (SK)

    I'm sure i'm forgetting some of them, but I would really love your and Erik's take on these subjects.




  • CharlesCharles Welcome Change

    In terms of Monads, Brian Beckman has covered the State Monad in detail here and here.


    Thanks for the topic list. Smiley


    You will learn about Zippers and much more very soon in an upcoming conversation with Jeffrey Van Gogh and Bart De Smet.


  • I'd like to add my +1 for QuickCheck, and for Applicative.  Been enjoying this series a whole lot!  Thanks!

  • Bent Rasmussenexoteric stuck in a loop, for a while

    I vote for arrows, when we've covered all about monads.


    They look like a way to model function composition. In a way monads look like that too, so I wonder what the differences are and when to use what.

Remove this comment

Remove this thread


Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.