ã©ã ãè¨ç®ã§Either Eitheråã®å¤ããã¿ã¼ã³ãããããç¶æ³ãèãã¾ãã ããã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ã®ãã¿ã¼ã³ããããã¯ï¼ä¸å³ã®ããã«ãã¦ã©ã ãè¨ç®ã§è¡¨ç¾ã§ãã¾ãã ã©ã ãè¨ç®ã§Bool ä»åº¦ã¯ï¼Boolåã®å¤ããã¿ã¼ã³ãããããç¶æ³ãèãã¾ãã TrueãFalseã«ã¯å¼æ°ãç¡ãã®ã§ï¼(3)ã(4)ã¯Î»ã§å²ã¿ã¾ããã ãã¿ã¼ã³ããã = ããã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ãä»ã®é¢æ°ã«ç½®ãæãããã¨ã ãã¿ã¼ã³ãããã«ãã£ã¦ï¼Leftãlã«ç½®ãæããã¾ãã以ä¸åæ§ã§ãã ããã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ãç½®ãæãããã¨ããæ¦å¿µã«ã¤ãã¦ï¼ããå°ã詳ããèãã¦ããã¾ãã ãã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ã®ç½®ãæãæ¹ã¯2種é¡ãã ãªã¹ãã®ãããªå帰çãªãã¼ã¿åã§ã¯ï¼ãã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ã®ç½®ãæãæ¹ã2種é¡ããã¾ãã data List a = Cons a (List a) | Nil (1) å ¨ã¦ã®ãã¼ã¿ã³ã³ã¹ãã©ã¯ã¿ãç½®
{{#tags}}- {{label}}
{{/tags}}