Sunday, March 25, 2012

directory-diff

Copperbox revision 2727.

I've added a two continuation, two input stream parser. This lets me (fairly) easily encode rules to check wither an old path matches a new one - modulo inserts or deletes to one of the paths. Probably I should have implemented this with a finite state automata (making it closer to lexing than parsing), but I know how to easily implement parsers.

Testing that an old directory has the same path as the new one, with a directory "Current" removed somewhere along the path is:

    test = prefix >> symbolL "Current" >> suffix

Note - no doubt I will change the combinator names.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.