import qualified OptionalConfiguration as OC (
OptionalConfiguration(..),
import qualified OptionalConfiguration as OC (
OptionalConfiguration(..),
-- | Merge a 'Configuration' with an 'OptionalConfiguration'. This is
-- more or less the Monoid instance for 'OptionalConfiguration', but
-- since the two types are different, we have to repeat ourselves.
-- | Merge a 'Configuration' with an 'OptionalConfiguration'. This is
-- more or less the Monoid instance for 'OptionalConfiguration', but
-- since the two types are different, we have to repeat ourselves.
merge_optional :: Configuration
-> OC.OptionalConfiguration
-> Configuration
merge_optional cfg opt_cfg =
Configuration
merge_optional :: Configuration
-> OC.OptionalConfiguration
-> Configuration
merge_optional cfg opt_cfg =
Configuration
(OC.merge_maybes (host cfg) (OC.host opt_cfg))
(OC.merge_maybes (password cfg) (OC.password opt_cfg))
(OC.merge_maybes (port cfg) (OC.port opt_cfg))
(OC.merge_maybes (host cfg) (OC.host opt_cfg))
(OC.merge_maybes (password cfg) (OC.password opt_cfg))
(OC.merge_maybes (port cfg) (OC.port opt_cfg))
(OC.merge_maybes (username cfg) (OC.username opt_cfg))
where
-- | If the thing on the right is Just something, return that
(OC.merge_maybes (username cfg) (OC.username opt_cfg))
where
-- | If the thing on the right is Just something, return that