Merge branch 'darcs' into master
[git-darcs-import.git] / src / Darcs / Patch / Set.lhs
blob6f4e638c0dc8cd2b0b0076decbd0894f1f070b85
1 % Copyright (C) 2003 David Roundy
3 % This program is free software; you can redistribute it and/or modify
4 % it under the terms of the GNU General Public License as published by
5 % the Free Software Foundation; either version 2, or (at your option)
6 % any later version.
8 % This program is distributed in the hope that it will be useful,
9 % but WITHOUT ANY WARRANTY; without even the implied warranty of
10 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 % GNU General Public License for more details.
13 % You should have received a copy of the GNU General Public License
14 % along with this program; see the file COPYING. If not, write to
15 % the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 % Boston, MA 02110-1301, USA.
19 \begin{code}
20 {-# OPTIONS_GHC -cpp #-}
21 {-# LANGUAGE CPP #-}
23 #include "gadts.h"
25 module Darcs.Patch.Set ( PatchSet, SealedPatchSet ) where
27 import Darcs.Hopefully ( PatchInfoAnd )
28 import Darcs.Ordered ( RL )
29 import Darcs.Sealed ( Sealed )
31 -- | A PatchSet is in reverse order, plus has information about which
32 -- tags are clean, meaning all patches applied prior to them are in
33 -- the tag itself, so we can stop reading at that point. Just to
34 -- clarify, the first patch in a PatchSet is the one most recently
35 -- applied to the repo.
37 -- 'PatchSet's have the property that if
38 -- @
39 -- (info $ last $ head a) == (info $ last $ head b)
40 -- @
41 -- then @(tail a)@ and @(tail b)@ are identical repositories
43 -- Questions:
45 -- Does this mean that in a patch set such as @[[a b t1 c d e t2][f g
46 -- t3] [h i]]@, t1, t2 and t3 are tags, and t2 and t3 are clean?
48 -- Can we have PatchSet with length at least 3?
49 -- Florent
50 type PatchSet p C(x) = RL (RL (PatchInfoAnd p)) C(() x)
52 type SealedPatchSet p = Sealed (RL (RL (PatchInfoAnd p)) C(()))
53 \end{code}