From 46a8dc75824e2f41677601dacad190c02d826660 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 2 Apr 2016 15:52:56 -0400 Subject: format --- doc/forum/upgrading_to_propellor_3.0.mdwn | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'doc/forum') diff --git a/doc/forum/upgrading_to_propellor_3.0.mdwn b/doc/forum/upgrading_to_propellor_3.0.mdwn index 603cbe22..e7c3bb3e 100644 --- a/doc/forum/upgrading_to_propellor_3.0.mdwn +++ b/doc/forum/upgrading_to_propellor_3.0.mdwn @@ -59,26 +59,31 @@ Additional things you need to do if you've written your own properties: fail to type check, because the type checker cannot guess what type you intend the intermediate property `go` to have: - foo :: Property UnixLike - foo = go `requires` bar - where - go = property "foo" (return NoChange) + foo :: Property UnixLike + foo = go `requires` bar + where + go = property "foo" (return NoChange) To fix, specify the type of go: - go :: Property UnixLike + go :: Property UnixLike * `ensureProperty` now needs to be passed a witness to the type of the property it's used in. - change this: foo = property desc $ ... ensureProperty bar - to this: foo = property' desc $ \w -> ... ensureProperty w bar + + foo = property desc $ ... ensureProperty bar + + Becomes + + foo = property' desc $ \w -> ... ensureProperty w bar + * General purpose properties like cmdProperty have type `Property UnixLike`. When using that to run a command only available on Debian, you can tighten the type to only the OS that your more specific property works on. For example: - upgraded :: Property Debian - upgraded = tightenTargets (cmdProperty "apt-get" ["upgrade"]) + upgraded :: Property Debian + upgraded = tightenTargets (cmdProperty "apt-get" ["upgrade"]) * Several utility functions have been renamed: getInfo to fromInfo -- cgit v1.2.3