case class Cont[R, A](run: (A => R) => R) { def map[B](f: A => B): Cont[R, B] = Cont(k => run(a => k(f(a)))) def flatMap[B](f: A => Cont[R, B]): Cont[R, B] = Cont(k => run(a => f(a).run(k))) } ããã§éè¦ãªã®ã¯ Cont ã®ã³ã³ã¹ãã©ã¯ã¿ã¼ã«æ¸¡ããã run é¢æ°ã§ãã ãã® run é¢æ°ãä½ã Cont ã®ã³ã³ã¹ãã©ã¯ã¿ã¼ã«æ¸¡ããã¨ã§ãç¶ç¶ã¢ãããä½ããã¨ãã§ãã¾ãã ãã㧠run é¢æ°ã®åãè¦ã¦ã¿ã¾ã㨠(A => R) => R ã¨ããã¾ãã A => R ã¨ããåã®é¢æ°ãåãåããããããåãåã£ãé¢æ°ãå®è¡ã R ã¨ããçµæãè¿ãã¨ããåä½ãæå¾ ã§ãã¾ãã ãã㧠A ãå ¨ä½ã®ä¸ã®éä¸ã®è¨
{{#tags}}- {{label}}
{{/tags}}