Created
January 15, 2021 15:45
-
-
Save SteveAlexander/c4ea40f75c2b0742a00d9852597f8fdc to your computer and use it in GitHub Desktop.
Levels of abstraction of computation in Dart — see http://worrydream.com/#!2/LadderOfAbstraction
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
String level0() { | |
return "asd"; | |
} | |
Future<String> level1Async() async { | |
await Future.delayed(Duration(seconds: 1), () {}); | |
return "asd"; | |
} | |
Iterable<String> level1Iteration() sync* { | |
yield "a"; | |
yield "s"; | |
yield "d"; | |
} | |
Stream<String> level2IterationAndAsync() async* { | |
yield "a"; | |
await Future.delayed(Duration(seconds: 1), () {}); | |
yield "s"; | |
yield "d"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment