ã¸ã§ãã¬ã¼ã¿ã¼ã DSL ã®ããã«ä½¿ã£ã¦é¢æ°ã¢ãã㨠State ã¢ããã模å£ãã¦ã¿ã¾ãããè¨è¿°ãããã£ã½ãè¦ãããã¨ã«éç¹ãç½®ãããããbind ã return ãæ£ç¢ºã«å®è£ ããããã§ã¯ããã¾ããã ãã®è¨äºã¯æ¬¡ã®è¨äºã® Python çã§ããåããã¨ãåºæ¥ãã¯ããªã®ã§ç¢ºèªããããªãã¾ããã ã¸ã§ãã¬ã¼ã¿ã¼ã§é¢æ°ã¢ããã¨Stateã¢ããã模å£ãã¦ã¿ã çµæçã«ãã¸ã§ãã¬ã¼ã¿ã¼ã® return ã®ä»æ§ã®å¤é·ãããã³ã¬ã¼ã¿ã¼ãæç¨ãªãã¨ãªã©ãåããã¾ããã å®è£ å®è£ ã並ã¹ãã¨ãé¢æ°ã¢ãã㨠State ã¢ããã®å·®åãåãããããã§ãã def function_monad(g): def f(state): it = g() value = None try: while True: value = it.send(value)(state) except StopIteration a
{{#tags}}- {{label}}
{{/tags}}