[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:47:57 UTC 2010


The following commit has been merged in the master branch:
commit d6f7bf04d75a320d7260e0c4f86ebdd5a4a80116
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sat Nov 20 03:52:27 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-102)

diff --git a/ChangeLog b/ChangeLog
index 1fe6a9a..9223e06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-19 20:52:27 GMT	John Goerzen <jgoerzen at complete.org>	patch-102
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.5--patch-102
+
+
+    new files:
+     libsrc/MissingH/ConfigParser.hs
+
+    modified files:
+     ChangeLog
+
+
 2004-11-19 19:16:37 GMT	John Goerzen <jgoerzen at complete.org>	patch-101
 
     Summary:
diff --git a/libsrc/MissingH/ConfigParser.hs b/libsrc/MissingH/ConfigParser.hs
new file mode 100644
index 0000000..13e4020
--- /dev/null
+++ b/libsrc/MissingH/ConfigParser.hs
@@ -0,0 +1,62 @@
+{- arch-tag: ConfigParser main file
+Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+-}
+
+{- |
+   Module     : MissingH.ConfigParser
+   Copyright  : Copyright (C) 2004 John Goerzen
+   License    : GNU GPL, version 2 or above
+
+   Maintainer : John Goerzen, 
+   Maintainer : jgoerzen at complete.org
+   Stability  : provisional
+   Portability: portable
+
+Configuration file parsing, generation, and manipulation
+
+Copyright (c) 2004 John Goerzen, jgoerzen\@complete.org
+-}
+module MissingH.ConfigParser
+    (
+     -- * Initialization
+     empty,
+     -- * Reading
+     -- * Whole-File Manipulation
+     merge
+) where
+import MissingH.ConfigParser.Types
+import MissingH.ConfigParser.Parser
+import Data.FiniteMap
+
+{- | Combines two 'ConfigParser's into one.
+
+Any duplicate options are resolved to contain the value specified in
+the second parser.
+
+The 'ConfigParser' options in the resulting object will be set as they
+are in the second one passed to this function. -}
+merge :: ConfigParser -> ConfigParser -> ConfigParser
+merge src dest = 
+    let conv :: String -> String
+        conv = optionxform dest
+        convFM :: String -> CPOptions -> CPOptions
+        convFM _ = listToFM . map (\x -> (conv (fst x), snd x)) . fmToList
+        in
+        ConfigParser { content = plusFM (mapFM convFM (content src)) 
+                                 (content dest),
+                       optionxform = optionxform dest,
+                       usedefault = usedefault dest }

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list