Imagine I have a very long file:
1
1
1
1
2
2
2
2
1
1
1
1
2
2
1
1
2
2
...
I am interested in dividing and performing the calculation in each group of consecutive 1along with the consecutive 2that appears immediately after it.
. -, 1 2, , , Record s, , , Record 1 2; -, , , , get1 :: IO (Maybe Record). Just record Nothing, ; , , ( ), .
, , : (1 2 - Record, get1, (,) , )
1
1
1
2
2
1
(["1","1","1"],["2","2"])
2
1
(["1"],["2"])
1
1
1
2
2
2
2
1
(["1","1","1","1"],["2","2","2","2"])