On Tue, 3 Nov 2009, Kamil Dworakowski wrote:
Sun Oct 25 12:29:54 GMT 2009 Kamil Dworakowski <[email protected]>
* resolve issue1636: match hunk
A new primitive match type.
My second point of discussion is about the implementation. What you've done
makes sense to me and fits in well with the list_touched_files code. But
both your code and list_touched_files add to the Patchy class (and
various instances) and it feels like a bit of an abstraction violation, and
also rather boilerplatey. I have a feeling we should somehow generalise
using some form of generic programming library before it gets out of hand,
but I'm not experienced enough with them to pick one or map out what the
solution would look like.
It seems to me that both the operations, list_touched_files and
hunkMatches, map Prim to some Monoidal value, and for every other
instance of Patchy they just mconcat from the children. Maybe adding a
method that takes a function returning a monoidal value for a Prim
would be good enough to express both list_touched_files and
hunkMatches. What do you think?
That sounds like a good idea. It doesn't resolve my concern about
abstraction violation, but I'm not really sure that's such a big deal
given that Prim is an important kind of patch.
In fact, we could just have something that returns a list of Prim, which
is equivalent but simpler. The only reservation I have is that any clients
that need more intelligent handling of conflictors than just sticking all
the pieces together wouldn't be able to use it, but since they don't exist
right now it's not really worth worrying about.
Cheers,
Ganesh
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users