on develop help sign in
Add blank line, and improve docs
commit718c0e04b151a6dda00e71e8acd705cd3102f951 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateFri 10 Jan 2020, 11:48 (7 years ago) parent8e6c2d1
1 file changed+9−1
src/Reflex/Query/Class.hs+9−1
src/Reflex/Query/Class.hs+9−1
@@ -66,7 +66,14 @@ instance Query () where
6666 crop _ _ = ()
6767
6868-- | The result of an absurd query is trivial; If you can ask the question, the
69−-- answer cannot tell you anything you didn't already know
69+-- answer cannot tell you anything you didn't already know.
70+--
71+-- 'QueryResult Void = @Void@' seems like it would also work, but that has
72+-- problems of robustness. In some applications, an unasked question can still
73+-- be answered, so it is important that the result is inhabited even when the
74+-- question isn't. Applications that wish to prevent this can mandate that the
75+-- query result be paired with the query: then the whole response will be
76+-- uninhabited as desired.
7077instance Query Void where
7178 type QueryResult Void = ()
7279 crop = absurd
@@ -78,6 +85,7 @@ instance (Query q, Applicative f) => Query (Ap f q) where
7885 type QueryResult (Ap f q) = Ap f (QueryResult q)
7986 crop = liftA2 crop
8087#endif
88+
8189-- | QueryMorphism's must be group homomorphisms when acting on the query type
8290-- and compatible with the query relationship when acting on the query result.
8391data QueryMorphism q q' = QueryMorphism