├── Chapter11 ├── Ch11-Backend │ ├── vapor-example │ │ ├── .swift-version │ │ ├── Config │ │ │ ├── secrets │ │ │ │ ├── .gitkeep │ │ │ │ └── app.json │ │ │ ├── development │ │ │ │ └── app.json │ │ │ ├── production │ │ │ │ ├── app.json │ │ │ │ └── servers.json │ │ │ ├── app.json │ │ │ └── servers.json │ │ ├── Procfile │ │ ├── .gitignore │ │ ├── Resources │ │ │ └── Views │ │ │ │ ├── template.leaf │ │ │ │ ├── embeds │ │ │ │ └── header.leaf │ │ │ │ └── welcome.html │ │ ├── .DS_Store │ │ ├── Localization │ │ │ ├── en.json │ │ │ ├── es.json │ │ │ └── default.json │ │ ├── Public │ │ │ ├── images │ │ │ │ └── vapor-logo.png │ │ │ └── styles │ │ │ │ └── app.css │ │ ├── app.json │ │ ├── .travis.yml │ │ ├── Package.swift │ │ ├── Sources │ │ │ └── App │ │ │ │ ├── Middleware │ │ │ │ └── SampleMiddleware.swift │ │ │ │ └── Models │ │ │ │ └── User.swift │ │ └── LICENSE │ └── .DS_Store └── Ch11-Frontend │ ├── TodoApp │ ├── Pods │ │ ├── Target Support Files │ │ │ ├── Argo │ │ │ │ ├── Argo-prefix.pch │ │ │ │ ├── Argo.modulemap │ │ │ │ ├── Argo-dummy.m │ │ │ │ ├── Argo-umbrella.h │ │ │ │ ├── Argo.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Curry │ │ │ │ ├── Curry-prefix.pch │ │ │ │ ├── Curry.modulemap │ │ │ │ ├── Curry-dummy.m │ │ │ │ ├── Curry-umbrella.h │ │ │ │ ├── Curry.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Delta │ │ │ │ ├── Delta-prefix.pch │ │ │ │ ├── Delta.modulemap │ │ │ │ ├── Delta-dummy.m │ │ │ │ ├── Delta-umbrella.h │ │ │ │ ├── Delta.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Result │ │ │ │ ├── Result-prefix.pch │ │ │ │ ├── Result.modulemap │ │ │ │ ├── Result-dummy.m │ │ │ │ ├── Result-umbrella.h │ │ │ │ ├── Result.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Runes │ │ │ │ ├── Runes-prefix.pch │ │ │ │ ├── Runes.modulemap │ │ │ │ ├── Runes-dummy.m │ │ │ │ ├── Runes-umbrella.h │ │ │ │ ├── Runes.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Alamofire │ │ │ │ ├── Alamofire-prefix.pch │ │ │ │ ├── Alamofire.modulemap │ │ │ │ ├── Alamofire-dummy.m │ │ │ │ ├── Alamofire-umbrella.h │ │ │ │ ├── Alamofire.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── ReactiveCocoa │ │ │ │ ├── ReactiveCocoa-prefix.pch │ │ │ │ ├── ReactiveCocoa-dummy.m │ │ │ │ ├── ReactiveCocoa.modulemap │ │ │ │ ├── ReactiveCocoa.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── ReactiveSwift │ │ │ │ ├── ReactiveSwift-prefix.pch │ │ │ │ ├── ReactiveSwift.modulemap │ │ │ │ ├── ReactiveSwift-dummy.m │ │ │ │ ├── ReactiveSwift-umbrella.h │ │ │ │ ├── ReactiveSwift.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Pods-TodoApp │ │ │ │ ├── Pods-TodoApp.modulemap │ │ │ │ ├── Pods-TodoApp-dummy.m │ │ │ │ ├── Pods-TodoApp-umbrella.h │ │ │ │ └── Info.plist │ │ │ └── Pods-TodoAppTests │ │ │ │ ├── Pods-TodoAppTests.modulemap │ │ │ │ ├── Pods-TodoAppTests-dummy.m │ │ │ │ ├── Pods-TodoAppTests-acknowledgements.markdown │ │ │ │ ├── Pods-TodoAppTests-umbrella.h │ │ │ │ ├── Pods-TodoAppTests.debug.xcconfig │ │ │ │ ├── Pods-TodoAppTests.release.xcconfig │ │ │ │ ├── Info.plist │ │ │ │ └── Pods-TodoAppTests-acknowledgements.plist │ │ ├── ReactiveCocoa │ │ │ ├── ReactiveCocoa │ │ │ │ ├── NSObject+ReactiveExtensionsProvider.swift │ │ │ │ ├── module.modulemap │ │ │ │ ├── Deprecations+Removals.swift │ │ │ │ ├── UIKit │ │ │ │ │ ├── UITableView.swift │ │ │ │ │ ├── UICollectionView.swift │ │ │ │ │ ├── UIProgressView.swift │ │ │ │ │ ├── UIActivityIndicatorView.swift │ │ │ │ │ ├── UIImageView.swift │ │ │ │ │ ├── iOS │ │ │ │ │ │ ├── UIDatePicker.swift │ │ │ │ │ │ ├── UIStepper.swift │ │ │ │ │ │ ├── UISwitch.swift │ │ │ │ │ │ ├── UISlider.swift │ │ │ │ │ │ └── UIRefreshControl.swift │ │ │ │ │ ├── ReusableComponents.swift │ │ │ │ │ ├── UIBarItem.swift │ │ │ │ │ ├── UISegmentedControl.swift │ │ │ │ │ ├── UILabel.swift │ │ │ │ │ ├── UIView.swift │ │ │ │ │ ├── UIGestureRecognizer.swift │ │ │ │ │ ├── UIBarButtonItem.swift │ │ │ │ │ ├── UIButton.swift │ │ │ │ │ └── UIScrollView.swift │ │ │ │ ├── ReactiveCocoa.h │ │ │ │ ├── Shared │ │ │ │ │ ├── NSLayoutConstraint.swift │ │ │ │ │ └── MKMapView.swift │ │ │ │ ├── NSObject+ObjCRuntime.swift │ │ │ │ ├── ObjCRuntimeAliases.m │ │ │ │ ├── ObjCRuntimeAliases.h │ │ │ │ ├── NSObject+Synchronizing.swift │ │ │ │ ├── ObjC+Runtime.swift │ │ │ │ ├── CocoaTarget.swift │ │ │ │ ├── NSObject+BindingTarget.swift │ │ │ │ ├── ObjC+Constants.swift │ │ │ │ └── ObjC+Selector.swift │ │ │ └── LICENSE.md │ │ ├── Argo │ │ │ ├── Sources │ │ │ │ └── Argo │ │ │ │ │ ├── Extensions │ │ │ │ │ ├── NSNumber.swift │ │ │ │ │ ├── Dictionary.swift │ │ │ │ │ └── RawRepresentable.swift │ │ │ │ │ ├── Operators │ │ │ │ │ └── Argo.swift │ │ │ │ │ ├── Types │ │ │ │ │ ├── Decoded │ │ │ │ │ │ ├── FailureCoalescing.swift │ │ │ │ │ │ ├── Alternative.swift │ │ │ │ │ │ └── Functor.swift │ │ │ │ │ └── Decodable.swift │ │ │ │ │ └── Functions │ │ │ │ │ └── flatReduce.swift │ │ │ └── LICENSE │ │ ├── Delta │ │ │ ├── Sources │ │ │ │ ├── Delta.h │ │ │ │ ├── Action.swift │ │ │ │ └── DynamicAction.swift │ │ │ └── LICENSE │ │ ├── ReactiveSwift │ │ │ ├── Sources │ │ │ │ ├── ResultExtensions.swift │ │ │ │ ├── Optional.swift │ │ │ │ └── Reactive.swift │ │ │ └── LICENSE.md │ │ ├── Local Podspecs │ │ │ ├── Delta.podspec.json │ │ │ ├── Curry.podspec.json │ │ │ └── ReactiveCocoa.podspec.json │ │ ├── Result │ │ │ └── LICENSE │ │ ├── Curry │ │ │ └── LICENSE │ │ ├── Runes │ │ │ └── LICENSE │ │ ├── Alamofire │ │ │ └── LICENSE │ │ └── Manifest.lock │ ├── .DS_Store │ ├── TodoApp.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── TodoApp │ │ ├── Actions │ │ │ ├── SetFilterAction.swift │ │ │ ├── DeleteTodoAction.swift │ │ │ ├── ClearCompletedTodosAction.swift │ │ │ ├── LoadTodosAction.swift │ │ │ ├── CreateTodoAction.swift │ │ │ ├── ToggleCompletedAction.swift │ │ │ ├── UpdateTodoAction.swift │ │ │ └── DetailsTodoAction.swift │ │ ├── Models │ │ │ ├── TodoViewModel.swift │ │ │ ├── TodosViewModel.swift │ │ │ ├── RequestProtocol.swift │ │ │ ├── Todo.swift │ │ │ └── TodoRequest.swift │ │ ├── Stores │ │ │ └── Store.swift │ │ ├── State │ │ │ └── State.swift │ │ ├── Extensions │ │ │ └── ReactiveCocoa.swift │ │ ├── Communication │ │ │ └── Urls.swift │ │ ├── Resources │ │ │ └── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ └── Views │ │ │ └── FooterView.swift │ ├── TodoApp.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Podfile │ ├── TodoAppTests │ │ ├── Info.plist │ │ └── TodoAppTests.swift │ └── Podfile.lock │ └── .DS_Store ├── Chapter01 └── Playgrounds │ ├── .DS_Store │ └── Ch01-Introduction.playground │ ├── playground.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── nayefa.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ ├── Pages │ ├── Immutability.xcplaygroundpage │ │ └── Contents.swift │ ├── LazyEvaluation.xcplaygroundpage │ │ └── Contents.swift │ ├── Initialization.xcplaygroundpage │ │ └── Contents.swift │ ├── Methods.xcplaygroundpage │ │ └── Contents.swift │ ├── Tuples.xcplaygroundpage │ │ └── Contents.swift │ ├── ARC.xcplaygroundpage │ │ └── Contents.swift │ ├── Generics.xcplaygroundpage │ │ └── Contents.swift │ ├── Subscripts.xcplaygroundpage │ │ └── Contents.swift │ ├── ErrorHandling.xcplaygroundpage │ │ └── Contents.swift │ ├── Types.xcplaygroundpage │ │ └── Contents.swift │ ├── DeclarativeImperative.xcplaygroundpage │ │ └── Contents.swift │ ├── Protocols.xcplaygroundpage │ │ └── Contents.swift │ ├── Collections.xcplaygroundpage │ │ └── Contents.swift │ ├── Strings.xcplaygroundpage │ │ └── Contents.swift │ ├── AnyAnyObject.xcplaygroundpage │ │ └── Contents.swift │ ├── Optionals.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── Enumerations.xcplaygroundpage │ │ └── Contents.swift │ ├── MapFilterReduce.xcplaygroundpage │ │ └── Contents.swift │ ├── Functions.xcplaygroundpage │ │ └── Contents.swift │ ├── ModernSyntax.xcplaygroundpage │ │ └── Contents.swift │ └── NestedTypes.xcplaygroundpage │ │ └── Contents.swift │ ├── Resources │ └── Ch01-Introduction.playground │ │ ├── Pages │ │ ├── Immutability.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── LazyEvaluation.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Initialization.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Methods.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Tuples.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── ARC.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Generics.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── ErrorHandling.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Subscripts.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Types.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── DeclarativeImperative.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Protocols.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Collections.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── AnyAnyObject.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Strings.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Optionals.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── TableOfContents.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Enumerations.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── MapFilterReduce.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Functions.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── ModernSyntax.xcplaygroundpage │ │ │ └── Contents.swift │ │ └── NestedTypes.xcplaygroundpage │ │ │ └── Contents.swift │ │ ├── Resources │ │ └── Ch01-Introduction.playground │ │ │ ├── Pages │ │ │ └── ARC.xcplaygroundpage │ │ │ │ └── Contents.swift │ │ │ └── contents.xcplayground │ │ └── contents.xcplayground │ └── contents.xcplayground ├── Chapter02 └── Playgrounds │ ├── .DS_Store │ └── Ch02-FuncsClosures.playground │ ├── Pages │ ├── FirstClassFunctions.xcplaygroundpage │ │ └── Contents.swift │ ├── NestedFunctions.xcplaygroundpage │ │ └── Contents.swift │ ├── TailRecursion.xcplaygroundpage │ │ └── Contents.swift │ ├── CapturingValues.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── FunctionComposition.xcplaygroundpage │ │ └── Contents.swift │ ├── Memoization.xcplaygroundpage │ │ └── Contents.swift │ ├── Recursion.xcplaygroundpage │ │ └── Contents.swift │ ├── FunctionCurrying.xcplaygroundpage │ │ └── Contents.swift │ └── HigherOrderFunctions.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter03 └── Playgrounds │ ├── .DS_Store │ └── Ch03-Types.playground │ ├── Pages │ ├── TypeCheckingCasting.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── MixingValueReferenceTypes.xcplaygroundpage │ │ └── Contents.swift │ ├── Copying.xcplaygroundpage │ │ └── Contents.swift │ ├── EqualityVsIdentity.xcplaygroundpage │ │ └── Contents.swift │ ├── CopyingReferenceTypes.xcplaygroundpage │ │ └── Contents.swift │ ├── EquatableComparable.xcplaygroundpage │ │ └── Contents.swift │ └── ValueVsReferenceTypes.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter04 └── Playgrounds │ ├── .DS_Store │ └── Ch04-EnumsPatternMatching.playground │ ├── Pages │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── Definition.xcplaygroundpage │ │ └── Contents.swift │ └── PatternMatching.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter05 └── Playgrounds │ ├── .DS_Store │ └── Ch05-Generics.playground │ ├── playground.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── nayefa.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ ├── Pages │ ├── SubclassingGenericClasses.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── ExtendingGenericTypes.xcplaygroundpage │ │ └── Contents.swift │ └── GenericDataStructures.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter06 └── Playgrounds │ ├── .DS_Store │ └── Ch06-MapFilterReduce.playground │ ├── Pages │ ├── Zip.xcplaygroundpage │ │ └── Contents.swift │ ├── Joined.xcplaygroundpage │ │ └── Contents.swift │ ├── Apply.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── Higher-KindedTypes.xcplaygroundpage │ │ └── Contents.swift │ ├── ChainingHigherOrderFuncs.xcplaygroundpage │ │ └── Contents.swift │ ├── Join.xcplaygroundpage │ │ └── Contents.swift │ ├── FlatMap.xcplaygroundpage │ │ └── Contents.swift │ ├── Filter.xcplaygroundpage │ │ └── Contents.swift │ └── Map.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter07 └── Playgrounds │ ├── .DS_Store │ └── Ch07-Optionals.playground │ ├── Pages │ ├── ImplicitlyUnwrappedOptionals.xcplaygroundpage │ │ └── Contents.swift │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ ├── OptionalChaining.xcplaygroundpage │ │ └── Contents.swift │ ├── Definition.xcplaygroundpage │ │ └── Contents.swift │ ├── Guard.xcplaygroundpage │ │ └── Contents.swift │ ├── ErrorHandling.xcplaygroundpage │ │ └── Contents.swift │ └── Unwrapping.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter08 └── Playgrounds │ ├── .DS_Store │ └── Ch08-FunctionalDataStructures.playground │ ├── Pages │ └── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter09 └── Playgrounds │ ├── .DS_Store │ └── Ch09-ImportanceOfImmutability.playground │ ├── Pages │ ├── TableOfContents.xcplaygroundpage │ │ └── Contents.swift │ └── FunctionalExample.xcplaygroundpage │ │ └── Contents.swift │ └── contents.xcplayground ├── Chapter10 └── Playgrounds │ ├── .DS_Store │ └── Ch10-BestOfBothWorlds.playground │ └── contents.xcplayground ├── __MACOSX └── SwiftFP │ ├── ._.DS_Store │ ├── Ch11-Backend │ ├── ._.DS_Store │ └── vapor-example │ │ └── ._.DS_Store │ ├── Ch11-Frontend │ ├── ._.DS_Store │ └── TodoApp │ │ └── ._.DS_Store │ └── Playgrounds │ ├── ._.DS_Store │ └── Ch05-Generics.playground │ └── Pages │ ├── ._ExtendingGenericTypes.xcplaygroundpage │ └── ._AssociatedTypeProtocols.xcplaygroundpage └── LICENSE /Chapter11/Ch11-Backend/vapor-example/.swift-version: -------------------------------------------------------------------------------- 1 | system -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/secrets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/secrets/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "secret-key" 3 | } -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Procfile: -------------------------------------------------------------------------------- 1 | web: App --env=production --workdir="./" 2 | -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/.gitignore: -------------------------------------------------------------------------------- 1 | Packages 2 | .build 3 | xcuserdata 4 | *.xcodeproj 5 | -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/development/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "development-key" 3 | } -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/production/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "$VAPOR_APP_KEY" 3 | } -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "default-key", 3 | "foo": "bar" 4 | } -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Config/production/servers.json: -------------------------------------------------------------------------------- 1 | { 2 | "production": { 3 | "port": "$PORT" 4 | } 5 | } -------------------------------------------------------------------------------- /Chapter11/Ch11-Backend/vapor-example/Resources/Views/template.leaf: -------------------------------------------------------------------------------- 1 | #embed("embeds/header") 2 | 3 |