From 5231b4f282c5c8af45079087dc8f509890200659 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 23 Sep 2019 18:01:00 -0400 Subject: [PATCH] Define a GSum instance for sums. --- 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 9fdca6d64..d11f5925b 100644 --- a/semantic-tags/src/Tags/Taggable/Precise.hs +++ b/semantic-tags/src/Tags/Taggable/Precise.hs @@ -187,3 +187,8 @@ class GSum t where instance GSum f => GSum (M1 i c f) where type Members (M1 i c f) = Members f gmembers = gmembers . unM1 + +instance (GSum f, GSum g) => GSum (f :+: g) where + type Members (f :+: g) = Members f :+: Members g + gmembers (L1 l) = L1 (gmembers l) + gmembers (R1 r) = R1 (gmembers r)