|author||Joey Hess||2017-08-25 19:22:26 -0400|
|committer||Joey Hess||2017-08-25 19:22:26 -0400|
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/forum/How_to_create_a_property_with_info/comment_1_819902ee6b8e571f735dd2c9c93c49a9._comment b/doc/forum/How_to_create_a_property_with_info/comment_1_819902ee6b8e571f735dd2c9c93c49a9._comment
new file mode 100644
@@ -0,0 +1,29 @@
+ subject="""comment 1"""
+It's not allowed for the content of Info to come from an IO action.
+Info has to be static. This allows one Host to introspect the Info of
+another Host. The Dns properties rely on that.
+So, the type checker is right in preventing this. It's also not allowed
+to use ensureProperty with a property that HasInfo, as the info would
+not propigate to the outer property. The type checker is also preventing
+you making that mistake.
+(You also forgot to pass the `w` parameter to `ensureProperty`,
+which made the type checker unhappy as well and probably confused the error
+To accomplish your goal, you could use:
+ data DebOMaticHostMirror = DebOMaticHostMirror
+If a Host has this in its Info, you know that Host is the one with
+debomatic installed. You can then get its hostname using the `hostName`
+field accessor on the Host.
+The property that does that will need to be passed a `[Host]` which will
+typically be the `hosts` list defined in config.hs.