Hacker News new | past | comments | ask | show | jobs | submit login
Railway Oriented Programming (fsharpforfunandprofit.com)
73 points by gnuvince on March 8, 2015 | hide | past | favorite | 6 comments



Thinking in terms of railways just made every monad tutorial I've tried to puzzle my way through instantly click in my mind. I/O monads? They're just sugar to help you maintain a parallel railway track of accumulated I/O side effects, while still thinking in terms of your primary track and what it emits!

If you're confused at all about monads, you're a visual learner, and you're tired of Yet Another Monad Tutorial, the slide deck in this link should be absolutely mandatory viewing. It's one of those things that is just the perfect mix of conciseness and humor, and I'm probably going to look back on this as "How I Learned To Stop Worrying And Love Functional Programming."


Totally on track, but as a tiny nit: "do"-notation is syntax sugar, but the IO monad is the rail and the rail-building operations themselves!


"On track" - I see what you did there. Absolutely correct, "sugar" was the wrong word to use.


Another railway oriented article I enjoyed when it was on HN: http://fsharpforfunandprofit.com/posts/recipe-part2/



This is an excellent notation. I commend the author and will be using the metaphor myself.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: