1 -- Copyright (C) 2006-2007 David Roundy
    2 --
    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.
    7 --
    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.
   12 --
   13 -- You should have received a copy of the GNU General Public License
   14 -- along with this program; if not, write to the Free Software Foundation,
   15 -- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   16 
   17 {-# OPTIONS_GHC -cpp -fglasgow-exts #-}
   18 {-# LANGUAGE CPP #-}
   19 -- , KindSignatures #-}
   20 
   21 #include "gadts.h"
   22 
   23 module Darcs.Repository.InternalTypes ( Repository(..), RepoType(..), Pristine(..)
   24                                       , extractCache
   25                                       ) where
   26 
   27 import Darcs.Repository.Cache ( Cache )
   28 import Darcs.Flags ( DarcsFlag )
   29 import Darcs.Repository.Format ( RepoFormat )
   30 
   31 data Pristine
   32   = NoPristine !String
   33   | PlainPristine !String
   34   | HashedPristine
   35     deriving ( Show )
   36 
   37 data Repository (p :: * C(-> * -> *)) C(recordedstate unrecordedstate tentativestate) = Repo !String ![DarcsFlag] !RepoFormat !(RepoType p) deriving ( Show )
   38 
   39 data RepoType (p :: * C(-> * -> *)) = DarcsRepository !Pristine Cache deriving ( Show )
   40 
   41 extractCache :: Repository p C(r u t) -> Cache
   42 extractCache (Repo _ _ _ (DarcsRepository _ c)) = c