path: root/doc/forum/howto_mapM_RevertableProperty
diff options
authorJoey Hess2016-02-08 11:19:23 -0400
committerJoey Hess2016-02-08 11:19:23 -0400
commitf1d37c9382bc0715be0689c61541a8fdef893de3 (patch)
tree9be6471932d1c5268284b9f4aba97f398047fd90 /doc/forum/howto_mapM_RevertableProperty
parent719ee1c96ddfbe9e926a78a40d477fd429947c6f (diff)
Diffstat (limited to 'doc/forum/howto_mapM_RevertableProperty')
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment b/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment
new file mode 100644
index 00000000..66ac9a4f
--- /dev/null
+++ b/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-02-08T15:00:26Z"
+ content="""
+combineProperties takes a list of PropertyListType, which is a type family
+consisting of [Property NoInfo] and [Property HasInfo]. So, you need to get
+from RevertableProperty NoInfo to one of those. `toProp` can do that.
+ combineProperties "desc" (map (toProp . myProperty) confs)
+But! I had a look and it was easy to make [RevertableProperty i] an
+instance of PropertyListType, which makes what you already tried type check
+too. I've done so in git.
+It would perhaps be nice to make lists of various sorts of properties
+instances of Traversable, so that mapM etc could be used over them. That
+would need some kind of monad for combining properties though, which does
+not currently exist. Might make more sense to make an instance of Foldable
+or just Monoid for properties. Any improvements in this area would be