[Haskell-cafe] Why cannot i add the `let` declaration ?

zaxis z_axis at 163.com
Sat Jan 30 02:39:29 EST 2010


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.



More information about the Haskell-Cafe mailing list