News for hackers. Stuff that matters.
Re:Null Object Pattern in Swift by sjtgraham on Wednesday November 11, 2015 @08:39PM (#10550761)
The maybe monad is good way to deal with computations that may fail. Here is a Swift walkthrough http://www.mokacoding.com/blog/functor-applicative-monads-in...
Re:Null Object Pattern in Swift by ashark on Wednesday November 11, 2015 @08:54PM (#10550805)
Every time I read about monads I feel stupid, but it's not always for the same reason. Sometimes it's because I don't understand it. Other times it's because I'm pretty sure I do understand it but I can't see what the big deal is.
Re:Null Object Pattern in Swift by cballard on Wednesday November 11, 2015 @09:24PM (#10550897)
A monad in Swift terms is essentially just a container type with an initializer that lets you put something in it, and implements flatMap. In Haskell, the equivalents are return and >>=. You can do more with it in Haskell because Monad is essentially a protocol, so you can rely on monadic types having those functions defined in terms of them.

Array and Optional are examples. RAC's SignalProducer is... maybe one? Maybe three?

That's really all there is.

Re:Null Object Pattern in Swift by runT1ME on Wednesday November 11, 2015 @09:19PM (#10550882)
Ah. The big deal is some languages can abstract over the idea of an arbitrary monad. You are correct though, most monads are not a big deal and fall into the "oh neat that's useful" category, and not the "omfg" one.

The abstracting over them is pretty mind blowing though.