From 4199011b42b3eba837b88167287b51d591e23567 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 23 Sep 2019 15:02:17 -0400 Subject: [PATCH] Define an Element instance for matching on the left. --- semantic-tags/src/Tags/Taggable/Precise.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/semantic-tags/src/Tags/Taggable/Precise.hs b/semantic-tags/src/Tags/Taggable/Precise.hs index 387b10402..52e834f9e 100644 --- a/semantic-tags/src/Tags/Taggable/Precise.hs +++ b/semantic-tags/src/Tags/Taggable/Precise.hs @@ -143,3 +143,8 @@ instance {-# OVERLAPPABLE #-} reassoc (L1 (L1 l)) = L1 l reassoc (L1 (R1 l)) = R1 (L1 l) reassoc (R1 r) = R1 (R1 r) + +instance {-# OVERLAPPABLE #-} + Element t (t :+: r) where + prj (L1 l) = Just l + prj _ = Nothing