hi ,
I am stuck in the following problem.
I am maintaining a list of tuples of the form
([Char],Int,Int, Int,Int) . The purpose of maintaining the tuples is that the
program reads from a file line by line , Matches the contents with the first element of the tuple and updates the tuple respectively.
The precise function I am using is as follows
tupup::Bool->[Char]->Int->Int->Int->Int->Char->([Char],Int,Int,Int,Int)
tupup val elf els elr ell elx ys= if val then
case ys of 'A' -> (elf, els+1,elr,ell,elx)
'G' -> (elf,els, elr +1,ell,elx)
'C' -> (elf,els,elr, ell +1,elx)
'T' -> (elf,els,elr,ell, elx +1)
else (elf,els,elr,ell,elx)
uptable::[[Char]]->[([Char],Int,Int,Int,Int)]->[([Char],Int,Int,Int,Int)]
uptable (xf:xs) main_array = map (\(x,y,z,r,t)-> tupup (x==xf) x y z r t (secvalue xs) ) main_array
It gives the error ERROR - Control stack overflow. I assume it is because of the lazy evaluation .
Is there a way to enforce strict evaluation only for the function tupup.
Thanks,
Navin