项目作者: 0x01h

项目描述 :
Counting Sundays in Haskell.
高级语言: Haskell
项目地址: git://github.com/0x01h/counting-sundays.git
创建时间: 2018-02-24T21:58:45Z
项目社区:https://github.com/0x01h/counting-sundays

开源协议:GNU General Public License v3.0

下载


BLG 458E - HW #1

Counting Sundays in Haskell.

What does the helper function (sundays’) calculate?

“sundays’” calculates the total number of Sundays which is on the first day of the month and keep recursion untill the given parameter (end year) is reached.

What if you don’t define a “rest” and use its expression where it’s needed?

It would create code redundancy, and also in Haskell, using guards rather than nested if statements is a better coding practice.