On 4/20/13 12:56 AM, Andres Osinski wrote:
Reading through the docs it seems as though cell contains an Option, and
Option just contains the value or None, much like Haskell Maybe monad. I
fail to see what use cell has that cannot be done with Option.

Cell allows you to more clearly specify your intent. You can do everything with Cell with Option--it's called the "option dance"--but it can be harder to read.

In particular, Cell is preferred over Option when working around the current lack of one-shot closures (i.e. when you want to move out of a closure).

Patrick

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to