New answers tagged

6

Note: I am not an expert in Category Theory. If you want a precise explanation what Duality means in Category Theory, you should ask a mathematician. The concept of duality in Category Theory can be kind-of thought as "opposite", but it is a special kind of opposite, one that preserves structure. For example, the dual of a directed graph is the graph which ...


2

There are three parts in this type signature: Current, original type, T Return type, U Transformation, f: (T) => U Since you're looking at a generic class with a map method (as opposed to just a stand-alone function), the T type variable is defined above, in a class type signature: Try[T]. This explains why there's no T inside bracket of map[...]. It'...


6

Scala is an object-oriented language. In object-oriented languages, methods have special access to a designated "receiver" argument (typically called this or self). This parameter is usually not made explicit in the method signature (Python is an exception). So, you have to remember that the map method is actually defined as a member of a trait or class and ...



Top 50 recent answers are included