diff --git a/src/Quasar/Awaitable.hs b/src/Quasar/Awaitable.hs index 5f76ebfb26cc1281979c2fe0f7443201985f6485..78f19864ea41b29664e2889dde2daf4c37c31ea2 100644 --- a/src/Quasar/Awaitable.hs +++ b/src/Quasar/Awaitable.hs @@ -73,6 +73,12 @@ instance Monad Awaitable where Left ex -> pure $ Left ex Right x -> runAwaitable (fn x) +instance Semigroup r => Semigroup (Awaitable r) where + x <> y = liftA2 (<>) x y + +instance Monoid r => Monoid (Awaitable r) where + mempty = pure mempty + completedAwaitable :: Either SomeException r -> Awaitable r