summaryrefslogtreecommitdiff
path: root/doc/forum/upgrading_to_propellor_3.0.mdwn
diff options
context:
space:
mode:
authorJoey Hess2016-04-02 15:52:56 -0400
committerJoey Hess2016-04-02 15:52:56 -0400
commit46a8dc75824e2f41677601dacad190c02d826660 (patch)
tree63c9a564b756a339f4e77018fd20dee75f56eddb /doc/forum/upgrading_to_propellor_3.0.mdwn
parent90bf806a1fd8bba7793dd023d2b1f35ea86556f0 (diff)
format
Diffstat (limited to 'doc/forum/upgrading_to_propellor_3.0.mdwn')
-rw-r--r--doc/forum/upgrading_to_propellor_3.0.mdwn23
1 files changed, 14 insertions, 9 deletions
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