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:
parent
c45b96f577
commit
e05860cc81
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user