diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-17 12:37:37 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-17 12:37:37 -0400 |
| commit | 48f9af6fc69f8daab3a80d041bb760d1f6d17406 (patch) | |
| tree | 5de276cb26a613417bf46827dbbe2e31cad29c83 /src | |
| parent | 761d06c789733cbeb9dc1f966c48417e54b055c4 (diff) | |
comments
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Types/Target.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Propellor/Types/Target.hs b/src/Propellor/Types/Target.hs index e4d8c9c1..1d8107f1 100644 --- a/src/Propellor/Types/Target.hs +++ b/src/Propellor/Types/Target.hs @@ -53,7 +53,8 @@ target => Targeting newtarget -> Property (Targeting oldtarget) -> Property (Targeting combinedtarget) -target newtarget (Property oldtarget a) = Property (intersectTarget oldtarget newtarget) a +target newtarget (Property oldtarget a) = + Property (intersectTarget oldtarget newtarget) a -- | Picks one of the two input properties to use, -- depending on the targeted OS. @@ -82,7 +83,7 @@ foo :: Property (Targeting '[OSFreeBSD]) foo = mkProperty' freeBSD $ \t -> do ensureProperty t jail ---bar :: Property (Targeting '[OSDebian, OSFreeBSD]) +bar :: Property (Targeting '[OSDebian, OSFreeBSD]) bar = aptinstall `orProperty` jail aptinstall :: Property DebianOnly @@ -98,7 +99,13 @@ jail = mkProperty freeBSD $ do data Target = OSDebian | OSBuntish | OSFreeBSD deriving (Show, Eq) --- | A type-level and value-level list of targets. +-- | A type-level and value-level set of targets. +-- +-- Note that the current implementation uses a list, although most +-- operations remove duplicate values. The ordering of the list should not +-- matter; it would be better to use the type-level-sets package, but it +-- needs a newer version of ghc than the minimum version propellor +-- supports. data Targeting (targets :: [Target]) = Targeting [Target] deriving (Show, Eq) |
