From f1d37c9382bc0715be0689c61541a8fdef893de3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Feb 2016 11:19:23 -0400 Subject: response --- ...ent_1_c2800340a5361add82f5e9e30b56b18c._comment | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment (limited to 'doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment') 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 +appreciated! +"""]] -- cgit v1.2.3