Skip to content

Commit

Permalink
add a Haskell solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed May 31, 2014
1 parent d879ec5 commit 987c1e1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions haskell/masak.hs
@@ -0,0 +1,16 @@
import Data.Time.Calendar
import Data.Time.Calendar.WeekDate

isFriday :: Day -> Bool
isFriday date = weekDay == 5
where (_, _, weekDay) = toWeekDate date

friday13ths :: [Day]
friday13ths =
[ date | year <- [2012..2017]
, month <- [1..12]
, let date = fromGregorian year month 13
, isFriday date ]

main :: IO ()
main = mapM_ print friday13ths

0 comments on commit 987c1e1

Please sign in to comment.