1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Define a type family computing occurrence within a nested sum.

This commit is contained in:
Rob Rix 2019-09-24 12:22:01 -04:00
parent c45b96f577
commit e05860cc81
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -157,6 +157,11 @@ class Element sub sup where
prj :: sup a -> Maybe (sub a)
type family Elem sub sup where
Elem t t = 'True
Elem t (l :+: r) = Elem t l || Elem t r
Elem _ _ = 'False
type family a || b where
'True || _ = 'True
_ || 'True = 'True