module Network.Orchid.Core.Backend where import Data.List (intercalate) type Author = String type Date = String data Revision = Revision { date :: Date , author :: Author , name :: String } instance Show Revision where show (Revision d a n) = intercalate "\n" [sd, sa, sn] where sd = if null d then "" else d sa = if null a then "" else a sn = if null n then "" else n type History = [Revision] data Backend = Backend { store :: FilePath -> Revision -> String -> IO () , retrieve :: FilePath -> Revision -> IO (Maybe String) , delete :: FilePath -> Revision -> IO () , history :: FilePath -> IO (Maybe History) }