git.iko.soy/type-level-sets
on master help sign in
keep deleting elements from the set
commit5bf0c0c53947b439e012b78fb8399ef40e5b6ae6 authordominic <dom.orchard@gmail.com> dateThu 29 Nov 2018, 11:33 (8 years ago) parent4242bd1
1 file changed+3−3
src/Data/Type/Set.hs+3−3
src/Data/Type/Set.hs+3−3
@@ -77,7 +77,7 @@ append (Ext e xs) ys = Ext e (append xs ys)
7777{-| Delete elements from a set -}
7878type family (m :: [k]) :\ (x :: k) :: [k] where
7979 '[] :\ x = '[]
80− (x ': xs) :\ x = xs
80+ (x ': xs) :\ x = xs :\ x
8181 (y ': xs) :\ x = y ': (xs :\ x)
8282
8383class Remove s t where
@@ -86,8 +86,8 @@ class Remove s t where
8686instance Remove '[] t where
8787 remove Empty Proxy = Empty
8888
89−instance {-# OVERLAPS #-} Remove (x ': xs) x where
90− remove (Ext _ xs) Proxy = xs
89+instance {-# OVERLAPS #-} Remove xs x => Remove (x ': xs) x where
90+ remove (Ext _ xs) x@Proxy = remove xs x
9191
9292instance {-# OVERLAPPABLE #-} (((y : xs) :\ x) ~ (y : (xs :\ x)), Remove xs x)
9393 => Remove (y ': xs) x where