From 432cbefafb4145525639acb20984d7c1beb33c0d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jun 2016 18:27:23 -0400 Subject: comment --- ...ent_2_1abdc8ae6e1a00f02fa0130d845ec236._comment | 23 ++++++++++++++++++++++ ...nt_10_f64dc6112a27f5f9a0b6ccf379c7a0e2._comment | 18 +++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 doc/forum/functions_that_yield_properties/comment_2_1abdc8ae6e1a00f02fa0130d845ec236._comment create mode 100644 doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_10_f64dc6112a27f5f9a0b6ccf379c7a0e2._comment diff --git a/doc/forum/functions_that_yield_properties/comment_2_1abdc8ae6e1a00f02fa0130d845ec236._comment b/doc/forum/functions_that_yield_properties/comment_2_1abdc8ae6e1a00f02fa0130d845ec236._comment new file mode 100644 index 00000000..34a14616 --- /dev/null +++ b/doc/forum/functions_that_yield_properties/comment_2_1abdc8ae6e1a00f02fa0130d845ec236._comment @@ -0,0 +1,23 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-06-02T22:21:52Z" + content=""" +Another, simpler approach that I often use in my config.hs: + + foo :: Host + foo = host "foo.example.com" $ props + & User.accountFor myacc + & Sudo.enabledFor myacc + where + myacc = "joey" + +You can also bundle up a bunch of properties that +each need a User into a single combined +`User -> Property DebianLike` + + myAccountIs :: User -> Property DebianLike + myAccountIs u = propertyList ("my user is " ++ u) $ props + & User.accountFor u + & Sudo.enabledFor u +"""]] diff --git a/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_10_f64dc6112a27f5f9a0b6ccf379c7a0e2._comment b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_10_f64dc6112a27f5f9a0b6ccf379c7a0e2._comment new file mode 100644 index 00000000..8067ba99 --- /dev/null +++ b/doc/forum/recent_propellor_snapshots_cause_ghc_OOMs/comment_10_f64dc6112a27f5f9a0b6ccf379c7a0e2._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 10""" + date="2016-06-02T22:14:23Z" + content=""" +Mistakes in the parameters of properties (leaving out a parameter, wrong type +parameter, etc) don't cause these super-long error messages, even when the +property is in the middle of a big block of other properties. + +The problem occurs only when a lot of properties have +been combined together using `&` and used in an ill-typed way; in this situation +ghc can't infer the a simple type for the combined properties, due to the use +of type level functions to combine them. + +So, at least in this case, it doesn't seem to be a problem users are likely +to hit except during the propellor 3.0 ugrade or if they forget to use +`props` at some other time. +"""]] -- cgit v1.2.3