java-object-diff ã F# ã«ç§»æ¤
ä¹ ãã¶ãã®ç§»æ¤è¸ã§ãã
移æ¤çç±
Persimmonã®éçºã«å¿ è¦ã¿ãããªè©±ã«ãªãããã¤ç§»æ¤ããæéã®ãããããªäººéãä»ã«ããªãã£ãã¨ãããããã
å é
https://github.com/SQiShER/java-object-diff
ãããJavaãããæ¢ãã°ã ãããã§ã¦ããã
ææç©
https://github.com/pocketberserker/FSharp.Object.Diff
3æä¸æ¬ã«å§ããã®ã§ãã¾ã¨ãã«åãããããã«ãªãã¾ã§äºãæããã£ãè¨ç®ã«ã ã¾ããFSDNããæ¥åã®ããããããéã³ã¨ãã£ããã¨ãèããã¨å¦¥å½ãªæ°å¤ã£ã½ãæãããã¾ããï¼
ãããã
移æ¤å ã¯Javaãªã®ã§ãJavaãåæã«å®è£ ããã¦ããããã§ããã ãªã®ã§ãå½ç¶ä»æ§ã®å·®ãåºã¦ãã¾ãã
- Javaã«ããããã£ã¯ãªããã.NETã«ã¯ãã
- Javaã¯ã¡ã½ããããå¤ãåå¾ããå½¢ã«ãªã£ã¦ããã®ã§ããããã ãããããããã£ã«ç½®ãæã
- ãã£ã¼ã«ãã®diffåå¾æ©è½ã¯omit
- F#ã§ã¯å¿ è¦ãªãã¨æããã
ãã®ãããã¯ä»æ§ã®è©±ã
ããããå®è£ ã®æã«ééããï¼ã¾ãã¯ç¾å¨é²è¡å½¢ï¼ã®åé¡ã
- Javaã®ä¸é¨ã®Mapã ã¨keyã«nullãçªã£è¾¼ãã
- .NETã®Dictionaryã¯çªã£è¾¼ããªããã ããã¼ã¨ãªã£ã¦ã¡ãã£ã¨æ©ãã
- Map.getã§nullãè¿ã£ã¦ãã
- ããããã°ãããªãã ã£ããªã¼ã¨ã
- null nullãã¦ãã
- Javaã ããããä»æ¹ãªãã
- 移æ¤ãåªå ããé¢ä¿ã§ F# çãnull nullãã¦ã¾ãâ¦
- Some nullããâ¦
- F#ã®ã¬ã³ã¼ããã»ã¼ä½¿ããªã
- 移æ¤å ãmutableåæãªã®ã§ãããããªã
- abstract classãåºã¦ããã¨ã¬ã³ã¼ã使ããªããã
- .NETã®ã³ã¬ã¯ã·ã§ã³ã®åºåºã¨ãªãã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ï¼
- read onlyã§è¯ããªãIEnumerableï¼ã¸ã§ããªãã¯ãããªããã¤ï¼
- ããããæ¸ãè¾¼ã¿ãããå ´åã¯ï¼
- ä»åã¯ä»æ¹ãªãIListï¼ã¸ã§ããªãã¯ãããªããã¤ï¼ãwriteé¨åã§ã®åºåºã«æ¡ç¨ãã¦ãã
- .NETã®é£æ³é
åã®åºåºã¨ãªãã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ï¼
- IDictionaryï¼ã¸ã§ããªãã¯ãããªããã¤ï¼ã¯ãã¾ãå½¹ã«ç«ããªãããã©æ¥½ã ã£ãã®ã§ãã£ãããããæ¡ç¨ãã¦ããã
- IDictinary<'T, 'U>ãåºåºã«ãããã¨ããã ããtype eraseãããªãã®ã¨keyãvalueã®åæ å ±ããã®å ´ã«ãªãé¢ä¿ã§ãã¿ã¼ã³ãããã§åãã§ãã¯ã¿ãããªãã¨ã¯ã§ããªãã
- ããããã¦ï¼ã²ããããªãã¬ã¯ã·ã§ã³ã§é å¼µããããªãâ¦ï¼
- Javaããã¯Collection<?>ã¨ãMap<?>ã¨ããã£ã¦ã¦ãã¯ã¤ã«ãã«ã¼ãããåããã¿ãããªå¿å¢ã«ãªã£ã
- æ¯è¼æ¼ç®åã¨ã
- Javaã®
==
ã¯Object.ReferenceEqual
ã«ãequals
ã¯=
ã«èªã¿æ¿ããã®ãããã¨é£ãã - ããããã¹ãã¦ä½åº¦ãåµã£ã
- Javaã®
- equalityå¶ç´ãåé¿ããã
- F#ã ã¨
=
ã使ãã¨åãã©ã¡ã¼ã¿ãequality
å¶ç´ãè¦æ±ãã - ããdiffã©ã¤ãã©ãªãªã®ã§ãããªå¶ç´ã¯å¤ããã
- ã®ã§ãæ¯è¼ããé¨åã§
box x
ãæãã§obj
ã§æ¯è¼ããããããã¦ãã¦ãé§ä½¿ãã¦å¶ç´ãåé¿ãã¦ãã
- F#ã ã¨
ã¾ã¨ã
nullãããã³ã¬ã¯ã·ã§ã³ã®ä»æ§ã®å·®ãtype eraseãããã§ãªãããªã©ããã£ã¨å¥ãªå ´æã§ç²¾ç¥ãåãã¾ããã