Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Carl Masak
committed
May 31, 2014
1 parent
d879ec5
commit 987c1e1
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |