Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
第2章 練習問題 G
showDate :: Date -> String
を定義せよtype Year = Int type Month = Int type Day = Int type Date = (Day, Month, Year) showDate :: Date -> String showDate (d, m, y) = show d ++ suffix d ++ " " ++ months !! (m - 1) ++ ", " ++ show y months = [ January, Feburary, March, April , May, June, July, August , September, October, November, December ]