2011-09-01ãã1ã¶æéã®è¨äºä¸è¦§
ãªã¹ãã®ç³ã¿è¾¼ã¿ã«ã¯ãfoldr ã使ãããã foldr :: (a -> b -> b) -> b -> [a] -> b foldr _ ini [] = ini foldr op ini (x:xs) = x `op` foldr op ini xs Data.List ã«ã¯ããã®å対ã¨ãªãé¢æ° unfoldr ãå®ç¾©ãã¦ããã unfoldr :: (a -> Maybe (b,a)) ->â¦
ãå½æ°ããã°ã©ãã³ã°ã®éããã®ãã¥ã¼ããªã¢ã«è³æãä½æããããã®ã¡ã¢ããªã¹ãã«å¯¾ããå帰ã2ã¤ã«åé¡ãããã¨ã§ç解ããã å帰 é¢æ°ããã°ã©ãã³ã°ã§ã¯ãç¹°ãè¿ããå帰ã§å®ç¾ãããå ¥åããªã¹ãã§ããé¢æ°ãå®è£ ããã¨ããããã®ç¨®ã®é¢æ°ã¯ãåºåã®ç¨®â¦
Haskell(GHC)ã§ã®è»½éã¦ã¼ã¶ã¹ã¬ããã®å®è£ æ¹æ³ã§ãCmm ã軽éã¹ã¬ããã®ãã¤ã³ãã¨æ¸ãã¾ãããããããGHC ã®å®è£ è Simon Marlow å çãããCmm ã¯é¢ä¿ãªãããã¨æãã¦é ãã¾ããã StgCall StgCall ãããã¤ãã®ã¬ã¸ã¹ã¿ãä¿åããã®ã¯ãæ¡ç¨ãã¦ããCâ¦
æè¿ãã¹ã¿ã¼ãHaskellã§ãã«ãªã¼åãããé¢æ°ã®ã¡ãªããã¯ä½ãï¼ãã¨ãã質åãåºãããã®ããå¾ã«ãkmizuãããã«ãªã¼åã®èª¤ç¨ã«å¯¾ãã¦è¦éãé³´ããã¦ãã¦ãããåããããã¨kmizuããã®ãã«ãªã¼åã®å®ç¾©ãã誤ç¨ã«æããã®ã§ã調ã¹ãã¨ã¨ãã«èãããã¨ã®â¦
å½ä»¤åè¨èªã® Java ã Ruby ãã¦ã¼ã¶ã¹ã¬ããããã«ã¼ãã«ã¹ã¬ããã«ç§»è¡ããã®ã¨ã¯å¯¾ç §çã«ãé¢æ°åè¨èªã® Erlang ã Haskell ã§ã¯è»½éãªã¦ã¼ã¶ã¹ã¬ãããæä¾ãããã¨ã«æåãã¦ãã¾ããåã¯ããã®éããä½ããçãã¦ããã®ãç解ãããã¨æã£ã¦ãã¾ãããâ¦