> I think my brainwashing may be complete - I looked at some Obj-C code the 
> other day and immediately saw a potential monad.
> 
> (for the curious: there's a Maybe monad in Haskell which can be used to 
> string together a sequence of operations which may or may not return a 
> result. A sequence of Object#try calls would be the equivalent in ruby. This 
> lends itself particularly well to a series of possibly-failing setup 
> commands.)

You guys may want to check out @nkpart's adt gem [1], you can encode Maybe in 
it very easily [2]. It's pretty sweet to use, we've replaced a lot of custom 
code with it (which is why Nick wrote it).

Tom

[1] http://rubygems.org/gems/adt
[2] https://github.com/nkpart/adt/blob/master/examples/common_adts.rb
-- 
tom adams
[email protected]



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to