Introduction to Basic Haskell Components (In Chinese)ChengHui Weng
In 2012, we had the first Chinese functional meetup about general functional programming techniques in Taipei. I gave this talk to introduce several classes in the famous Typeclassesopedia article.
Introduction to Basic Haskell Components (In Chinese)ChengHui Weng
In 2012, we had the first Chinese functional meetup about general functional programming techniques in Taipei. I gave this talk to introduce several classes in the famous Typeclassesopedia article.
Although the study of emotional intelligence is no longer a new topic, many people are still unaware of what EI is. This presentation provides clarification on the subject of emotional intelligence and includes several easy to understand definitions.
4. Java SE 8 新功能
•JSR 308 Annotations on Java Types
•JSR 310 Date and Time API
•JSR 335 Lambda Expressions for the
Java Programming Language
5. Java SE 8 更新
•JSR 114 JDBC Rowsets
•JSR 160 JMX Remote API
•JSR 173 Java Compiler API
•JSR 199 Streaming API for XML
•JSR 221 JDBC 4.0
•JSR 269 Pluggable Annotation-Processing API
13. Anonymous Inner Class
List<String> list = new ArrayList<>();
...
list.stream().sorted(
new Comparator<String>(){
@Override
public void compare(String o1,
String o2) {
return o1.compareTo(o2);
}
});
43. •Static method
class ItemTool {
static int compareByPrice(Item a,
Item b) {
...
}
}
Arrays.asList(item1,item2,item3)
.sort(ItemTool::compareByPrice);
44. •特定物件的 Instance method
class ItemTool {
int compareByPrice(Item a,
Item b) {
...
}
}
ItemTool tool = new ItemTool();
Arrays.asList(item1,item2,item3)
.sort(tool::compareByPrice);
53. •不會製造新的 Scope
•this 是 enclosing class
•沒有 Shadowing 問題
•和 local class 或 anonymous class 不同
int max = 10;
list.stream().filter((s) -> {
int max = 12; // compile error
return s.length() < this.delta
+ max;
});
55. •能存取 final & effectively final 的變數
int max = 10;
final int min = 2;
list.stream().filter((s) -> {
max = 12; // compile error
return s.length() < max
&& s.length() > min;
});
max = 15; // compile error
90. MethodHandle
•與 invokedynamic 一起從 JSR-292
(Java 7 )新增
•java.util.invoke
•A reference to method(or field,
constructor or other bit of functionality)
that can be executed