摘要:
复合类型(类型构造器)的基本功能由复合类型的主类型确定; 复合类型的扩展功能由主类型和参量类型共同确定; 函数式编程的功能扩展由高阶函数和混入函数完成 public struct Array<Element> { public func map<T>(_ transform: (Element) t 阅读全文
摘要:
swift面向协议编程的根本原因在于值类型的存在;面向对象必须要有引用类型的支持; Protocol Oriented approach was introduced to resolve some issues in programming and it also differs in vario 阅读全文
摘要:
Type Erasure Pattern We can use the type erasure pattern to combine both generic type parameters and associated types to satisfy both the compiler and 阅读全文