 
 printResult(failedString)
 printResult(failedVoid)
-
-print()
-
-/*:
- Similarly, you can use a special initializer to create a Result with a returning-or-throwing function.
- Here we create two Results and then print their values without ever touching enum cases or switch statements.
-
- > `init(create:)` and `value` are like other frameworks' `materialize` and `dematerialize`.
- */
-
-let successfulIntArray = Result {
-    return [1, 2, 3, 4]
-}
-
-let failedIntArray = Result<[Int]> {
-    throw someError
-}
-
-printResult(successfulIntArray)
-printResult(failedIntArray)
 
 print()
 


/*:
 > Look at the Debug console to see what's printed.

 But it's even more Swifty to use the `value` function to determine the case.
 `value` returns the value for `.Success` or throws the error for `.Failure`.
 */

func printResult<T>(result: Result<T>) {

func getJSONAndParseValueWithCompletion(completion: ((Result<Int>) -> Void)?) {
    delay(3.0) {
        // Suppose we did a network request to get this response body from an API.
        let jsonStringResult = Result { "{ \"key\": 101 }" }

        let parsedValueResult: Result<Int> = jsonStringResult.tryMap { jsonString in
            // Interpret the response body as JSON.
