1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Define a GSum instance for sums.

This commit is contained in:
Rob Rix 2019-09-23 18:01:00 -04:00
parent 30dad2da72
commit 5231b4f282
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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)