News for hackers. Stuff that matters.
Re:Railway-oriented programming by dllthomas on Friday June 13, 2014 @08:24PM (#7891569)
Reading LYAH or the wikibook might be a better way to go, but I don't like it when people say "go read a bunch of stuff" to me, either, so I'll try to help...

Do you want a step-by-step guide for implementing a monad, or using a monad?

The first thing to realize is that Monad is a design pattern. Like any design pattern, it's more applicable to some goals than others.

Could you clarify a bit?

"right, I have these two functions, one looks like `x = 1` and the next looks like `incr y = y+1`, what do I call on what to combine them with a monad, then how do I define a monad which only calls the latter if the former returns 1?"

The best interpretation I can come to is that you want some plumbing that will hide an implicit check that the value being passed along is 1? This would not fit "monad" well - for reasons I can get into if that's actually what you're asking.

There are no comments on this comment yet.