What is Motif (Motive 目的)

Below is an excellent intuitive explanation (in Chinese) of the abstract concept Motif by Grothendieck:

Brief SummaryMotif is the source of all “beautiful things” expressed in different forms.

Example : God created Natural Numbers (N), we express N in different forms: Binary (0, 1), Decimal (0, 1, 2 …9), Hexadecimal (0,1, 2…9, a, b, c, …f), etc. However, the “Motif” behind these forms is they all follow for (+, *) operations the same TWO Laws : 1) Commutative; 2) Distributive.

Similarly, in Algebraic Geometry applying the cohomology from Algebraic Topology: étale cohomology, crystalline cohomology, de Rham cohomology are the different forms (~ Binary, Decimal, Hexadecimal), factored through the common “Motif” of the Universal cohomology (~N).

[My Analogy in IT Language]:
Motif is like Interface or Generic, it spells out only the specification, leaving out the implementation (method) in actual classes / functions.

[怎麼理解代數幾何概念 motive?]


Ref: Alain Connes [Paragraph : Motif in a Nutshell]



Advanced Kotlin Education

Kotlin’s real power is to explore its Functional Programming features, besides the “cosmetic” improvement of concise codes to avoid Java’s annoying boilerplates.

Note: https://www.raywenderlich.com/173352/raywenderlich-com-goes-kotlin-and-needs-tech-editors

* Level of difficulty (* = Simple, ** = Medium, *** = Difficult)

0. What is Functional Programming ?

This Romanian IT expert introduces us to Functional Programming (FP). He has the advices:
1) No need to know deep Category Theory (CT)- but nice to know little bit. (In Romania, the students learn CT in Grade-12 (equivalent JC2);
2) Haskell is the lingua franca of FP. Learn it to understand most FP concepts, even if you later use other FP languages (Kotlin, Scala);
3) Dynamic Type languages (Lisp, Clojure) are not good, because only Static type (eg. Kotlin, Java with “final”) can ensure Immutability which is the essence of FP;


1. Sequence over Collection, Sealed Class, Object => new Class


2. Function Literal (Lambda Expression) (**)


3. “Either” Monad (**)


4. Kotlin “DI” Dependency Injection – the “Reader” Monad vs Java Dagger: (***)

View story at Medium.com

5. Function Memoization (**)

View story at Medium.com

6. Remove all ugly “!!” with these 6 Kotlin techniques (*)


7. Generic Extension Function (aka Polymorphism) (**)


8. Co-routine (Weather app demo) (***)


9. Free Monads (***)


10. Free monoids and Free Monads (***) – (in Scala codes)


11. Operator Overloading (Antonio’s Chap 11) *


12. Android UI Fragments in Kotlin


13. Design Patterns in Kotlin


14. Static Method (Companion Object)


Kotlin 1.2 Multi-Platform Project

This language feature of writing only once and run on many platform was promised by Java in 1999 through JVM.

Kotlin, a successor of Java supported officially by Google since May 2017, goes further than Java on ambitious multi-platform, not only through Android’s Delvick JVM (a modified version of Oracle’s JVM), also on JavaScript engine (in supported browsers), and compiled to (future) native codes on Microsoft Windows…


Kotlin 1.2 Beta Release 30/9/2017: