summaryrefslogtreecommitdiff
path: root/doc/forum/howto_mapM_RevertableProperty.mdwn
diff options
context:
space:
mode:
authorJoey Hess2016-03-07 16:36:36 -0400
committerJoey Hess2016-03-07 16:36:36 -0400
commit16a95afa2fe22a4df9c371489c4ee7ffdef8e07b (patch)
tree6e0869e78aba03be2591569369e1e099bb86568e /doc/forum/howto_mapM_RevertableProperty.mdwn
parent9bbc292b3f903a1476e3524bb9198e58ce300401 (diff)
parent822694e790102efa2a5bb4a0c3d62c6fce1d4e87 (diff)
Merge remote-tracking branch 'remotes/misandrist/FreeBSD' into wip
Diffstat (limited to 'doc/forum/howto_mapM_RevertableProperty.mdwn')
-rw-r--r--doc/forum/howto_mapM_RevertableProperty.mdwn52
1 files changed, 52 insertions, 0 deletions
diff --git a/doc/forum/howto_mapM_RevertableProperty.mdwn b/doc/forum/howto_mapM_RevertableProperty.mdwn
new file mode 100644
index 00000000..7ebcbd47
--- /dev/null
+++ b/doc/forum/howto_mapM_RevertableProperty.mdwn
@@ -0,0 +1,52 @@
+Hello
+
+I have this kind of property
+
+ myProperty :: Conf -> RevertableProperty NoInfo
+
+
+now I have a [Conf] and I want to create also a RevertableProperty NoInfo which apply myProperty for each Conf
+
+I tried to find an equivalent of mapM for properties but I found nothing which works as expected.
+
+I tried with combineProperties but it failed also with a "cryptic message"
+mpoints is the [Conf]
+
+
+ src/config.hs:250:17:
+ Couldn't match type `CInfo
+ (PropertyListType (Property [NoInfo]))
+ (PropertyListType (Property [NoInfo]))'
+ with `NoInfo'
+ Expected type: RevertableProperty NoInfo
+ Actual type: RevertableProperty
+ (CInfo
+ (PropertyListType (Property [NoInfo]))
+ (PropertyListType (Property [NoInfo])))
+ In the expression: mount <!> umount
+ In an equation for `mountExp':
+ mountExp b
+ = mount <!> umount
+ where
+ mount
+ = combineProperties
+ "mount nfs files" (mapM mount'' mpoints)
+ umount
+ = combineProperties
+ "umount nfs files" (mapM umount'' mpoints)
+ mpoints
+ = [MountConf
+ "nfs"
+ ("ruche-"
+ ++
+ beamline ++ ".mydomain.org:/" ++ beamline ++ "-users")
+ ("/nfs/ruche-" ++ beamline ++ "/" ++ beamline ++ "-users"),
+ ....]
+ beamline = show b
+
+What is the right way to create a RevertableProperty from a list of RevertableProperty
+
+thanks
+
+Frederic
+