One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
see the Makefile: https://github.com/towry/TasskySidebar/blob/master/Makefile
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| body { | |
| padding-top: 3rem; | |
| } |
I hereby claim:
To claim this, I am signing this object:
| //: Playground - noun: a place where people can play | |
| import Foundation | |
| import PlaygroundSupport | |
| URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil) | |
| let url = URL(string: "http://www.baidu.com") | |
| let task = URLSession.shared.dataTask(with: url!) {data, response, error in |
| /*! | |
| https://blog.jcoglan.com/2011/03/05/translation-from-haskell-to-javascript-of-selected-portions-of-the-best-introduction-to-monads-ive-ever-read/ | |
| this is a function with side effect, to dealing with side effect, | |
| we can format it into return value, because pure function can only | |
| have input and output (return) effect to outside world. | |
| ```js |
| /// https://github.com/apple/swift-evolution/blob/master/proposals/0142-associated-types-constraints.md | |
| protocol SubContainer: Container { | |
| associatedtype Item: Equatable | |
| } | |
| protocol Container { | |
| associatedtype Item | |
| // error: 'where' clause cannot be attached to an associated type declaration | |
| // error: type may not reference itself as a requirement |
| // So associated objects just store object in anoter place, use property to | |
| // associate the object with the class object. | |
| import Foundation | |
| let data: Data? | |
| var dataKey: Void? | |
| data = Data(count: 10) | |
| data?.insert(9, at: 0) |
| // | |
| // https://medium.com/@jegnux/safe-collection-subsripting-in-swift-3771f16f883 | |
| // https://github.com/ReactiveX/RxSwift/issues/826 | |
| // | |
| import Foundation | |
| // we define a fire protocol. | |
| protocol FireProtocol { |