git.iko.soy/type-level-sets
on master help sign in
Generalized an instance of Updatable
commit437855cd352b4553514d72cd6301a656bc8d46fe authorJoshua Chia <joshchia@gmail.com> dateFri 9 Mar 2018, 00:23 (9 years ago) parent9e6a0c7
1 file changed+6−2
src/Data/Type/Map.hs+6−2
src/Data/Type/Map.hs+6−2
@@ -100,8 +100,12 @@ instance {-# OVERLAPS #-} Updatable v t ((v ':-> s) ': m) ((v ':-> t) ': m) wher
100100instance Updatable v t m n => Updatable v t ((w ':-> y) ': m) ((w ':-> y) ': n) where
101101 update (Ext w y m) v x = Ext w y (update m v x)
102102
103−instance Updatable v t '[] '[v ':-> t] where
104− update Empty v x = Ext v x Empty
103+-- instance Updatable v t '[] '[v ':-> t] where
104+-- update Empty v x = Ext v x Empty
105+
106+instance Updatable v t s ((v ':-> t) ': s) where
107+ update xs v x = Ext v x xs
108+
105109
106110{-| Predicate to check if in normalised map form -}
107111type IsMap s = (s ~ Nub (Sort s))