From 2cfd3f1f5372144f5c60687422f3363a5a0a5728 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 8 Jan 2022 04:06:39 +0100 Subject: Blessings: optimize mconcat --- src/Blessings.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/Blessings.hs b/src/Blessings.hs index 3c00f38..559db3e 100644 --- a/src/Blessings.hs +++ b/src/Blessings.hs @@ -53,6 +53,10 @@ instance Semigroup (Blessings a) where instance Monoid (Blessings a) where mempty = Empty + mconcat = \case + x:[] -> x + x:xs -> Append x $ mconcat xs + [] -> Empty instance IsString a => IsString (Blessings a) where -- cgit v1.2.3