[skip ci] Implemented 'fold2', 'segmentBy', and 'segmentWith' functions in the Seq module.