+
+-- | Combine two Maybes into one, essentially mashing them
+-- together. We give precedence to the second argument when both are
+-- Justs.
+merge_maybes :: (Maybe a) -> (Maybe a) -> (Maybe a)
+merge_maybes Nothing Nothing = Nothing
+merge_maybes (Just x) Nothing = Just x
+merge_maybes Nothing (Just x) = Just x
+merge_maybes (Just _) (Just y) = Just y
+
+
+-- | The Monoid instance for these lets us "combine" two
+-- OptionalConfigurations. The "combine" operation that we'd like to
+-- perform is, essentially, to mash them together. So if we have two
+-- OptionalConfigurations, each half full, we could combine them
+-- into one big one.
+--
+-- This is used to merge command-line and config-file settings.
+--