
28 Oct
2006
28 Oct
'06
5:45 p.m.
I need to find the length of the longest in-sequence section of a list of ints...I am guessing something like mapAccumL is the way but not sure how. --this doesn't work Prelude List> mapAccumL (\x y -> if y==(x+1) then (y, x) else (y,0)) 0 $ sort $ nub [9, 1, 2, 7, 3, 4, 5, 6,5] (9,[0,1,2,3,4,5,6,0]) -- View this message in context: http://www.nabble.com/mapAccumL---find-max-in-sequence-subsequence-tf2531704... Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.