Publish to my blog (weekly)
-
- implicit def strToInt(x: String) = x.toInt
- A view bound specifies a type that can be “viewed as” another.
- This makes sense for an operation that needs to “read” an object but doesn’t modify the object.
- Implicit functions allow automatic conversion
- they allow on-demand function application when this can help satisfy type inference
- This says that A has to be “viewable” as Int.
- , given our previous implicit, we can relax the constraint to viewability:
- implicit def strToInt(x: String) = x.toInt
- A <%< Int
-
- Items in the collections aren’t required to implement Ordered, but Ordered uses are still statically type checked.
- You can define your own orderings without any additional library support:
- new Ordering[Int] { def compare(a: Int, b: Int) = b compare a }
- Implicit values may be accessed via implicitly
- suppose that you needed to use several types of containers for several types of data.
- [M[_]]
-
If we combine using containers with implicits, we get “ad-hoc” polymorphism: the ability to write generic functions over containers.
- F-bounded polymorphism.
-
-
generics - What is a higher kinded type in Scala? - Stack Overflow
- Higher kinded types are types which take other types and construct a new type
-
A type constructor is a type that you can apply to type arguments to "construct" a type.
A value constructor is a value that you can apply to value arguments to "construct" a value
- Value constructors are usually called "functions" or "methods".
-
A type constructor is a type that you can apply to proper type arguments to "construct" a proper type.
A value constructor is a value that you can apply to proper value arguments to "construct" a proper value.
- A proper value is "immediately usable" in the sense that it is not waiting for arguments (it does not abstract over them). Think of them as values that you can easily print/inspect (serializing a function is cheating!).
- For types, the term "higher-kinded" is a special-purpose version of the more general "higher-order".
- A proper type is a type that classifies values (including value constructors)
- type constructors do not classify any values (they first need to be applied to the right type arguments to yield a proper type).
- To instantiate a type, it's necessary (but not sufficient) that it be a proper type.
-
-
- Rust supports an equivalent of conventional mutexes locking shared state via its data-ownership system. It also has an implementation of CSP channels.
- Go has CSP channels as a core primitive, with also the ability to set up conventional mutex locking through library functions.
-
-
Actor References, Paths and Addresses • Akka Documentation
-
actorOf
only ever creates a new actor, and it creates it as a direct child of the context on which this method is invoked (which may be any actor or actor system).actorSelection
only ever looks up existing actors when messages are delivered, i.e. does not create actors, or verify existence of actors when the selection is created.
-
-
Emergence from synapse :: Objective-C의 autorelease 이해하기(1)
- 객체를 새로 생성하거나 추가로 참조할 때는 카운트를 증가(retain)시키고,
- 다 쓰고 나면 카운트를 감소(release)시킨다.
-
댓글