News for hackers. Stuff that matters.
Re:Fizzbuzz, Interviews, And Overthinking by KirinDave on Thursday October 04, 2012 @11:12PM (#4615520)
> How is Maybe not morally equivalent to a conditional?

Maybe is a way to represent conditionals that is amenable to higher order patterns. if-then-else conditionals are simply that, whereas Maybe is amenable to Monad, Monoid, and Applicative functor laws. So when we pull out mconcat or <> or mappend, we're actually talking about a higher order pattern.

As I mentioned in the article, we could take that same fizzbuzz code and modify it in many ways under the monoid rules. For example, a different harness in the main function could use Map String Integer and completely change the behavior with the same fizzbuzz function.

There are no comments on this comment yet.