
thanks! Ivan Lazar Miljenovic wrote:
zaxis
writes: 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
The correct syntax is let ... in ...; you've forgotten the "in", so something like this:
,---- | find_the_day sDay 0 = sDay | find_the_day sDay nDay = | let nextDay = addDays 1 sDay | in if (is_trade_day $ nextDay) | then find_the_day nextDay (nDay - 1) | else find_the_day nextDay nDay `----
Note that in do-blocks you don't need the `in'; in "normal" code you do.
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
----- fac n = foldr (*) 1 [1..n] -- View this message in context: http://old.nabble.com/Why-cannot-i-add-the-%60let%60-declaration---tp2738181... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.