@@ -1,7 +1,10 @@
1{-# LANGUAGE DeriveFoldable #-}
1{-# LANGUAGE DeriveFoldable #-}
2{-# LANGUAGE DeriveFunctor #-}
2{-# LANGUAGE DeriveFunctor #-}
3{-# LANGUAGE DeriveTraversable #-}
3{-# LANGUAGE DeriveTraversable #-}
4+{-# LANGUAGE FlexibleInstances #-}
4{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
6+{-# LANGUAGE MultiParamTypeClasses #-}
7+{-# LANGUAGE TemplateHaskell #-}
5{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
6-- | Module containing 'PatchIntMap', a 'Patch' for 'IntMap' which allows for
9-- | Module containing 'PatchIntMap', a 'Patch' for 'IntMap' which allows for
7-- insert/update or delete of associations.
10-- insert/update or delete of associations.
@@ -27,6 +30,8 @@ instance Patch (PatchIntMap a) where
27 adds = IntMap.mapMaybe id p
30 adds = IntMap.mapMaybe id p
28 in IntMap.union adds $ v `IntMap.difference` removes
31 in IntMap.union adds $ v `IntMap.difference` removes
33+makeWrapped ''PatchIntMap
30-- | @a <> b@ will apply the changes of @b@ and then apply the changes of @a@.
35-- | @a <> b@ will apply the changes of @b@ and then apply the changes of @a@.
31-- If the same key is modified by both patches, the one on the left will take
36-- If the same key is modified by both patches, the one on the left will take
32-- precedence.
37-- precedence.