on develop help sign in
Merge remote-tracking branch 'origin/develop' into fast-weak-partial-requester
cbe4381Ryan Trinkle
reflex.cabal+7−4
@@ -64,7 +64,7 @@ library
64 semigroupoids >= 4.0 && < 6,
64 semigroupoids >= 4.0 && < 6,
65 semigroups >= 0.16 && < 0.19,
65 semigroups >= 0.16 && < 0.19,
66 stm == 2.4.*,
66 stm == 2.4.*,
67− syb >= 0.5 && < 0.7,
67+ syb >= 0.5 && < 0.8,
68 these >= 0.4 && < 0.8,
68 these >= 0.4 && < 0.8,
69 transformers >= 0.2,
69 transformers >= 0.2,
70 transformers-compat >= 0.3
70 transformers-compat >= 0.3
@@ -101,7 +101,8 @@ library
101 Reflex.Requester.Base,
101 Reflex.Requester.Base,
102 Reflex.Requester.Class,
102 Reflex.Requester.Class,
103 Reflex.Spider,
103 Reflex.Spider,
104− Reflex.Spider.Internal
104+ Reflex.Spider.Internal,
105+ Reflex.Widget.Basic
105
106
106 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
107 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
107 ghc-prof-options: -fprof-auto
108 ghc-prof-options: -fprof-auto
@@ -125,8 +126,8 @@ library
125 build-depends:
126 build-depends:
126 dependent-sum >= 0.3 && < 0.5,
127 dependent-sum >= 0.3 && < 0.5,
127 haskell-src-exts >= 1.16 && < 1.19,
128 haskell-src-exts >= 1.16 && < 1.19,
128− haskell-src-meta >= 0.6 && < 0.8,
129+ haskell-src-meta >= 0.6 && < 0.9,
129− template-haskell >= 2.9 && < 2.12
130+ template-haskell >= 2.9 && < 2.13
130 exposed-modules:
131 exposed-modules:
131 Reflex.Dynamic.TH
132 Reflex.Dynamic.TH
132 other-extensions: TemplateHaskell
133 other-extensions: TemplateHaskell
@@ -244,6 +245,8 @@ test-suite GC-Semantics
244 , transformers
245 , transformers
245 , reflex
246 , reflex
246 , ref-tf
247 , ref-tf
248+ if impl(ghc < 8)
249+ build-depends: semigroups
247
250
248test-suite rootCleanup
251test-suite rootCleanup
249 type: exitcode-stdio-1.0
252 type: exitcode-stdio-1.0
src/Data/AppendMap.hs+151−152
@@ -7,7 +7,6 @@
7{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE RoleAnnotations #-}
8{-# LANGUAGE RoleAnnotations #-}
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10−{-# LANGUAGE TypeApplications #-}
11{-# LANGUAGE TypeFamilies #-}
10{-# LANGUAGE TypeFamilies #-}
12-- | 'Data.Map' with a better 'Monoid' instance
11-- | 'Data.Map' with a better 'Monoid' instance
13--
12--
@@ -86,108 +85,108 @@ instance (Ord k, Group q) => Group (AppendMap k q) where
86instance (Ord k, Additive q) => Additive (AppendMap k q)
85instance (Ord k, Additive q) => Additive (AppendMap k q)
87
86
88(!) :: forall k a. Ord k => AppendMap k a -> k -> a
87(!) :: forall k a. Ord k => AppendMap k a -> k -> a
89−(!) = coerce ((Map.!) @k @a)
88+(!) = coerce ((Map.!) :: Map k a -> k -> a)
90infixl 9 !
89infixl 9 !
91
90
92(\\) :: forall k a b. Ord k => AppendMap k a -> AppendMap k b -> AppendMap k a
91(\\) :: forall k a b. Ord k => AppendMap k a -> AppendMap k b -> AppendMap k a
93−(\\) = coerce ((Map.\\) @k @a @b)
92+(\\) = coerce ((Map.\\) :: Map k a -> Map k b -> Map k a)
94infixl 9 \\
93infixl 9 \\
95
94
96null :: forall k a. AppendMap k a -> Bool
95null :: forall k a. AppendMap k a -> Bool
97−null = coerce (Map.null @k @a)
96+null = coerce (Map.null :: Map k a -> Bool)
98
97
99size :: forall k a. AppendMap k a -> Int
98size :: forall k a. AppendMap k a -> Int
100−size = coerce (Map.size @k @a)
99+size = coerce (Map.size :: Map k a -> Int)
101
100
102member :: forall k a. Ord k => k -> AppendMap k a -> Bool
101member :: forall k a. Ord k => k -> AppendMap k a -> Bool
103−member = coerce (Map.member @k @a)
102+member = coerce (Map.member :: k -> Map k a -> Bool)
104
103
105notMember :: forall k a. Ord k => k -> AppendMap k a -> Bool
104notMember :: forall k a. Ord k => k -> AppendMap k a -> Bool
106−notMember = coerce (Map.notMember @k @a)
105+notMember = coerce (Map.notMember :: k -> Map k a -> Bool)
107
106
108lookup :: forall k a. Ord k => k -> AppendMap k a -> Maybe a
107lookup :: forall k a. Ord k => k -> AppendMap k a -> Maybe a
109−lookup = coerce (Map.lookup @k @a)
108+lookup = coerce (Map.lookup :: k -> Map k a -> Maybe a)
110
109
111findWithDefault :: forall k a. Ord k => a -> k -> AppendMap k a -> a
110findWithDefault :: forall k a. Ord k => a -> k -> AppendMap k a -> a
112−findWithDefault = coerce (Map.findWithDefault @k @a)
111+findWithDefault = coerce (Map.findWithDefault :: a -> k -> Map k a -> a)
113
112
114lookupLT :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
113lookupLT :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
115−lookupLT = coerce (Map.lookupLT @k @a)
114+lookupLT = coerce (Map.lookupLT :: k -> Map k a -> Maybe (k,a))
116
115
117lookupGT :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
116lookupGT :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
118−lookupGT = coerce (Map.lookupGT @k @a)
117+lookupGT = coerce (Map.lookupGT :: k -> Map k a -> Maybe (k,a))
119
118
120lookupLE :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
119lookupLE :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
121−lookupLE = coerce (Map.lookupLE @k @a)
120+lookupLE = coerce (Map.lookupLE :: k -> Map k a -> Maybe (k,a))
122
121
123lookupGE :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
122lookupGE :: forall k a. Ord k => k -> AppendMap k a -> Maybe (k, a)
124−lookupGE = coerce (Map.lookupGE @k @a)
123+lookupGE = coerce (Map.lookupGE :: k -> Map k a -> Maybe (k,a))
125
124
126empty :: forall k a. AppendMap k a
125empty :: forall k a. AppendMap k a
127−empty = coerce (Map.empty @k @a)
126+empty = coerce (Map.empty :: Map k a)
128
127
129singleton :: forall k a. k -> a -> AppendMap k a
128singleton :: forall k a. k -> a -> AppendMap k a
130−singleton = coerce (Map.singleton @k @a)
129+singleton = coerce (Map.singleton :: k -> a -> Map k a)
131
130
132insert :: forall k a. Ord k => k -> a -> AppendMap k a -> AppendMap k a
131insert :: forall k a. Ord k => k -> a -> AppendMap k a -> AppendMap k a
133−insert = coerce (Map.insert @k @a)
132+insert = coerce (Map.insert :: k -> a -> Map k a -> Map k a)
134
133
135−insertWith :: Ord k => (a -> a -> a) -> k -> a -> AppendMap k a -> AppendMap k a
134+insertWith :: forall k a. Ord k => (a -> a -> a) -> k -> a -> AppendMap k a -> AppendMap k a
136−insertWith f = coerce (Map.insertWith f)
135+insertWith = coerce (Map.insertWith :: (a -> a -> a) -> k -> a -> Map k a -> Map k a)
137
136
138−insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> AppendMap k a -> AppendMap k a
137+insertWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> k -> a -> AppendMap k a -> AppendMap k a
139−insertWithKey f = coerce (Map.insertWithKey f)
138+insertWithKey = coerce (Map.insertWithKey :: (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a)
140
139
141−insertLookupWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> AppendMap k a -> (Maybe a, AppendMap k a)
140+insertLookupWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> k -> a -> AppendMap k a -> (Maybe a, AppendMap k a)
142−insertLookupWithKey f = coerce (Map.insertLookupWithKey f)
141+insertLookupWithKey = coerce (Map.insertLookupWithKey :: (k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a))
143
142
144delete :: forall k a. Ord k => k -> AppendMap k a -> AppendMap k a
143delete :: forall k a. Ord k => k -> AppendMap k a -> AppendMap k a
145−delete = coerce (Map.delete @k @a)
144+delete = coerce (Map.delete :: k -> Map k a -> Map k a)
146
145
147−adjust :: Ord k => (a -> a) -> k -> AppendMap k a -> AppendMap k a
146+adjust :: forall k a. Ord k => (a -> a) -> k -> AppendMap k a -> AppendMap k a
148−adjust f = coerce (Map.adjust f)
147+adjust = coerce (Map.adjust :: (a -> a) -> k -> Map k a -> Map k a)
149
148
150−adjustWithKey :: Ord k => (k -> a -> a) -> k -> AppendMap k a -> AppendMap k a
149+adjustWithKey :: forall k a. Ord k => (k -> a -> a) -> k -> AppendMap k a -> AppendMap k a
151−adjustWithKey f = coerce (Map.adjustWithKey f)
150+adjustWithKey = coerce (Map.adjustWithKey :: (k -> a -> a) -> k -> Map k a -> Map k a)
152
151
153−update :: Ord k => (a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
152+update :: forall k a. Ord k => (a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
154−update f = coerce (Map.update f)
153+update = coerce (Map.update :: (a -> Maybe a) -> k -> Map k a -> Map k a)
155
154
156−updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
155+updateWithKey :: forall k a. Ord k => (k -> a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
157−updateWithKey f = coerce (Map.updateWithKey f)
156+updateWithKey = coerce (Map.updateWithKey :: (k -> a -> Maybe a) -> k -> Map k a -> Map k a)
158
157
159−updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> AppendMap k a -> (Maybe a, AppendMap k a)
158+updateLookupWithKey :: forall k a. Ord k => (k -> a -> Maybe a) -> k -> AppendMap k a -> (Maybe a, AppendMap k a)
160−updateLookupWithKey f = coerce (Map.updateLookupWithKey f)
159+updateLookupWithKey = coerce (Map.updateLookupWithKey :: (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a, Map k a))
161
160
162−alter :: Ord k => (Maybe a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
161+alter :: forall k a. Ord k => (Maybe a -> Maybe a) -> k -> AppendMap k a -> AppendMap k a
163−alter f = coerce (Map.alter f)
162+alter = coerce (Map.alter :: (Maybe a -> Maybe a) -> k -> Map k a -> Map k a)
164
163
165−unionWith :: Ord k => (a -> a -> a) -> AppendMap k a -> AppendMap k a -> AppendMap k a
164+unionWith :: forall k a. Ord k => (a -> a -> a) -> AppendMap k a -> AppendMap k a -> AppendMap k a
166−unionWith f = coerce (Map.unionWith f)
165+unionWith = coerce (Map.unionWith :: (a -> a -> a) -> Map k a -> Map k a -> Map k a)
167
166
168−unionWithKey :: Ord k => (k -> a -> a -> a) -> AppendMap k a -> AppendMap k a -> AppendMap k a
167+unionWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> AppendMap k a -> AppendMap k a -> AppendMap k a
169−unionWithKey f = coerce (Map.unionWithKey f)
168+unionWithKey = coerce (Map.unionWithKey :: (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a)
170
169
171−unionsWith :: Ord k => (a -> a -> a) -> [AppendMap k a] -> AppendMap k a
170+unionsWith :: forall k a. Ord k => (a -> a -> a) -> [AppendMap k a] -> AppendMap k a
172−unionsWith f = coerce (Map.unionsWith f)
171+unionsWith = coerce (Map.unionsWith :: (a -> a -> a) -> [Map k a] -> Map k a)
173
172
174−difference :: Ord k => AppendMap k a -> AppendMap k b -> AppendMap k a
173+difference :: forall k a b. Ord k => AppendMap k a -> AppendMap k b -> AppendMap k a
175difference = (\\)
174difference = (\\)
176
175
177−differenceWith :: Ord k => (a -> b -> Maybe a) -> AppendMap k a -> AppendMap k b -> AppendMap k a
176+differenceWith :: forall k a b. Ord k => (a -> b -> Maybe a) -> AppendMap k a -> AppendMap k b -> AppendMap k a
178−differenceWith f = coerce (Map.differenceWith f)
177+differenceWith = coerce (Map.differenceWith :: (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a)
179
178
180−differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> AppendMap k a -> AppendMap k b -> AppendMap k a
179+differenceWithKey :: forall k a b. Ord k => (k -> a -> b -> Maybe a) -> AppendMap k a -> AppendMap k b -> AppendMap k a
181−differenceWithKey f = coerce (Map.differenceWithKey f)
180+differenceWithKey = coerce (Map.differenceWithKey :: (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a)
182
181
183−intersectionWith :: Ord k => (a -> b -> c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
182+intersectionWith :: forall k a b c. Ord k => (a -> b -> c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
184−intersectionWith f = coerce (Map.intersectionWith f)
183+intersectionWith = coerce (Map.intersectionWith :: (a -> b -> c) -> Map k a -> Map k b -> Map k c)
185
184
186−intersectionWithKey :: Ord k => (k -> a -> b -> c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
185+intersectionWithKey :: forall k a b c. Ord k => (k -> a -> b -> c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
187−intersectionWithKey f = coerce (Map.intersectionWithKey f)
186+intersectionWithKey = coerce (Map.intersectionWithKey :: (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c)
188
187
189−mergeWithKey :: Ord k => (k -> a -> b -> Maybe c) -> (AppendMap k a -> AppendMap k c) -> (AppendMap k b -> AppendMap k c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
188+mergeWithKey :: forall k a b c. Ord k => (k -> a -> b -> Maybe c) -> (AppendMap k a -> AppendMap k c) -> (AppendMap k b -> AppendMap k c) -> AppendMap k a -> AppendMap k b -> AppendMap k c
190−mergeWithKey f = coerce (Map.mergeWithKey f)
189+mergeWithKey = coerce (Map.mergeWithKey :: (k -> a -> b -> Maybe c) -> (Map k a -> Map k c) -> (Map k b -> Map k c) -> Map k a -> Map k b -> Map k c)
191
190
192map :: (a -> b) -> AppendMap k a -> AppendMap k b
191map :: (a -> b) -> AppendMap k a -> AppendMap k b
193map = fmap
192map = fmap
@@ -198,206 +197,206 @@ mapWithKey = imap
198traverseWithKey :: Applicative t => (k -> a -> t b) -> AppendMap k a -> t (AppendMap k b)
197traverseWithKey :: Applicative t => (k -> a -> t b) -> AppendMap k a -> t (AppendMap k b)
199traverseWithKey = itraverse
198traverseWithKey = itraverse
200
199
201−mapAccum :: (a -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
200+mapAccum :: forall k a b c. (a -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
202−mapAccum f = coerce (Map.mapAccum f)
201+mapAccum = coerce (Map.mapAccum :: (a -> b -> (a, c)) -> a -> Map k b -> (a, Map k c))
203
202
204−mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
203+mapAccumWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
205−mapAccumWithKey f = coerce (Map.mapAccumWithKey f)
204+mapAccumWithKey = coerce (Map.mapAccumWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c))
206
205
207−mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
206+mapAccumRWithKey :: forall k a b c. (a -> k -> b -> (a, c)) -> a -> AppendMap k b -> (a, AppendMap k c)
208−mapAccumRWithKey f = coerce (Map.mapAccumRWithKey f)
207+mapAccumRWithKey = coerce (Map.mapAccumRWithKey :: (a -> k -> b -> (a, c)) -> a -> Map k b -> (a, Map k c))
209
208
210mapKeys :: forall k1 k2 a. Ord k2 => (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
209mapKeys :: forall k1 k2 a. Ord k2 => (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
211−mapKeys = coerce (Map.mapKeys @k2 @k1 @a)
210+mapKeys = coerce (Map.mapKeys :: (k1 -> k2) -> Map k1 a -> Map k2 a)
212
211
213−mapKeysWith :: Ord k2 => (a -> a -> a) -> (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
212+mapKeysWith :: forall k1 k2 a. Ord k2 => (a -> a -> a) -> (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
214−mapKeysWith f = coerce (Map.mapKeysWith f)
213+mapKeysWith = coerce (Map.mapKeysWith :: (a -> a -> a) -> (k1 -> k2) -> Map k1 a -> Map k2 a)
215
214
216mapKeysMonotonic :: forall k1 k2 a. (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
215mapKeysMonotonic :: forall k1 k2 a. (k1 -> k2) -> AppendMap k1 a -> AppendMap k2 a
217−mapKeysMonotonic = coerce (Map.mapKeysMonotonic @k1 @k2 @a)
216+mapKeysMonotonic = coerce (Map.mapKeysMonotonic :: (k1 -> k2) -> Map k1 a -> Map k2 a)
218
217
219−foldr :: (a -> b -> b) -> b -> AppendMap k a -> b
218+foldr :: forall k a b. (a -> b -> b) -> b -> AppendMap k a -> b
220−foldr f = coerce (Map.foldr f)
219+foldr = coerce (Map.foldr :: (a -> b -> b) -> b -> Map k a -> b)
221
220
222−foldl :: (a -> b -> a) -> a -> AppendMap k b -> a
221+foldl :: forall k a b. (a -> b -> a) -> a -> AppendMap k b -> a
223−foldl f = coerce (Map.foldl f)
222+foldl = coerce (Map.foldl :: (a -> b -> a) -> a -> Map k b -> a)
224
223
225−foldrWithKey :: (k -> a -> b -> b) -> b -> AppendMap k a -> b
224+foldrWithKey :: forall k a b. (k -> a -> b -> b) -> b -> AppendMap k a -> b
226−foldrWithKey f = coerce (Map.foldrWithKey f)
225+foldrWithKey = coerce (Map.foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b)
227
226
228−foldlWithKey :: (a -> k -> b -> a) -> a -> AppendMap k b -> a
227+foldlWithKey :: forall k a b. (a -> k -> b -> a) -> a -> AppendMap k b -> a
229−foldlWithKey f = coerce (Map.foldlWithKey f)
228+foldlWithKey = coerce (Map.foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a)
230
229
231−foldMapWithKey :: Monoid m => (k -> a -> m) -> AppendMap k a -> m
230+foldMapWithKey :: forall k a m. Monoid m => (k -> a -> m) -> AppendMap k a -> m
232−foldMapWithKey f = coerce (Map.foldMapWithKey f)
231+foldMapWithKey = coerce (Map.foldMapWithKey :: Monoid m => (k -> a -> m) -> Map k a -> m)
233
232
234−foldr' :: (a -> b -> b) -> b -> AppendMap k a -> b
233+foldr' :: forall k a b. (a -> b -> b) -> b -> AppendMap k a -> b
235−foldr' f = coerce (Map.foldr' f)
234+foldr' = coerce (Map.foldr' :: (a -> b -> b) -> b -> Map k a -> b)
236
235
237−foldl' :: (a -> b -> a) -> a -> AppendMap k b -> a
236+foldl' :: forall k a b. (a -> b -> a) -> a -> AppendMap k b -> a
238−foldl' f = coerce (Map.foldl' f)
237+foldl' = coerce (Map.foldl' :: (a -> b -> a) -> a -> Map k b -> a)
239
238
240−foldrWithKey' :: (k -> a -> b -> b) -> b -> AppendMap k a -> b
239+foldrWithKey' :: forall k a b. (k -> a -> b -> b) -> b -> AppendMap k a -> b
241−foldrWithKey' f = coerce (Map.foldrWithKey' f)
240+foldrWithKey' = coerce (Map.foldrWithKey' :: (k -> a -> b -> b) -> b -> Map k a -> b)
242
241
243−foldlWithKey' :: (a -> k -> b -> a) -> a -> AppendMap k b -> a
242+foldlWithKey' :: forall k a b. (a -> k -> b -> a) -> a -> AppendMap k b -> a
244−foldlWithKey' f = coerce (Map.foldlWithKey' f)
243+foldlWithKey' = coerce (Map.foldlWithKey' :: (a -> k -> b -> a) -> a -> Map k b -> a)
245
244
246elems :: forall k a. AppendMap k a -> [a]
245elems :: forall k a. AppendMap k a -> [a]
247−elems = coerce (Map.elems @k @a)
246+elems = coerce (Map.elems :: Map k a -> [a])
248
247
249keys :: forall k a. AppendMap k a -> [k]
248keys :: forall k a. AppendMap k a -> [k]
250−keys = coerce (Map.keys @k @a)
249+keys = coerce (Map.keys :: Map k a -> [k])
251
250
252assocs :: forall k a. AppendMap k a -> [(k, a)]
251assocs :: forall k a. AppendMap k a -> [(k, a)]
253−assocs = coerce (Map.assocs @k @a)
252+assocs = coerce (Map.assocs :: Map k a -> [(k, a)])
254
253
255keysSet :: forall k a. AppendMap k a -> Set k
254keysSet :: forall k a. AppendMap k a -> Set k
256−keysSet = coerce (Map.keysSet @k @a)
255+keysSet = coerce (Map.keysSet :: Map k a -> Set k)
257
256
258−fromSet :: (k -> a) -> Set k -> AppendMap k a
257+fromSet :: forall k a. (k -> a) -> Set k -> AppendMap k a
259−fromSet f = coerce (Map.fromSet f)
258+fromSet = coerce (Map.fromSet :: (k -> a) -> Set k -> Map k a)
260
259
261toList :: forall k a. AppendMap k a -> [(k, a)]
260toList :: forall k a. AppendMap k a -> [(k, a)]
262−toList = coerce (Map.toList @k @a)
261+toList = coerce (Map.toList :: Map k a -> [(k, a)])
263
262
264fromList :: forall k a. Ord k => [(k, a)] -> AppendMap k a
263fromList :: forall k a. Ord k => [(k, a)] -> AppendMap k a
265−fromList = coerce (Map.fromList @k @a)
264+fromList = coerce (Map.fromList :: [(k, a)] -> Map k a)
266
265
267−fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> AppendMap k a
266+fromListWith :: forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> AppendMap k a
268−fromListWith f = coerce (Map.fromListWith f)
267+fromListWith = coerce (Map.fromListWith :: (a -> a -> a) -> [(k, a)] -> Map k a)
269
268
270−fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> AppendMap k a
269+fromListWithKey :: forall k a. Ord k => (k -> a -> a -> a) -> [(k, a)] -> AppendMap k a
271−fromListWithKey f = coerce (Map.fromListWithKey f)
270+fromListWithKey = coerce (Map.fromListWithKey :: (k -> a -> a -> a) -> [(k, a)] -> Map k a)
272
271
273toAscList :: forall k a. AppendMap k a -> [(k, a)]
272toAscList :: forall k a. AppendMap k a -> [(k, a)]
274−toAscList = coerce (Map.toAscList @k @a)
273+toAscList = coerce (Map.toAscList :: Map k a -> [(k, a)])
275
274
276toDescList :: forall k a. AppendMap k a -> [(k, a)]
275toDescList :: forall k a. AppendMap k a -> [(k, a)]
277−toDescList = coerce (Map.toDescList @k @a)
276+toDescList = coerce (Map.toDescList :: Map k a -> [(k, a)])
278
277
279fromAscList :: forall k a. Eq k => [(k, a)] -> AppendMap k a
278fromAscList :: forall k a. Eq k => [(k, a)] -> AppendMap k a
280−fromAscList = coerce (Map.fromAscList @k @a)
279+fromAscList = coerce (Map.fromAscList :: [(k, a)] -> Map k a)
281
280
282−fromAscListWith :: Eq k => (a -> a -> a) -> [(k, a)] -> AppendMap k a
281+fromAscListWith :: forall k a. Eq k => (a -> a -> a) -> [(k, a)] -> AppendMap k a
283−fromAscListWith f = coerce (Map.fromAscListWith f)
282+fromAscListWith = coerce (Map.fromAscListWith :: (a -> a -> a) -> [(k, a)] -> Map k a)
284
283
285−fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k, a)] -> AppendMap k a
284+fromAscListWithKey :: forall k a. Eq k => (k -> a -> a -> a) -> [(k, a)] -> AppendMap k a
286−fromAscListWithKey f = coerce (Map.fromAscListWithKey f)
285+fromAscListWithKey = coerce (Map.fromAscListWithKey :: (k -> a -> a -> a) -> [(k, a)] -> Map k a)
287
286
288fromDistinctAscList :: forall k a. [(k, a)] -> AppendMap k a
287fromDistinctAscList :: forall k a. [(k, a)] -> AppendMap k a
289−fromDistinctAscList = coerce (Map.fromDistinctAscList @k @a)
288+fromDistinctAscList = coerce (Map.fromDistinctAscList :: [(k, a)] -> Map k a)
290
289
291−filter :: (a -> Bool) -> AppendMap k a -> AppendMap k a
290+filter :: forall k a. (a -> Bool) -> AppendMap k a -> AppendMap k a
292−filter f = coerce (Map.filter f)
291+filter = coerce (Map.filter :: (a -> Bool) -> Map k a -> Map k a)
293
292
294−filterWithKey :: (k -> a -> Bool) -> AppendMap k a -> AppendMap k a
293+filterWithKey :: forall k a. (k -> a -> Bool) -> AppendMap k a -> AppendMap k a
295−filterWithKey f = coerce (Map.filterWithKey f)
294+filterWithKey = coerce (Map.filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a)
296
295
297−partition :: (a -> Bool) -> AppendMap k a -> (AppendMap k a, AppendMap k a)
296+partition :: forall k a. (a -> Bool) -> AppendMap k a -> (AppendMap k a, AppendMap k a)
298−partition f = coerce (Map.partition f)
297+partition = coerce (Map.partition :: (a -> Bool) -> Map k a -> (Map k a, Map k a))
299
298
300−partitionWithKey :: (k -> a -> Bool) -> AppendMap k a -> (AppendMap k a, AppendMap k a)
299+partitionWithKey :: forall k a. (k -> a -> Bool) -> AppendMap k a -> (AppendMap k a, AppendMap k a)
301−partitionWithKey f = coerce (Map.partitionWithKey f)
300+partitionWithKey = coerce (Map.partitionWithKey :: (k -> a -> Bool) -> Map k a -> (Map k a, Map k a))
302
301
303−mapMaybe :: (a -> Maybe b) -> AppendMap k a -> AppendMap k b
302+mapMaybe :: forall k a b. (a -> Maybe b) -> AppendMap k a -> AppendMap k b
304−mapMaybe f = coerce (Map.mapMaybe f)
303+mapMaybe = coerce (Map.mapMaybe :: (a -> Maybe b) -> Map k a -> Map k b)
305
304
306−mapMaybeWithKey :: (k -> a -> Maybe b) -> AppendMap k a -> AppendMap k b
305+mapMaybeWithKey :: forall k a b. (k -> a -> Maybe b) -> AppendMap k a -> AppendMap k b
307−mapMaybeWithKey f = coerce (Map.mapMaybeWithKey f)
306+mapMaybeWithKey = coerce (Map.mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b)
308
307
309−mapEither :: (a -> Either b c) -> AppendMap k a -> (AppendMap k b, AppendMap k c)
308+mapEither :: forall k a b c. (a -> Either b c) -> AppendMap k a -> (AppendMap k b, AppendMap k c)
310−mapEither f = coerce (Map.mapEither f)
309+mapEither = coerce (Map.mapEither :: (a -> Either b c) -> Map k a -> (Map k b, Map k c))
311
310
312−mapEitherWithKey :: (k -> a -> Either b c) -> AppendMap k a -> (AppendMap k b, AppendMap k c)
311+mapEitherWithKey :: forall k a b c. (k -> a -> Either b c) -> AppendMap k a -> (AppendMap k b, AppendMap k c)
313−mapEitherWithKey f = coerce (Map.mapEitherWithKey f)
312+mapEitherWithKey = coerce (Map.mapEitherWithKey :: (k -> a -> Either b c) -> Map k a -> (Map k b, Map k c))
314
313
315split :: forall k a. Ord k => k -> AppendMap k a -> (AppendMap k a, AppendMap k a)
314split :: forall k a. Ord k => k -> AppendMap k a -> (AppendMap k a, AppendMap k a)
316−split = coerce (Map.split @k @a)
315+split = coerce (Map.split :: k -> Map k a -> (Map k a, Map k a))
317
316
318splitLookup :: forall k a. Ord k => k -> AppendMap k a -> (AppendMap k a, Maybe a, AppendMap k a)
317splitLookup :: forall k a. Ord k => k -> AppendMap k a -> (AppendMap k a, Maybe a, AppendMap k a)
319−splitLookup = coerce (Map.splitLookup @k @a)
318+splitLookup = coerce (Map.splitLookup :: k -> Map k a -> (Map k a, Maybe a, Map k a))
320
319
321splitRoot :: forall k a. AppendMap k a -> [AppendMap k a]
320splitRoot :: forall k a. AppendMap k a -> [AppendMap k a]
322−splitRoot = coerce (Map.splitRoot @k @a)
321+splitRoot = coerce (Map.splitRoot :: Map k a -> [Map k a])
323
322
324isSubmapOf :: forall k a. (Ord k, Eq a) => AppendMap k a -> AppendMap k a -> Bool
323isSubmapOf :: forall k a. (Ord k, Eq a) => AppendMap k a -> AppendMap k a -> Bool
325−isSubmapOf = coerce (Map.isSubmapOf @k @a)
324+isSubmapOf = coerce (Map.isSubmapOf :: Map k a -> Map k a -> Bool)
326
325
327−isSubmapOfBy :: Ord k => (a -> b -> Bool) -> AppendMap k a -> AppendMap k b -> Bool
326+isSubmapOfBy :: forall k a b. Ord k => (a -> b -> Bool) -> AppendMap k a -> AppendMap k b -> Bool
328−isSubmapOfBy f = coerce (Map.isSubmapOfBy f)
327+isSubmapOfBy = coerce (Map.isSubmapOfBy :: (a -> b -> Bool) -> Map k a -> Map k b -> Bool)
329
328
330isProperSubmapOf :: forall k a. (Ord k, Eq a) => AppendMap k a -> AppendMap k a -> Bool
329isProperSubmapOf :: forall k a. (Ord k, Eq a) => AppendMap k a -> AppendMap k a -> Bool
331−isProperSubmapOf = coerce (Map.isProperSubmapOf @k @a)
330+isProperSubmapOf = coerce (Map.isProperSubmapOf :: Map k a -> Map k a -> Bool)
332
331
333−isProperSubmapOfBy :: Ord k => (a -> b -> Bool) -> AppendMap k a -> AppendMap k b -> Bool
332+isProperSubmapOfBy :: forall k a b. Ord k => (a -> b -> Bool) -> AppendMap k a -> AppendMap k b -> Bool
334−isProperSubmapOfBy f = coerce (Map.isProperSubmapOfBy f)
333+isProperSubmapOfBy = coerce (Map.isProperSubmapOfBy :: (a -> b -> Bool) -> Map k a -> Map k b -> Bool)
335
334
336lookupIndex :: forall k a. Ord k => k -> AppendMap k a -> Maybe Int
335lookupIndex :: forall k a. Ord k => k -> AppendMap k a -> Maybe Int
337−lookupIndex = coerce (Map.lookupIndex @k @a)
336+lookupIndex = coerce (Map.lookupIndex :: k -> Map k a -> Maybe Int)
338
337
339findIndex :: forall k a. Ord k => k -> AppendMap k a -> Int
338findIndex :: forall k a. Ord k => k -> AppendMap k a -> Int
340−findIndex = coerce (Map.findIndex @k @a)
339+findIndex = coerce (Map.findIndex :: k -> Map k a -> Int)
341
340
342elemAt :: forall k a. Int -> AppendMap k a -> (k, a)
341elemAt :: forall k a. Int -> AppendMap k a -> (k, a)
343−elemAt = coerce (Map.elemAt @k @a)
342+elemAt = coerce (Map.elemAt :: Int -> Map k a -> (k, a))
344
343
345updateAt :: forall k a. (k -> a -> Maybe a) -> Int -> AppendMap k a -> AppendMap k a
344updateAt :: forall k a. (k -> a -> Maybe a) -> Int -> AppendMap k a -> AppendMap k a
346−updateAt = coerce (Map.updateAt @k @a)
345+updateAt = coerce (Map.updateAt :: (k -> a -> Maybe a) -> Int -> Map k a -> Map k a)
347
346
348deleteAt :: forall k a. Int -> AppendMap k a -> AppendMap k a
347deleteAt :: forall k a. Int -> AppendMap k a -> AppendMap k a
349−deleteAt = coerce (Map.deleteAt @k @a)
348+deleteAt = coerce (Map.deleteAt :: Int -> Map k a -> Map k a)
350
349
351findMin :: forall k a. AppendMap k a -> (k, a)
350findMin :: forall k a. AppendMap k a -> (k, a)
352−findMin = coerce (Map.findMin @k @a)
351+findMin = coerce (Map.findMin :: Map k a -> (k, a))
353
352
354findMax :: forall k a. AppendMap k a -> (k, a)
353findMax :: forall k a. AppendMap k a -> (k, a)
355−findMax = coerce (Map.findMax @k @a)
354+findMax = coerce (Map.findMax :: Map k a -> (k, a))
356
355
357deleteMin :: forall k a. AppendMap k a -> AppendMap k a
356deleteMin :: forall k a. AppendMap k a -> AppendMap k a
358−deleteMin = coerce (Map.deleteMin @k @ a)
357+deleteMin = coerce (Map.deleteMin :: Map k a -> Map k a)
359
358
360deleteMax :: forall k a. AppendMap k a -> AppendMap k a
359deleteMax :: forall k a. AppendMap k a -> AppendMap k a
361−deleteMax = coerce (Map.deleteMax @k @a)
360+deleteMax = coerce (Map.deleteMax :: Map k a -> Map k a)
362
361
363deleteFindMin :: forall k a. AppendMap k a -> ((k, a), AppendMap k a)
362deleteFindMin :: forall k a. AppendMap k a -> ((k, a), AppendMap k a)
364−deleteFindMin = coerce (Map.deleteFindMin @k @a)
363+deleteFindMin = coerce (Map.deleteFindMin :: Map k a -> ((k, a), Map k a))
365
364
366deleteFindMax :: forall k a. AppendMap k a -> ((k, a), AppendMap k a)
365deleteFindMax :: forall k a. AppendMap k a -> ((k, a), AppendMap k a)
367−deleteFindMax = coerce (Map.deleteFindMax @k @a)
366+deleteFindMax = coerce (Map.deleteFindMax :: Map k a -> ((k, a), Map k a))
368
367
369−updateMin :: (a -> Maybe a) -> AppendMap k a -> AppendMap k a
368+updateMin :: forall k a. (a -> Maybe a) -> AppendMap k a -> AppendMap k a
370−updateMin f = coerce (Map.updateMin f)
369+updateMin = coerce (Map.updateMin :: (a -> Maybe a) -> Map k a -> Map k a)
371
370
372−updateMax :: (a -> Maybe a) -> AppendMap k a -> AppendMap k a
371+updateMax :: forall k a. (a -> Maybe a) -> AppendMap k a -> AppendMap k a
373−updateMax f = coerce (Map.updateMax f)
372+updateMax = coerce (Map.updateMax :: (a -> Maybe a) -> Map k a -> Map k a)
374
373
375−updateMinWithKey :: (k -> a -> Maybe a) -> AppendMap k a -> AppendMap k a
374+updateMinWithKey :: forall k a. (k -> a -> Maybe a) -> AppendMap k a -> AppendMap k a
376−updateMinWithKey f = coerce (Map.updateMinWithKey f)
375+updateMinWithKey = coerce (Map.updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a)
377
376
378−updateMaxWithKey :: (k -> a -> Maybe a) -> AppendMap k a -> AppendMap k a
377+updateMaxWithKey :: forall k a. (k -> a -> Maybe a) -> AppendMap k a -> AppendMap k a
379−updateMaxWithKey f = coerce (Map.updateMaxWithKey f)
378+updateMaxWithKey = coerce (Map.updateMaxWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a)
380
379
381minView :: forall k a. AppendMap k a -> Maybe (a, AppendMap k a)
380minView :: forall k a. AppendMap k a -> Maybe (a, AppendMap k a)
382−minView = coerce (Map.minView @k @a)
381+minView = coerce (Map.minView :: Map k a -> Maybe (a, Map k a))
383
382
384maxView :: forall k a. AppendMap k a -> Maybe (a, AppendMap k a)
383maxView :: forall k a. AppendMap k a -> Maybe (a, AppendMap k a)
385−maxView = coerce (Map.maxView @k @a)
384+maxView = coerce (Map.maxView :: Map k a -> Maybe (a, Map k a))
386
385
387minViewWithKey :: forall k a. AppendMap k a -> Maybe ((k, a), AppendMap k a)
386minViewWithKey :: forall k a. AppendMap k a -> Maybe ((k, a), AppendMap k a)
388−minViewWithKey = coerce (Map.minViewWithKey @k @a)
387+minViewWithKey = coerce (Map.minViewWithKey :: Map k a -> Maybe ((k, a), Map k a))
389
388
390maxViewWithKey :: forall k a. AppendMap k a -> Maybe ((k, a), AppendMap k a)
389maxViewWithKey :: forall k a. AppendMap k a -> Maybe ((k, a), AppendMap k a)
391−maxViewWithKey = coerce (Map.maxViewWithKey @k @a)
390+maxViewWithKey = coerce (Map.maxViewWithKey :: Map k a -> Maybe ((k, a), Map k a))
392
391
393showTree :: forall k a. (Show k, Show a) => AppendMap k a -> String
392showTree :: forall k a. (Show k, Show a) => AppendMap k a -> String
394−showTree = coerce (Map.showTree @k @a)
393+showTree = coerce (Map.showTree :: (Show k, Show a) => Map k a -> String)
395
394
396−showTreeWith :: (k -> a -> String) -> Bool -> Bool -> AppendMap k a -> String
395+showTreeWith :: forall k a. (k -> a -> String) -> Bool -> Bool -> AppendMap k a -> String
397−showTreeWith f = coerce (Map.showTreeWith f)
396+showTreeWith = coerce (Map.showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String)
398
397
399valid :: forall k a. Ord k => AppendMap k a -> Bool
398valid :: forall k a. Ord k => AppendMap k a -> Bool
400−valid = coerce (Map.valid @k @a)
399+valid = coerce (Map.valid :: Ord k => Map k a -> Bool)
401
400
402instance Default (AppendMap k a) where
401instance Default (AppendMap k a) where
403 def = empty
402 def = empty
src/Data/Functor/Misc.hs+6−1
@@ -292,7 +292,12 @@ dsumToEither = \case
292-- | We can't use @Compose Maybe@ instead of 'ComposeMaybe', because that would
292-- | We can't use @Compose Maybe@ instead of 'ComposeMaybe', because that would
293-- make the 'f' parameter have a nominal type role. We need f to be
293-- make the 'f' parameter have a nominal type role. We need f to be
294-- representational so that we can use safe 'coerce'.
294-- representational so that we can use safe 'coerce'.
295+#if MIN_VERSION_transformers(5,2,0)
296+newtype ComposeMaybe f a =
297+#else
298+newtype ComposeMaybe (f :: * -> *) (a :: *) =
299+#endif
295−newtype ComposeMaybe f a = ComposeMaybe { getComposeMaybe :: Maybe (f a) } deriving (Show, Eq, Ord)
300+ ComposeMaybe { getComposeMaybe :: Maybe (f a) } deriving (Show, Eq, Ord)
296
301
297deriving instance Functor f => Functor (ComposeMaybe f)
302deriving instance Functor f => Functor (ComposeMaybe f)
298
303
src/Reflex/EventWriter.hs+2−2
@@ -132,7 +132,7 @@ instance MonadHold t m => MonadHold t (EventWriterT t w m) where
132 holdDyn v0 = lift . holdDyn v0
132 holdDyn v0 = lift . holdDyn v0
133 holdIncremental v0 = lift . holdIncremental v0
133 holdIncremental v0 = lift . holdIncremental v0
134
134
135−instance (Reflex t, MonadAdjust t m, MonadHold t m, Semigroup w, Semigroup w) => MonadAdjust t (EventWriterT t w m) where
135+instance (Reflex t, MonadAdjust t m, MonadHold t m, Semigroup w) => MonadAdjust t (EventWriterT t w m) where
136 runWithReplace = runWithReplaceEventWriterTWith $ \dm0 dm' -> lift $ runWithReplace dm0 dm'
136 runWithReplace = runWithReplaceEventWriterTWith $ \dm0 dm' -> lift $ runWithReplace dm0 dm'
137 traverseIntMapWithKeyWithAdjust = sequenceIntMapWithAdjustEventWriterTWith (\f dm0 dm' -> lift $ traverseIntMapWithKeyWithAdjust f dm0 dm') patchIntMapNewElements mergeIntIncremental
137 traverseIntMapWithKeyWithAdjust = sequenceIntMapWithAdjustEventWriterTWith (\f dm0 dm' -> lift $ traverseIntMapWithKeyWithAdjust f dm0 dm') patchIntMapNewElements mergeIntIncremental
138 traverseDMapWithKeyWithAdjust = sequenceDMapWithAdjustEventWriterTWith (\f dm0 dm' -> lift $ traverseDMapWithKeyWithAdjust f dm0 dm') mapPatchDMap weakenPatchDMapWith patchMapNewElements mergeMapIncremental
138 traverseDMapWithKeyWithAdjust = sequenceDMapWithAdjustEventWriterTWith (\f dm0 dm' -> lift $ traverseDMapWithKeyWithAdjust f dm0 dm') mapPatchDMap weakenPatchDMapWith patchMapNewElements mergeMapIncremental
@@ -193,7 +193,7 @@ sequenceIntMapWithAdjustEventWriterTWith base patchNewElements mergePatchIncreme
193 return (result0, result')
193 return (result0, result')
194
194
195-- | Like 'runWithReplaceEventWriterTWith', but for 'sequenceDMapWithAdjust'.
195-- | Like 'runWithReplaceEventWriterTWith', but for 'sequenceDMapWithAdjust'.
196−sequenceDMapWithAdjustEventWriterTWith :: forall t m p p' w k v v'. (Reflex t, MonadHold t m, Semigroup w, Semigroup w, Patch (p' (Some k) (Event t w)), PatchTarget (p' (Some k) (Event t w)) ~ Map (Some k) (Event t w))
196+sequenceDMapWithAdjustEventWriterTWith :: forall t m p p' w k v v'. (Reflex t, MonadHold t m, Semigroup w, Patch (p' (Some k) (Event t w)), PatchTarget (p' (Some k) (Event t w)) ~ Map (Some k) (Event t w))
197 => ( (forall a. k a -> v a -> m (Compose ((,) (Event t w)) v' a))
197 => ( (forall a. k a -> v a -> m (Compose ((,) (Event t w)) v' a))
198 -> DMap k v
198 -> DMap k v
199 -> Event t (p k v)
199 -> Event t (p k v)
src/Reflex/Spider/Internal.hs+3−1
@@ -1157,7 +1157,9 @@ type ResultM = EventM
1157
1157
1158{-# NOINLINE unsafeNewIORef #-}
1158{-# NOINLINE unsafeNewIORef #-}
1159unsafeNewIORef :: a -> b -> IORef b
1159unsafeNewIORef :: a -> b -> IORef b
1160−unsafeNewIORef _ b = unsafePerformIO $ newIORef b
1160+unsafeNewIORef a b = unsafePerformIO $ do
1161+ touch a
1162+ newIORef b
1161
1163
1162instance HasSpiderTimeline x => Functor (Event x) where
1164instance HasSpiderTimeline x => Functor (Event x) where
1163 fmap f = push $ return . Just . f
1165 fmap f = push $ return . Just . f
src/Reflex/Widget/Basic.hsnew file+42
@@ -0,0 +1,42 @@
1+{-# LANGUAGE CPP #-}
2+{-# LANGUAGE ExplicitForAll #-}
3+{-# LANGUAGE MultiParamTypeClasses #-}
4+{-# LANGUAGE RecursiveDo #-}
5+#ifdef USE_REFLEX_OPTIMIZER
6+{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
7+#endif
8+
9+module Reflex.Widget.Basic where
10+
11+import Control.Monad.Fix (MonadFix)
12+import Data.Map (Map)
13+import Reflex.Class
14+import Reflex.Patch.MapWithMove
15+
16+
17+-- | Build sortable content in such a way that re-sorting it can cause minimal
18+-- disruption to an existing context.
19+--
20+-- Naively re-sorting a list of images would destroy every image and add them back
21+-- in the new order. This framework is able to avoid that by preserving the
22+-- identity of each image and simply moving it to the new location.
23+--
24+-- Example:
25+--
26+-- > let sortByFst = buttonA $> comparing fst
27+-- > sortBySnd = buttonB $> comparing snd
28+-- > sortEvent = leftmost [sortByFst, sortBySnd]
29+-- > sortableList
30+-- > (\k v -> text $ "\n" ++ show k ++ " " ++ v) -- show each element on a new line
31+-- > (Map.fromList $ zip [0..] [(3, "a"), (2, "b"), (1, "c")])
32+-- > sortEvent
33+sortableList :: forall t m k v a. (MonadHold t m, MonadFix m, MonadAdjust t m, Ord k)
34+ => (k -> v -> m a) -- ^ Function to render the content for each key/value pair
35+ -> Map k v -- ^ The sortable list with an initial ordering determined by the @Map@ keys in ascending order
36+ -> Event t (v -> v -> Ordering) -- ^ An event carrying a sort function for the list
37+ -> m (Map k a)
38+sortableList f m0 reSortFunc = do
39+ rec let reSortPatch = attachWith (flip patchThatSortsMapWith) (currentIncremental m) reSortFunc
40+ m <- holdIncremental m0 reSortPatch
41+ (results, _) <- mapMapWithAdjustWithMove f m0 reSortPatch
42+ pure results