Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- Option<double> safeDivision(int a, int b) => (b==0) ? None() : Some(a/b);
- final Option<double> a = safeDivision(2, 0); // None
- final Option<double> b = safeDivision(4, 2); // Some(2)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement