You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
ãã®è¨äºã§ã¯, Haskellã«ç¨ãããããé 延è©ä¾¡ãã®ä»çµã¿ã, å³ã«æãã¦èª¬æãã¾ã. æ´ã«, é 延è©ä¾¡çã®ãã£ããããæ°ã®ç¡éåã, JavaScriptã§å®è£ ãã¾ã. é 延è©ä¾¡ã¨ã¯ã©ã®ããã«åãã®ã, èãã¦è¡ãã¾ããã. Haskellã®ã³ã¼ãã¨JavaScriptã®ã³ã¼ãã®æ¯è¼ Haskellã§ã® x = y y = 10 ã¨, JavaScriptã® var x = y; var y = 10; ã¨ããã³ã¼ããèãã¦ãã ãã. Haskellã®ã³ã¼ãã¯, ããã ãã§ã¯ä½ãèµ·ããã¾ãã. print xã¨ããã¨, x = y = 10 ã¨ãªã£ã¦ 10 ã表示ããã¾ã. ä¸æ¹, JavaScriptã®ã³ã¼ã㯠var x = y; ãè©ä¾¡ããç¬é, ï½¢ReferenceError: y is not definedï½£ã¨ããã¨ã©ã¼ãåºã¾ã. æ´ã«, main = let x = 1
è¦ç´ï¼Free ã¢ããã¯ä½ãå¬ããã®ããè°è«ããããã®ãããå°ã以ä¸ã®2ã¤ã®è«æã«è¼ã£ã¦ããä¾ã3ã¤ã®æ¹æ³ã§å®è£ ããã Janis Voigtlander, "Asymptotic Improvement of Computations over Free Monads" Wouter Swierstra and Thorsten Altenkirch, "Beauty in the Beast -- A Functional Semantics for the Awkward Squad" ã¢ãã æè¿ãåã¯ã¢ããã次ã®ããã«èª¬æããããã«ãã¦ããããã¢ããã¨ã¯è¨èªå DSLãå®è£ ããããã® API (ãããã¯ãã¬ã¼ã ã¯ã¼ã¯)ã ã ãããä½ãè¨èªå DSLãä½ããªãããããã¢ããã®ã¤ã³ã¹ã¿ã³ã¹ã«ãã¹ãã ãããã§ã¯ãgetChar 㨠putChar ã¨ãã API ãæã¤ç°¡å㪠DSL ãè
Freeã¢ããã¯ãããã Haskellãæ¸ãã¦ãã¦ããç¹æ®åãããå¦çãè¨è¿°ããã¢ãããç°¡åã«ä½ããã便å©ã ãããªã¼ãã¨æã£ããã¨ã¯ãªãã ãããï¼ç°¡åã«ä½ããã®ã§ããããããHaskellãªããã ããããç´ç²ãªFreeã¢ããã®å®ç¾©ã§ããã data Free f a = Pure a | Free (f (Free f a)) instance Functor f => Monad (Free f) where return = Pure Pure a >>= k = k a Free fm >>= k = Free (fmap (>>=k) fm) (FunctorãApplicativeã®ã¤ã³ã¹ã¿ã³ã¹å®£è¨ã¯èªæãªã®ã§çç¥) ä¸ããããFunctorããäºãã«åãè¾¼ã¿åã£ã¦ãããã¨ããæ¼ ç¶ã¨ããå°è±¡ã§ãä½ãå¬ããã®ãããããããªããããããªããã ãããã®åç´ãããFreeã¢ããã®ä¾¿å©
æè¿Haskellerã®éã§Freeã¢ãããç±ãã§ãã Haskellã§æããéãã人ãFreeã¢ããã§åã³æããéããããã¦ããªãããã解ããªããã©åããã¨ã«ãªã£ã¦ããä»æ¥ãã®ããã§ããããã£ããä¹ãé ãã¦ãã¾ãããã©ããã貴女ã®ã¡ã ã¼ãã§ãã ã§ãçããã£ã¦ããããããããã¨è¨ã£ã¦ããFreeã¢ãããªã®ã§ãæµç³ã«ãã¤ãã¾ã§ãå ¨ç¶ç¥ããªãã®ã¯ããºã¤ããããªãããªãã¨ãæã£ã¦ãéãè °ãæã¡ä¸ã調ã¹ãªãããã®è¨äºãæ¸ãå§ããã¯ã±ã§ãããã¯ãã*1 ãã£ããæ¥ãã§åå¼·ãã¦æ¸ãä¸ããã®ã§éæã«ééãããããã§ããããã³ããå¾ ã¡ãã¦ã¾ãã ãã¦ããã®ãFreeã¢ãããã«ã¤ãã¦ããªã¬ãªã¬å®ç¾©ã§ç°¡åã«è¨èã«ããã¨ããFunctorã¨çµã¿åããã¦æ§ã ãªæåãå®ç¾ã§ããã¢ãããã§ãã 大æµãMonadã®ã¤ã³ã¹ã¿ã³ã¹ãã¨ããã¨ãMaybeã«ãã¦ãIOã«ãã¦ããããã¨å ·ä½çãªäºè±¡ãæ±ã£ã¦ã¾ããããã®Freeã¢
è¦ã¦ããã ããã®ã¯å¬ããã§ãããã®ã¨ã³ããªã¯ååå¤ããããæ°ããæ å ±ã¸ã¢ã¯ã»ã¹ããã¦ãã ããã以ä¸ã®æ¬ããå§ããã¾ãã ãããHaskellãã®ããå¦ã¼ãï¼ ä½è : ï¼ï½ï½ï½ï½ï¼¬ï½ï½ï½ï½ï½ï½ï½åºç社/ã¡ã¼ã«ã¼: ãªã¼ã 社çºå£²æ¥: 2017/07/14ã¡ãã£ã¢: Kindleçè³¼å ¥: 4人 ã¯ãªãã¯: 9åãã®ååãå«ãããã°ãè¦ã é¢æ°ããã°ã©ãã³ã°å®è·µå ¥é ââç°¡æ½ã§ãæ£ããã³ã¼ããæ¸ãããã« (WEB+DB PRESS plus) ä½è : 大å·å¾³ä¹åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾çºå£²æ¥: 2014/11/14ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼ãã®ååãå«ãããã° (8件) ãè¦ã ã¿ããªHaskellããããï¼ï¼ ã¨ãããã¨ã§æ¸ãã¾ããã CãJavaãRubyãªã©ä»è¨èªãç¥ã£ã¦ãã人ã¯ããããèªããã¨ã§Haskellã®å¤§æµã®ãã¨ã¯ãã¹ã¿ã¼ã§ãâ¦ã¾ããã ç¹æ®ãªæ§æãå¤ããã¦ä»è¨èªã¨ã®é¡
ã¡ã³ããã³ã¹
ãç¥ãã
é害
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}