On Fri, 20 Aug 2010, [email protected] wrote:
generalise the type of treeDiff
hunk ./src/Darcs/Diff.hs 41
#include "gadts.h"
-treeDiff :: Gap w => (FilePath -> FileType) -> Tree IO -> Tree IO -> IO (w (FL
Prim))
+treeDiff :: forall m w . (Functor m, Monad m, Gap w) => (FilePath -> FileType) ->
Tree m -> Tree m -> m (w (FL Prim))
treeDiff ft t1 t2 = do
(from, to) <- diffTrees t1 t2
diffs <- sequence $ zipTrees diff from to
hunk ./src/Darcs/Diff.hs 46
return $ foldr (joinGap (+>+)) (emptyGap NilFL) diffs
- where diff :: Gap w
- => AnchoredPath -> Maybe (TreeItem IO) -> Maybe (TreeItem IO)
- -> IO (w (FL Prim))
+ where diff :: AnchoredPath -> Maybe (TreeItem m) -> Maybe (TreeItem m)
+ -> m (w (FL Prim))
diff _ (Just (SubTree _)) (Just (SubTree _)) = return (emptyGap
NilFL)
diff p (Just (SubTree _)) Nothing =
return $ freeGap (rmdir (anchorPath "" p) :>: NilFL)
OK (although it does make me wonder if you wrote some QC properties for this or
such)
No - but I should!
Ganesh
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users