ref:/*コメント*/を取り除く どう書く?org こう、Haskell の練習というか HUnit の使い方確認というか。 import Test.HUnit removeComment :: String -> String removeComment = outOfComment where outOfComment ('/':'*':cs) = inComment cs outOfComment (c:cs) = c : outOfComment cs outOfComment [] = [] inComment ('*':'/':cs) = outOfComment cs inComment (c:cs) = inComment cs inComment [] = [] testData = [ t "AAA" "AAA", t "AAA/*BBB*/" "AAA", t "A
![2007-07-11](https://cdn-ak-scissors.b.st-hatena.com/image/square/06a15c64ba0ceec233d86d71001ebb29a9dcbf5d/height=288;version=1;width=512/https%3A%2F%2Fcdn.blog.st-hatena.com%2Fimages%2Ftheme%2Fog-image-1500.png)