Workshop/StartHaskell2/answer4
すごいHaskell楽しく学ぼうの練習問題を作ってみた解答 (4. Syntax in Functions)
- caseとifを使わないで関数を作りましょう
analysisLine' :: String -> String
analysisLine' [] = "empty"
analysisLine' [_] = "a character"
analysisLine' s'
| last s' == '.' = "a sentence"
| ' ' `elem` s' = "some words"
| otherwise = "a word"
- ここに追加
- ここに追加