Jorge Adriano writes:
:
| Then I thought I'd mess with the fibonnaci function.
| I began with:
|
| > fibac :: IntPos -> (IntPos,IntPos) -> (IntPos,IntPos)
| > fibac n (a,b)
| > | n == 0= (a,b)
| > | otherwise = fibac (n-1) (b,a+b)
|
> Then I tried:
> > sfibac :: IntPos -> (IntPos,IntPos) ->
> > (IntPos,IntPos) sfibac n (a,b)
> >
> >| n == 0= (a,b)
> >| otherwise = sfibac (n-1) (b, (+b) $! a)
I'm sorry I meant:
> sfibac :: IntPos -> (IntPos,IntPos
Hi, I've just started messing around with strictness. My goal now is
understanding when and how to use it.
I began with simple examples like making a strict foldl.
When trying to sum a list of 6 elements with lazy foldl I'd get a stack
space overflow, with a strict foldl I was able to sum