Monads you already use (without knowing it)

Monads are a little bit like Quantum Physics: If you think you understand quantum mechanics, you don't understand quantum mechanics.

Monads are very useful for chaining computation together, in a simple way. The best explanation I've heard for them so far is that they are `programmable semicolons'.

In this session, I'll describe a few patterns that are solved by monads in some FP languages, and how you are already using them.

Some monads I plan to cover:

* Maybe Monad (being the easiest to explain)

* List monad, and how it is used to model non-determinism

* The state monad

* The IO monad

And maybe a few others

 
1 favorite thumb_down thumb_up 7 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist
 

Outline/structure of the Session

Intro to talk

Brief tongue in cheek definitions of monads => Programmable semicolons, Boxes to put things in, etc...

Brief Intro to classical definition of monads

A simple monad with the Maybe Monad, starting with nil and getting to the monad.

List Monad for non determinism

Other monads as time permits.

Learning Outcome

This talk is mostly aimed at Beginner programmers. After this talk, programmers should have some basic idea of the things monads are used for, and some equivalent patterns in the non-FP world.

Target Audience

Developers

schedule Submitted 2 years ago

Comments Subscribe to Comments

comment Comment on this Proposal
  • Dhaval Dalal
    By Dhaval Dalal  ~  3 months ago
    reply Reply

    Hi Tejas,

        Thank-you for submitting the proposal. It would be really good to see this in action as a Demonstration.  With a topic such as this, its best to show than tell.  While a little bit of concepts as you have put in would not harm, but to jump to demo (either by live coding or pre-recorded screencast) at first opportunity would make it a palpable proposition for the audience at beginner level.  Do you think you can do that?

    thanks,

    Dhaval.

     

    • Tejas Dinkar
      By Tejas Dinkar  ~  2 years ago
      reply Reply

      I actually gave a part of this talk as a lightning talk at Deccan RubyConf, the day I submitted it.

      I have slides here: https://github.com/gja/gcrc-2013-talk (monads.key). In that talk, I introduce the list monad, via ruby code.

      I've never seen a good job of live coding, so what I do is screenshot my coding sessions.

       

      • Dhaval Dalal
        By Dhaval Dalal  ~  3 months ago
        reply Reply

        Thats good, screenshots is a good option in place of live coding.  That would help grasp better, IMHO, code slides are discrete-continuous, but screenshot is all continuous-continuous in terms of visual-thought allowing better cognition.

    • Tejas Dinkar
      By Tejas Dinkar  ~  2 years ago
      reply Reply

      Slides here: https://speakerdeck.com/gja/lightning-monads-you-already-use-without-knowing-it

  • Naresh Jain
    By Naresh Jain  ~  2 years ago
    reply Reply

    Tejas, thanks for the interesting proposal. Currently this might be the only Monads talk that might make it into the program. Given that, would you consider expanding the scope of the talk and may be bumping up the time to 45 mins to ensure you have enough time to cover enough ground?

    • Tejas Dinkar
      By Tejas Dinkar  ~  2 years ago
      reply Reply

      I think 45 minutes would be pushing it a bit much. I can probably make this into a 30 minute session (including questions). If I really have to do a 45 minute talk, I can try to stretch it, but I think it will get boring. Possibly I can cover how to do these monads in different languages to make this longer.

      Maybe 25 minutes of Lightning talks would be better?

      • Tejas Dinkar
        By Tejas Dinkar  ~  2 years ago
        reply Reply

        I think I could probably do this for 45 minutes. I guess different work arounds in different languages would also be cood.