From 1ce722d86f0ff5833b6cf05240a4863cac1f26fd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Jan 2020 13:49:12 -0400 Subject: [PATCH] avoid relying on crazy monoid instance This code worked as intended, but only by accident, because of this instance: instance Monoid b => Monoid (x -> b) where mempty = const (mempty :: b) Let's be explicit that we throw away the error message. --- Remote/List.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Remote/List.hs b/Remote/List.hs index 9a8bd2fb3e..19123cf5fb 100644 --- a/Remote/List.hs +++ b/Remote/List.hs @@ -112,7 +112,8 @@ remoteGen m t g = do let c = fromMaybe M.empty $ M.lookup cu m pc <- if null c then pure mempty - else either mempty id . parseRemoteConfig c <$> configParser t + else either (const mempty) id . parseRemoteConfig c + <$> configParser t generate t g u pc gc rs >>= \case Nothing -> return Nothing Just r -> Just <$> adjustExportImport (adjustReadOnly (addHooks r)) rs