From e38719e612eaf9d8774b5bba44ec5144a721a343 Mon Sep 17 00:00:00 2001 From: Luc Tielen Date: Mon, 21 Feb 2022 08:56:09 +0100 Subject: [PATCH] Add implementation for (+++) --- lib/Language/Souffle/Analysis.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Language/Souffle/Analysis.hs b/lib/Language/Souffle/Analysis.hs index e66fb18..ff13145 100644 --- a/lib/Language/Souffle/Analysis.hs +++ b/lib/Language/Souffle/Analysis.hs @@ -122,3 +122,13 @@ instance (Monad m, Monoid (m ())) => ArrowChoice (Analysis m) where left = left' right = right' + + Analysis f1 r1 g1 +++ Analysis f2 r2 g2 = Analysis f' (r1 <> r2) g' + where + f' = \case + Left b -> f1 b + Right b' -> f2 b' + g' = \case + Left b -> Left <$> g1 b + Right b' -> Right <$> g2 b' +