on develop help sign in
remove some useless editorializing.
commit6bf1fa08668fc758017844cb5d7e3acf14a24645 authordan bornside <dan.bornside@gmail.com> dateTue 8 Oct 2019, 22:46 (7 years ago) parent96c446d
2 files changed+3−4
src/Reflex/Patch.hs+2−1 src/Reflex/Query/Class.hs+1−3
src/Reflex/Patch.hs+2−1
@@ -64,7 +64,8 @@ instance (Group a, Group b) => Group (a, b) where
6464instance (Additive a, Additive b) => Additive (a, b)
6565
6666-- See https://gitlab.haskell.org/ghc/ghc/issues/11135#note_111802 for the reason Compose is not also provided.
67−-- Base does not define Monoid (Compose f g a) so this has no "home"
67+-- Base does not define Monoid (Compose f g a) so this is the best we can
68+-- really do for functor composition.
6869instance Group (f (g a)) => Group ((f :.: g) a) where
6970 negateG (Comp1 xs) = Comp1 (negateG xs)
7071 Comp1 xs ~~ Comp1 ys = Comp1 (xs ~~ ys)
src/Reflex/Query/Class.hs+1−3
@@ -55,12 +55,10 @@ instance (Ord k, Query v) => Query (MonoidalMap k v) where
5555 type QueryResult (MonoidalMap k v) = MonoidalMap k (QueryResult v)
5656 crop q r = MonoidalMap.intersectionWith (flip crop) r q
5757
58−-- asking two questions is the same as asking both questions.
5958instance (Query a, Query b) => Query (a, b) where
6059 type QueryResult (a, b) = (QueryResult a, QueryResult b)
6160 crop (x, x') (y, y') = (crop x y, crop x' y')
6261
63−-- ¯\_(゚ヮ゚)_/¯ ¯\_(ツ)_/¯
6462instance Query () where
6563 type QueryResult () = ()
6664 crop _ _ = ()
@@ -143,7 +141,7 @@ queryDyn q = do
143141 tellQueryDyn q
144142 zipDynWith crop q <$> askQueryResult
145143
146−-- | We can already say this in reflex
144+-- | use a query morphism to operate on a smaller version of a query.
147145subQuery :: (Reflex t, MonadQuery t q2 m, Monad m) => QueryMorphism q1 q2 -> Dynamic t q1 -> m (Dynamic t (QueryResult q1))
148146subQuery (QueryMorphism f g) x = fmap g <$> queryDyn (fmap f x)
149147