on develop help sign in
WIP make old in terms of new
c3cac44John Ericson
src/Data/Patch/MapWithMove.hs+15
@@ -27,6 +27,7 @@ import Data.List
27import Data.Map (Map)
27import Data.Map (Map)
28import qualified Data.Map as Map
28import qualified Data.Map as Map
29import Data.Maybe
29import Data.Maybe
30+--import Data.Proxy
30#if !MIN_VERSION_base(4,9,0)
31#if !MIN_VERSION_base(4,9,0)
31import Data.Semigroup (Semigroup (..), (<>))
32import Data.Semigroup (Semigroup (..), (<>))
32#endif
33#endif
@@ -47,6 +48,13 @@ deriving instance (Ord k, Read k, Read p, Read (PatchTarget p)) => Read (PatchMa
47deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (PatchMapWithMove k p)
48deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (PatchMapWithMove k p)
48deriving instance (Ord k, Ord p, Ord (PatchTarget p)) => Ord (PatchMapWithMove k p)
49deriving instance (Ord k, Ord p, Ord (PatchTarget p)) => Ord (PatchMapWithMove k p)
49
50
51+-- -- | Skips the patch so it's 'Functor' and friends
52+-- newtype PatchMapWithMove' k v = PatchMapWithMove' { unPatchMapWithMove' :: PatchMapWithMove k (Proxy v) }
53+--
54+-- deriving instance Functor (PatchMapWithMove' k)
55+-- deriving instance Foldable (PatchMapWithMove' k)
56+-- deriving instance Traversable (PatchMapWithMove' k)
57+
50-- | Holds the information about each key: where its new value should come from,
58-- | Holds the information about each key: where its new value should come from,
51-- and where its old value should go to
59-- and where its old value should go to
52data NodeInfo k p = NodeInfo
60data NodeInfo k p = NodeInfo
@@ -83,6 +91,13 @@ data To k p
83 )
91 )
84
92
85makeWrapped ''PatchMapWithMove
93makeWrapped ''PatchMapWithMove
94+--makeWrapped ''PatchMapWithMove'
95+
96+-- instance FunctorWithIndex k (PatchMapWithMove k)
97+-- instance FoldableWithIndex k (PatchMapWithMove k)
98+-- instance TraversableWithIndex k (PatchMapWithMove k) where
99+-- itraverse = itraversed . Indexed
100+-- itraversed = _Wrapped .> itraversed <. traversed
86
101
87-- | Create a 'PatchMapWithMove', validating it
102-- | Create a 'PatchMapWithMove', validating it
88patchMapWithMove
103patchMapWithMove