2016/12/02ã«éå¬ããããBetter Javaã®ä¸æ©å ã¸ï¼ Scalaãªãã¡ã¯ã¿ãªã³ã°å ¥éãã§ä½¿ç¨ãããçºè¡¨è³æã§ãã
Scalaz cheatsheet Equal[A] def equal(a1: A, a2: A): Boolean (1 === 2) assert_=== false (2 =/= 1) assert_=== true Order[A] def order(x: A, y: A): Ordering 1.0 ?|? 2.0 assert_=== Ordering.LT 1.0 lt 2.0 assert_=== true 1.0 gt 2.0 assert_=== false 1.0 lte 2.0 assert_=== true 1.0 gte 2.0 assert_=== false 1.0 max 2.0 assert_=== 2.0 1.0 min 2.0 assert_=== 1.0 Show[A] def show(f: A): Cord 1.0.show assert_
### Equal[A] ```scala def equal(a1: A, a2: A): Boolean (1 === 2) assert_=== false (2 =/= 1) assert_=== true ``` ### Order[A] ```scala def order(x: A, y: A): Ordering 1.0 ?|? 2.0 assert_=== Ordering.LT 1.0 lt 2.0 assert_=== true 1.0 gt 2.0 assert_=== false 1.0 lte 2.0 assert_=== true 1.0 gte 2.0 assert_=== false 1.0 max 2.0 assert_=== 2.0 1.0 min 2.0 assert_=== 1.0 ``` ### Show[A] ```scala def show
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}