find_the_day sDay 0 = sDay
find_the_day sDay nDay =
if (is_trade_day $ nextDay sDay)
then find_the_day (nextDay sDay) (nDay - 1)
else find_the_day (nextDay sDay) nDay
nextDay sDay = addDays 1 sDay
The above code works fine. But the following always reports `compiling
error`:
find_the_day sDay 0 = sDay
find_the_day sDay nDay =
let nextDay = addDays 1 sDay
if (is_trade_day $ nextDay)
then find_the_day nextDay (nDay - 1)
else find_the_day nextDay nDay
Any suggestion is appreciated!
-----
fac n = foldr (*) 1 [1..n]
--
View this message in context:
http://old.nabble.com/Why-cannot-i-add-the-%60let%60-declaration---tp27381811p27381811.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe