This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // TweetbotViewController.m | |
| // testingTweetbotCell | |
| // | |
| // Created by Niels Hansen on 12-12-04. | |
| // Copyright (c) 2012 Niels Hansen. All rights reserved. | |
| // | |
| #import "TweetbotViewController.h" | |
| #import "TweetbotInfoCell.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function maybe(value) { | |
| var obj = null; | |
| function isEmpty() { return value === undefined || value === null } | |
| function nonEmpty() { return !isEmpty() } | |
| obj = { | |
| map: function (f) { return isEmpty() ? obj : maybe(f(value)) }, | |
| getOrElse: function (n) { return isEmpty() ? n : value }, | |
| isEmpty: isEmpty, | |
| nonEmpty: nonEmpty | |
| } |