Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type family Elem (x :: k) (xs :: [k]) :: Bool where
- Elem x '[] = 'False
- Elem x (x ': xs) = 'True
- Elem x (y ': xs) = Elem x xs
- type family If (condition :: Bool) (t :: k) (e :: k) :: k where
- If 'True t e = t
- If 'False t e = e
- type family Without (xs :: [k]) (ys :: [k]) :: [k] where
- Without xs '[] = xs
- Without '[] ys = '[]
- Without (x ': xs) ys = If (x `Elem` ys) (Without xs ys) (x ': Without xs ys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement