On 16/01/2009 01:28, "Luke Palmer" <lrpal...@gmail.com> wrote:

>> Compile-time constants could be handled by simple top-level bindings.  This
>> technique is specifically for the case you are after:
>> 
>> mcSimulate :: Double -> Double -> Word64 -> [Double]
>> mcSimulate startStock endTime seedForSeed = go seedForSeed
>>   where
>>     go = fst expiryStock : go newSeedForSeed
>>       where
>>       expiryStock = iterate evolveUnderlying (startStock, ranq1Init
>> seedForSeed) 
>>                         !! truncate (endTime/timeStep)
>>       newSeedForSeed = seedForSeed + 246524
>>  
>> See what's going on there?
>> 
>> I don't know about that nested where.  In Real Life I would probably use a
>> let instead for expiryStock and newSeedForSeed.
>> 
>> Luke
>> 
>> Ahh, I get it now, that¹s pretty neat - Œgo¹ is only updating the seedForSeed
>> and the expiryStock, the inner Œwhere¹ clause keeps everything else constant
>> each time it is called.

Thanks again!

Phil.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to