Created
May 5, 2016 09:56
-
-
Save quintesse/90f94237737eacd357e83062af47ef4f to your computer and use it in GitHub Desktop.
Ceylon Web Runner: flatten
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
//$webrun_wrapped | |
shared void run() { | |
{Anything*} flatten({Anything*} stream) | |
=> stream.flatMap((element) | |
=> switch (element) | |
case (is {Anything*}) flatten(element) | |
else [element]); | |
{Character|String*} input = { 'a', "abc" }; | |
print(flatten(input)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Click here to run this code online