From 349e675a499187379ddb14c5f6ce8203de10183e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 Oct 2015 11:40:12 -0400 Subject: Improved documentation, particularly of the Propellor module. This involved some code changes, including some renaming of instance methods. (ABI change) --- src/Propellor.hs | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'src/Propellor.hs') diff --git a/src/Propellor.hs b/src/Propellor.hs index 51079ed0..c316c729 100644 --- a/src/Propellor.hs +++ b/src/Propellor.hs @@ -1,4 +1,5 @@ {-# LANGUAGE PackageImports #-} +{-# OPTIONS_GHC -fno-warn-duplicate-exports #-} -- | Pulls in lots of useful modules for building and using Properties. -- @@ -30,18 +31,42 @@ -- git clone module Propellor ( - module Propellor.Types + -- * Core data types + Host(..) + , Property + , RevertableProperty + , () + -- * Defining a Host and its properties + , host + , (&) + , (!) + -- * Combining properties + -- | Properties are often combined together in your propellor + -- configuration. For example: + -- + -- > "/etc/foo/config" `File.containsLine` "bar=1" + -- > `requires` File.dirExists "/etc/foo" + , requires + , before + , onChange + -- * Included modules + , module Propellor.Types , module Propellor.Property - , module Propellor.Property.List + -- | Everything you need to build your own properties, + -- and useful property combinators , module Propellor.Property.Cmd + -- | Properties to run shell commands + , module Propellor.Property.List + -- | Combining a list of properties into a single property + , module Propellor.Types.PrivData + -- | Private data access for properties , module Propellor.PropAccum , module Propellor.Info , module Propellor.PrivData - , module Propellor.Types.PrivData , module Propellor.Engine , module Propellor.Exception , module Propellor.Message - , localdir + , module Propellor.Location , module X ) where @@ -57,7 +82,10 @@ import Propellor.Message import Propellor.Exception import Propellor.Info import Propellor.PropAccum +import Propellor.Location +-- Things imported as X won't be included in the haddock for this page, +-- but will be re-exported silently. import Utility.PartialPrelude as X import Utility.Process as X import Utility.Exception as X @@ -77,7 +105,3 @@ import Control.Monad as X import Data.Monoid as X import Control.Monad.IfElse as X import "mtl" Control.Monad.Reader as X - --- | This is where propellor installs itself when deploying a host. -localdir :: FilePath -localdir = "/usr/local/propellor" -- cgit v1.2.3 From 28fe270223ed56ef8e7fd867573b5ba6a5a221c7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 Oct 2015 14:45:00 -0400 Subject: propellor spin --- config-joey.hs | 1 - config-simple.hs | 1 - propellor.cabal | 2 + src/Propellor.hs | 44 +++-------------- src/Propellor/Base.hs | 57 ++++++++++++++++++++++ src/Propellor/Bootstrap.hs | 2 +- src/Propellor/CmdLine.hs | 2 +- src/Propellor/Git.hs | 2 +- src/Propellor/Property/Aiccu.hs | 2 +- src/Propellor/Property/Apache.hs | 2 +- src/Propellor/Property/Apt.hs | 2 +- src/Propellor/Property/Chroot.hs | 2 +- src/Propellor/Property/ConfFile.hs | 2 +- src/Propellor/Property/Cron.hs | 2 +- src/Propellor/Property/DebianMirror.hs | 2 +- src/Propellor/Property/Debootstrap.hs | 2 +- src/Propellor/Property/DiskImage.hs | 2 +- src/Propellor/Property/Dns.hs | 2 +- src/Propellor/Property/DnsSec.hs | 2 +- src/Propellor/Property/Docker.hs | 2 +- src/Propellor/Property/File.hs | 2 +- src/Propellor/Property/Firewall.hs | 2 +- src/Propellor/Property/Git.hs | 2 +- src/Propellor/Property/Gpg.hs | 2 +- src/Propellor/Property/Group.hs | 2 +- src/Propellor/Property/Grub.hs | 2 +- .../Property/HostingProvider/CloudAtCost.hs | 2 +- .../Property/HostingProvider/DigitalOcean.hs | 2 +- src/Propellor/Property/HostingProvider/Linode.hs | 2 +- src/Propellor/Property/Hostname.hs | 2 +- src/Propellor/Property/Journald.hs | 3 +- src/Propellor/Property/Kerberos.hs | 2 +- src/Propellor/Property/LightDM.hs | 2 +- src/Propellor/Property/Logcheck.hs | 2 +- src/Propellor/Property/Mount.hs | 2 +- src/Propellor/Property/Network.hs | 2 +- src/Propellor/Property/Nginx.hs | 2 +- src/Propellor/Property/OS.hs | 2 +- src/Propellor/Property/Obnam.hs | 2 +- src/Propellor/Property/OpenId.hs | 2 +- src/Propellor/Property/Parted.hs | 2 +- src/Propellor/Property/Partition.hs | 2 +- src/Propellor/Property/Postfix.hs | 2 +- src/Propellor/Property/Prosody.hs | 2 +- src/Propellor/Property/Reboot.hs | 2 +- src/Propellor/Property/Rsync.hs | 2 +- src/Propellor/Property/Scheduled.hs | 2 +- src/Propellor/Property/Service.hs | 2 +- src/Propellor/Property/SiteSpecific/Branchable.hs | 2 +- .../Property/SiteSpecific/GitAnnexBuilder.hs | 2 +- src/Propellor/Property/SiteSpecific/GitHome.hs | 2 +- src/Propellor/Property/SiteSpecific/IABak.hs | 2 +- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- src/Propellor/Property/Ssh.hs | 2 +- src/Propellor/Property/Sudo.hs | 2 +- src/Propellor/Property/Systemd.hs | 2 +- src/Propellor/Property/Systemd/Core.hs | 2 +- src/Propellor/Property/Tor.hs | 2 +- src/Propellor/Property/Unbound.hs | 2 +- src/Propellor/Property/User.hs | 2 +- src/Propellor/Property/Uwsgi.hs | 2 +- src/Propellor/Protocol.hs | 2 +- src/Propellor/Shim.hs | 2 +- src/Propellor/Spin.hs | 2 +- src/Propellor/Ssh.hs | 2 +- src/Propellor/Utilities.hs | 27 ++++++++++ 66 files changed, 154 insertions(+), 99 deletions(-) create mode 100644 src/Propellor/Base.hs create mode 100644 src/Propellor/Utilities.hs (limited to 'src/Propellor.hs') diff --git a/config-joey.hs b/config-joey.hs index 6829faf5..9aa6413f 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -3,7 +3,6 @@ module Main where import Propellor -import Propellor.CmdLine import Propellor.Property.Scheduled import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt diff --git a/config-simple.hs b/config-simple.hs index 576ecc73..9b314ada 100644 --- a/config-simple.hs +++ b/config-simple.hs @@ -2,7 +2,6 @@ -- the propellor program. import Propellor -import Propellor.CmdLine import Propellor.Property.Scheduled import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt diff --git a/propellor.cabal b/propellor.cabal index 1ac763f7..86337505 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -69,6 +69,7 @@ Library Exposed-Modules: Propellor + Propellor.Base Propellor.Location Propellor.Property Propellor.Property.Aiccu @@ -127,6 +128,7 @@ Library Propellor.Property.SiteSpecific.Branchable Propellor.Property.SiteSpecific.IABak Propellor.PropAccum + Propellor.Utilities Propellor.CmdLine Propellor.Info Propellor.Message diff --git a/src/Propellor.hs b/src/Propellor.hs index c316c729..46f56abe 100644 --- a/src/Propellor.hs +++ b/src/Propellor.hs @@ -1,16 +1,12 @@ -{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-duplicate-exports #-} --- | Pulls in lots of useful modules for building and using Properties. --- --- When propellor runs on a Host, it ensures that its list of Properties +-- | When propellor runs on a Host, it ensures that its list of Properties -- is satisfied, taking action as necessary when a Property is not -- currently satisfied. -- -- A simple propellor program example: -- -- > import Propellor --- > import Propellor.CmdLine -- > import qualified Propellor.Property.File as File -- > import qualified Propellor.Property.Apt as Apt -- > @@ -36,7 +32,8 @@ module Propellor ( , Property , RevertableProperty , () - -- * Defining a Host and its properties + -- * Core config file + , defaultMain , host , (&) , (!) @@ -51,57 +48,30 @@ module Propellor ( , onChange -- * Included modules , module Propellor.Types + -- | Additional data types used by propellor , module Propellor.Property -- | Everything you need to build your own properties, -- and useful property combinators , module Propellor.Property.Cmd -- | Properties to run shell commands + , module Propellor.Info + -- | Properties that set `Info` , module Propellor.Property.List -- | Combining a list of properties into a single property , module Propellor.Types.PrivData -- | Private data access for properties , module Propellor.PropAccum - , module Propellor.Info - , module Propellor.PrivData - , module Propellor.Engine - , module Propellor.Exception - , module Propellor.Message - , module Propellor.Location , module X ) where import Propellor.Types +import Propellor.CmdLine (defaultMain) import Propellor.Property -import Propellor.Engine import Propellor.Property.List import Propellor.Property.Cmd -import Propellor.PrivData import Propellor.Types.PrivData -import Propellor.Message -import Propellor.Exception import Propellor.Info import Propellor.PropAccum -import Propellor.Location - --- Things imported as X won't be included in the haddock for this page, --- but will be re-exported silently. -import Utility.PartialPrelude as X -import Utility.Process as X -import Utility.Exception as X -import Utility.Env as X -import Utility.Directory as X -import Utility.Tmp as X -import Utility.Monad as X -import Utility.Misc as X -import System.Directory as X -import System.IO as X -import System.FilePath as X -import Data.Maybe as X -import Data.Either as X -import Control.Applicative as X -import Control.Monad as X import Data.Monoid as X -import Control.Monad.IfElse as X -import "mtl" Control.Monad.Reader as X diff --git a/src/Propellor/Base.hs b/src/Propellor/Base.hs new file mode 100644 index 00000000..3c13bb7d --- /dev/null +++ b/src/Propellor/Base.hs @@ -0,0 +1,57 @@ +{-# LANGUAGE PackageImports #-} + +-- | Pulls in lots of useful modules for building and using Properties. + +module Propellor.Base ( + -- * Propellor modules + module Propellor.Types + , module Propellor.Property + , module Propellor.Property.Cmd + , module Propellor.Property.List + , module Propellor.Types.PrivData + , module Propellor.PropAccum + , module Propellor.Info + , module Propellor.PrivData + , module Propellor.Engine + , module Propellor.Exception + , module Propellor.Message + , module Propellor.Location + , module Propellor.Utilities + + -- * System modules + , module System.Directory + , module System.IO + , module System.FilePath + , module Data.Maybe + , module Data.Either + , module Control.Applicative + , module Control.Monad + , module Data.Monoid + , module Control.Monad.IfElse + , module Control.Monad.Reader +) where + +import Propellor.Types +import Propellor.Property +import Propellor.Engine +import Propellor.Property.List +import Propellor.Property.Cmd +import Propellor.PrivData +import Propellor.Types.PrivData +import Propellor.Message +import Propellor.Exception +import Propellor.Info +import Propellor.PropAccum +import Propellor.Location +import Propellor.Utilities + +import System.Directory +import System.IO +import System.FilePath +import Data.Maybe +import Data.Either +import Control.Applicative +import Control.Monad +import Data.Monoid +import Control.Monad.IfElse +import "mtl" Control.Monad.Reader diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 0cb37092..6a5d5acb 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -5,7 +5,7 @@ module Propellor.Bootstrap ( buildPropellor, ) where -import Propellor +import Propellor.Base import System.Posix.Files import Data.List diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 0cc8294d..33bb0bdc 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -9,7 +9,7 @@ import System.Exit import System.PosixCompat import Network.Socket -import Propellor +import Propellor.Base import Propellor.Gpg import Propellor.Git import Propellor.Bootstrap diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 0b9b4b35..a4418340 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -1,6 +1,6 @@ module Propellor.Git where -import Propellor +import Propellor.Base import Propellor.PrivData.Paths import Propellor.Gpg import Utility.FileMode diff --git a/src/Propellor/Property/Aiccu.hs b/src/Propellor/Property/Aiccu.hs index a1b24472..47841a7b 100644 --- a/src/Propellor/Property/Aiccu.hs +++ b/src/Propellor/Property/Aiccu.hs @@ -9,7 +9,7 @@ module Propellor.Property.Aiccu ( hasConfig, ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service import qualified Propellor.Property.File as File diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index b4bbdc32..91b2e6a2 100644 --- a/src/Propellor/Property/Apache.hs +++ b/src/Propellor/Property/Apache.hs @@ -1,6 +1,6 @@ module Propellor.Property.Apache where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/Apt.hs b/src/Propellor/Property/Apt.hs index 15c45629..14f170af 100644 --- a/src/Propellor/Property/Apt.hs +++ b/src/Propellor/Property/Apt.hs @@ -8,7 +8,7 @@ import Data.List import System.IO import Control.Monad -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Service as Service import Propellor.Property.File (Line) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index aecf33ec..ab914180 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -12,7 +12,7 @@ module Propellor.Property.Chroot ( chain, ) where -import Propellor +import Propellor.Base import Propellor.Types.CmdLine import Propellor.Types.Chroot import Propellor.Types.Info diff --git a/src/Propellor/Property/ConfFile.hs b/src/Propellor/Property/ConfFile.hs index 0bc1b76d..dac4e564 100644 --- a/src/Propellor/Property/ConfFile.hs +++ b/src/Propellor/Property/ConfFile.hs @@ -12,7 +12,7 @@ module Propellor.Property.ConfFile ( lacksIniSection, ) where -import Propellor +import Propellor.Base import Propellor.Property.File import Data.List (isPrefixOf, foldl') diff --git a/src/Propellor/Property/Cron.hs b/src/Propellor/Property/Cron.hs index e9bb93ac..74cab92a 100644 --- a/src/Propellor/Property/Cron.hs +++ b/src/Propellor/Property/Cron.hs @@ -1,6 +1,6 @@ module Propellor.Property.Cron where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import Propellor.Bootstrap diff --git a/src/Propellor/Property/DebianMirror.hs b/src/Propellor/Property/DebianMirror.hs index d16c5281..6f1ff7b2 100644 --- a/src/Propellor/Property/DebianMirror.hs +++ b/src/Propellor/Property/DebianMirror.hs @@ -7,7 +7,7 @@ module Propellor.Property.DebianMirror , mirrorCdn ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cron as Cron diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 2551d679..bb177007 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -10,7 +10,7 @@ module Propellor.Property.Debootstrap ( programPath, ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import Propellor.Property.Chroot.Util import Utility.Path diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index 8d35991e..8d503e28 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -36,7 +36,7 @@ module Propellor.Property.DiskImage ( noFinalization, ) where -import Propellor +import Propellor.Base import Propellor.Property.Chroot (Chroot) import Propellor.Property.Chroot.Util (removeChroot) import qualified Propellor.Property.Chroot as Chroot diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs index 056733cd..963b82f6 100644 --- a/src/Propellor/Property/Dns.hs +++ b/src/Propellor/Property/Dns.hs @@ -13,7 +13,7 @@ module Propellor.Property.Dns ( genZone, ) where -import Propellor +import Propellor.Base import Propellor.Types.Dns import Propellor.Types.Info import Propellor.Property.File diff --git a/src/Propellor/Property/DnsSec.hs b/src/Propellor/Property/DnsSec.hs index 3acaee8d..22481ad0 100644 --- a/src/Propellor/Property/DnsSec.hs +++ b/src/Propellor/Property/DnsSec.hs @@ -1,6 +1,6 @@ module Propellor.Property.DnsSec where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File -- | Puts the DNSSEC key files in place from PrivData. diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index c3a1de72..6aa17438 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -45,7 +45,7 @@ module Propellor.Property.Docker ( chain, ) where -import Propellor hiding (init) +import Propellor.Base hiding (init) import Propellor.Types.Docker import Propellor.Types.Container import Propellor.Types.CmdLine diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index a1d3037f..b491ccbe 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -1,6 +1,6 @@ module Propellor.Property.File where -import Propellor +import Propellor.Base import Utility.FileMode import System.Posix.Files diff --git a/src/Propellor/Property/Firewall.hs b/src/Propellor/Property/Firewall.hs index a685a46f..20b44845 100644 --- a/src/Propellor/Property/Firewall.hs +++ b/src/Propellor/Property/Firewall.hs @@ -16,7 +16,7 @@ import Data.Monoid import Data.Char import Data.List -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Network as Network diff --git a/src/Propellor/Property/Git.hs b/src/Propellor/Property/Git.hs index 48871b40..d69fe250 100644 --- a/src/Propellor/Property/Git.hs +++ b/src/Propellor/Property/Git.hs @@ -1,6 +1,6 @@ module Propellor.Property.Git where -import Propellor +import Propellor.Base import Propellor.Property.File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs index e57749ae..a16df11d 100644 --- a/src/Propellor/Property/Gpg.hs +++ b/src/Propellor/Property/Gpg.hs @@ -1,6 +1,6 @@ module Propellor.Property.Gpg where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import Utility.FileSystemEncoding diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs index d4dc0fb2..ce8a8398 100644 --- a/src/Propellor/Property/Group.hs +++ b/src/Propellor/Property/Group.hs @@ -1,6 +1,6 @@ module Propellor.Property.Group where -import Propellor +import Propellor.Base type GID = Int diff --git a/src/Propellor/Property/Grub.hs b/src/Propellor/Property/Grub.hs index 1084ef9e..6b763d08 100644 --- a/src/Propellor/Property/Grub.hs +++ b/src/Propellor/Property/Grub.hs @@ -1,6 +1,6 @@ module Propellor.Property.Grub where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt diff --git a/src/Propellor/Property/HostingProvider/CloudAtCost.hs b/src/Propellor/Property/HostingProvider/CloudAtCost.hs index bc53635c..6097c642 100644 --- a/src/Propellor/Property/HostingProvider/CloudAtCost.hs +++ b/src/Propellor/Property/HostingProvider/CloudAtCost.hs @@ -1,6 +1,6 @@ module Propellor.Property.HostingProvider.CloudAtCost where -import Propellor +import Propellor.Base import qualified Propellor.Property.Hostname as Hostname import qualified Propellor.Property.File as File import qualified Propellor.Property.User as User diff --git a/src/Propellor/Property/HostingProvider/DigitalOcean.hs b/src/Propellor/Property/HostingProvider/DigitalOcean.hs index a5de9818..f49b86b3 100644 --- a/src/Propellor/Property/HostingProvider/DigitalOcean.hs +++ b/src/Propellor/Property/HostingProvider/DigitalOcean.hs @@ -2,7 +2,7 @@ module Propellor.Property.HostingProvider.DigitalOcean ( distroKernel ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import qualified Propellor.Property.Reboot as Reboot diff --git a/src/Propellor/Property/HostingProvider/Linode.hs b/src/Propellor/Property/HostingProvider/Linode.hs index 40be4c2e..274412a0 100644 --- a/src/Propellor/Property/HostingProvider/Linode.hs +++ b/src/Propellor/Property/HostingProvider/Linode.hs @@ -1,6 +1,6 @@ module Propellor.Property.HostingProvider.Linode where -import Propellor +import Propellor.Base import qualified Propellor.Property.Grub as Grub import qualified Propellor.Property.File as File import Utility.FileMode diff --git a/src/Propellor/Property/Hostname.hs b/src/Propellor/Property/Hostname.hs index 20181213..7766d497 100644 --- a/src/Propellor/Property/Hostname.hs +++ b/src/Propellor/Property/Hostname.hs @@ -1,6 +1,6 @@ module Propellor.Property.Hostname where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import Data.List diff --git a/src/Propellor/Property/Journald.hs b/src/Propellor/Property/Journald.hs index 3ab4e9d7..6c8bda80 100644 --- a/src/Propellor/Property/Journald.hs +++ b/src/Propellor/Property/Journald.hs @@ -1,5 +1,6 @@ module Propellor.Property.Journald where -import Propellor + +import Propellor.Base import qualified Propellor.Property.Systemd as Systemd import Utility.DataUnits diff --git a/src/Propellor/Property/Kerberos.hs b/src/Propellor/Property/Kerberos.hs index 5d07f4dc..cb6e06cc 100644 --- a/src/Propellor/Property/Kerberos.hs +++ b/src/Propellor/Property/Kerberos.hs @@ -4,7 +4,7 @@ module Propellor.Property.Kerberos where import Utility.Process -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import Propellor.Property.User diff --git a/src/Propellor/Property/LightDM.hs b/src/Propellor/Property/LightDM.hs index b010eb2f..bc5ef22a 100644 --- a/src/Propellor/Property/LightDM.hs +++ b/src/Propellor/Property/LightDM.hs @@ -4,7 +4,7 @@ module Propellor.Property.LightDM where -import Propellor +import Propellor.Base import qualified Propellor.Property.ConfFile as ConfFile -- | Configures LightDM to skip the login screen and autologin as a user. diff --git a/src/Propellor/Property/Logcheck.hs b/src/Propellor/Property/Logcheck.hs index 26f4e3a4..22621cc2 100644 --- a/src/Propellor/Property/Logcheck.hs +++ b/src/Propellor/Property/Logcheck.hs @@ -9,7 +9,7 @@ module Propellor.Property.Logcheck ( installed, ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File diff --git a/src/Propellor/Property/Mount.hs b/src/Propellor/Property/Mount.hs index 4070ebcb..30d057f5 100644 --- a/src/Propellor/Property/Mount.hs +++ b/src/Propellor/Property/Mount.hs @@ -1,6 +1,6 @@ module Propellor.Property.Mount where -import Propellor +import Propellor.Base import Utility.Path type FsType = String -- ^ type of filesystem to mount ("auto" to autodetect) diff --git a/src/Propellor/Property/Network.hs b/src/Propellor/Property/Network.hs index e01edb62..cb340042 100644 --- a/src/Propellor/Property/Network.hs +++ b/src/Propellor/Property/Network.hs @@ -1,6 +1,6 @@ module Propellor.Property.Network where -import Propellor +import Propellor.Base import Propellor.Property.File type Interface = String diff --git a/src/Propellor/Property/Nginx.hs b/src/Propellor/Property/Nginx.hs index a8c7b187..d0d4d3a9 100644 --- a/src/Propellor/Property/Nginx.hs +++ b/src/Propellor/Property/Nginx.hs @@ -2,7 +2,7 @@ module Propellor.Property.Nginx where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/OS.hs b/src/Propellor/Property/OS.hs index 5364456a..e176e33d 100644 --- a/src/Propellor/Property/OS.hs +++ b/src/Propellor/Property/OS.hs @@ -7,7 +7,7 @@ module Propellor.Property.OS ( oldOSRemoved, ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Debootstrap as Debootstrap import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.Network as Network diff --git a/src/Propellor/Property/Obnam.hs b/src/Propellor/Property/Obnam.hs index 94b023f3..091a6d90 100644 --- a/src/Propellor/Property/Obnam.hs +++ b/src/Propellor/Property/Obnam.hs @@ -1,6 +1,6 @@ module Propellor.Property.Obnam where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Cron as Cron import qualified Propellor.Property.Gpg as Gpg diff --git a/src/Propellor/Property/OpenId.hs b/src/Propellor/Property/OpenId.hs index a0f7310c..ae437518 100644 --- a/src/Propellor/Property/OpenId.hs +++ b/src/Propellor/Property/OpenId.hs @@ -1,6 +1,6 @@ module Propellor.Property.OpenId where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Apache as Apache diff --git a/src/Propellor/Property/Parted.hs b/src/Propellor/Property/Parted.hs index a4f0f98e..7bd38a65 100644 --- a/src/Propellor/Property/Parted.hs +++ b/src/Propellor/Property/Parted.hs @@ -21,7 +21,7 @@ module Propellor.Property.Parted ( installed, ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Partition as Partition import Utility.DataUnits diff --git a/src/Propellor/Property/Partition.hs b/src/Propellor/Property/Partition.hs index c85ef8b9..56bc1575 100644 --- a/src/Propellor/Property/Partition.hs +++ b/src/Propellor/Property/Partition.hs @@ -2,7 +2,7 @@ module Propellor.Property.Partition where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt -- | Filesystems etc that can be used for a partition. diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index b062cbac..562444da 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -2,7 +2,7 @@ module Propellor.Property.Postfix where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/Prosody.hs b/src/Propellor/Property/Prosody.hs index e47b9ac5..78a2c529 100644 --- a/src/Propellor/Property/Prosody.hs +++ b/src/Propellor/Property/Prosody.hs @@ -2,7 +2,7 @@ module Propellor.Property.Prosody where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/Reboot.hs b/src/Propellor/Property/Reboot.hs index 5ca7a6bc..ef0182d3 100644 --- a/src/Propellor/Property/Reboot.hs +++ b/src/Propellor/Property/Reboot.hs @@ -1,6 +1,6 @@ module Propellor.Property.Reboot where -import Propellor +import Propellor.Base now :: Property NoInfo now = cmdProperty "reboot" [] diff --git a/src/Propellor/Property/Rsync.hs b/src/Propellor/Property/Rsync.hs index 8423eff6..894b8cc7 100644 --- a/src/Propellor/Property/Rsync.hs +++ b/src/Propellor/Property/Rsync.hs @@ -1,6 +1,6 @@ module Propellor.Property.Rsync where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt type Src = FilePath diff --git a/src/Propellor/Property/Scheduled.hs b/src/Propellor/Property/Scheduled.hs index 06efacdf..64a530bc 100644 --- a/src/Propellor/Property/Scheduled.hs +++ b/src/Propellor/Property/Scheduled.hs @@ -9,7 +9,7 @@ module Propellor.Property.Scheduled , YearDay ) where -import Propellor +import Propellor.Base import Utility.Scheduled import Data.Time.Clock diff --git a/src/Propellor/Property/Service.hs b/src/Propellor/Property/Service.hs index 9cc010e8..76c9aff7 100644 --- a/src/Propellor/Property/Service.hs +++ b/src/Propellor/Property/Service.hs @@ -1,6 +1,6 @@ module Propellor.Property.Service where -import Propellor +import Propellor.Base type ServiceName = String diff --git a/src/Propellor/Property/SiteSpecific/Branchable.hs b/src/Propellor/Property/SiteSpecific/Branchable.hs index f5950e52..c62c1335 100644 --- a/src/Propellor/Property/SiteSpecific/Branchable.hs +++ b/src/Propellor/Property/SiteSpecific/Branchable.hs @@ -1,6 +1,6 @@ module Propellor.Property.SiteSpecific.Branchable where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import qualified Propellor.Property.User as User diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs index f2a2f012..a10e5877 100644 --- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs +++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs @@ -2,7 +2,7 @@ module Propellor.Property.SiteSpecific.GitAnnexBuilder where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.User as User import qualified Propellor.Property.Cron as Cron diff --git a/src/Propellor/Property/SiteSpecific/GitHome.hs b/src/Propellor/Property/SiteSpecific/GitHome.hs index 40f2ecd8..9b01b5e2 100644 --- a/src/Propellor/Property/SiteSpecific/GitHome.hs +++ b/src/Propellor/Property/SiteSpecific/GitHome.hs @@ -1,6 +1,6 @@ module Propellor.Property.SiteSpecific.GitHome where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import Propellor.Property.User diff --git a/src/Propellor/Property/SiteSpecific/IABak.hs b/src/Propellor/Property/SiteSpecific/IABak.hs index eaef2817..93cf0b71 100644 --- a/src/Propellor/Property/SiteSpecific/IABak.hs +++ b/src/Propellor/Property/SiteSpecific/IABak.hs @@ -1,6 +1,6 @@ module Propellor.Property.SiteSpecific.IABak where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Git as Git import qualified Propellor.Property.Cron as Cron diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 0a59452c..3f3205e6 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -3,7 +3,7 @@ module Propellor.Property.SiteSpecific.JoeySites where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.File as File import qualified Propellor.Property.Gpg as Gpg diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index fbd57057..4450dd07 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -25,7 +25,7 @@ module Propellor.Property.Ssh ( listenPort ) where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Service as Service import Propellor.Property.User diff --git a/src/Propellor/Property/Sudo.hs b/src/Propellor/Property/Sudo.hs index 0257f3f1..ed6ba2d5 100644 --- a/src/Propellor/Property/Sudo.hs +++ b/src/Propellor/Property/Sudo.hs @@ -2,7 +2,7 @@ module Propellor.Property.Sudo where import Data.List -import Propellor +import Propellor.Base import Propellor.Property.File import qualified Propellor.Property.Apt as Apt import Propellor.Property.User diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index d5d50ec6..8194fc85 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -40,7 +40,7 @@ module Propellor.Property.Systemd ( bindRo, ) where -import Propellor +import Propellor.Base import Propellor.Types.Chroot import Propellor.Types.Container import Propellor.Types.Info diff --git a/src/Propellor/Property/Systemd/Core.hs b/src/Propellor/Property/Systemd/Core.hs index b27a8e38..7842f177 100644 --- a/src/Propellor/Property/Systemd/Core.hs +++ b/src/Propellor/Property/Systemd/Core.hs @@ -1,6 +1,6 @@ module Propellor.Property.Systemd.Core where -import Propellor +import Propellor.Base import qualified Propellor.Property.Apt as Apt -- dbus is only a Recommends of systemd, but is needed for communication diff --git a/src/Propellor/Property/Tor.hs b/src/Propellor/Property/Tor.hs index e2ee3dad..e5fcdaa4 100644 --- a/src/Propellor/Property/Tor.hs +++ b/src/Propellor/Property/Tor.hs @@ -1,6 +1,6 @@ module Propellor.Property.Tor where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/Unbound.hs b/src/Propellor/Property/Unbound.hs index 0fa42052..f1280b0e 100644 --- a/src/Propellor/Property/Unbound.hs +++ b/src/Propellor/Property/Unbound.hs @@ -17,7 +17,7 @@ module Propellor.Property.Unbound , cachingDnsServer ) where -import Propellor +import Propellor.Base import Propellor.Property.File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Property/User.hs b/src/Propellor/Property/User.hs index c029999f..c3314738 100644 --- a/src/Propellor/Property/User.hs +++ b/src/Propellor/Property/User.hs @@ -2,7 +2,7 @@ module Propellor.Property.User where import System.Posix -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File data Eep = YesReallyDeleteHome diff --git a/src/Propellor/Property/Uwsgi.hs b/src/Propellor/Property/Uwsgi.hs index d1cdb550..8beea17a 100644 --- a/src/Propellor/Property/Uwsgi.hs +++ b/src/Propellor/Property/Uwsgi.hs @@ -2,7 +2,7 @@ module Propellor.Property.Uwsgi where -import Propellor +import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Service as Service diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs index b6d38d06..e90155f3 100644 --- a/src/Propellor/Protocol.hs +++ b/src/Propellor/Protocol.hs @@ -11,7 +11,7 @@ module Propellor.Protocol where import Data.List -import Propellor +import Propellor.Base data Stage = NeedGitClone | NeedRepoUrl | NeedPrivData | NeedGitPush | NeedPrecompiled deriving (Read, Show, Eq) diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs index e2941420..27545afb 100644 --- a/src/Propellor/Shim.hs +++ b/src/Propellor/Shim.hs @@ -6,7 +6,7 @@ module Propellor.Shim (setup, cleanEnv, file) where -import Propellor +import Propellor.Base import Utility.LinuxMkLibs import Utility.FileMode import Utility.FileSystemEncoding diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index c5b31cef..ecefbf6e 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -16,7 +16,7 @@ import qualified Data.ByteString as B import qualified Data.Set as S import Network.Socket (getAddrInfo, defaultHints, AddrInfo(..), AddrInfoFlag(..), SockAddr) -import Propellor +import Propellor.Base import Propellor.Protocol import Propellor.PrivData.Paths import Propellor.Git diff --git a/src/Propellor/Ssh.hs b/src/Propellor/Ssh.hs index 3fe78f7a..b00eb651 100644 --- a/src/Propellor/Ssh.hs +++ b/src/Propellor/Ssh.hs @@ -1,6 +1,6 @@ module Propellor.Ssh where -import Propellor +import Propellor.Base import Utility.UserInfo import System.PosixCompat diff --git a/src/Propellor/Utilities.hs b/src/Propellor/Utilities.hs new file mode 100644 index 00000000..33af4eda --- /dev/null +++ b/src/Propellor/Utilities.hs @@ -0,0 +1,27 @@ +-- | Re-exports some of propellor's internal utility modules. +-- +-- These are used in the implementation of propellor, including some of its +-- properties. However, there is no API stability; any of these can change +-- or be removed without a major version number increase. +-- +-- Use outside propellor at your own risk. + +module Propellor.Utilities ( + module Utility.PartialPrelude + , module Utility.Process + , module Utility.Exception + , module Utility.Env + , module Utility.Directory + , module Utility.Tmp + , module Utility.Monad + , module Utility.Misc +) where + +import Utility.PartialPrelude +import Utility.Process +import Utility.Exception +import Utility.Env +import Utility.Directory +import Utility.Tmp +import Utility.Monad +import Utility.Misc -- cgit v1.2.3 From ae380f085bc867f7405ef0a16c849864c6552e47 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 Oct 2015 14:56:22 -0400 Subject: tighten focus of Propellor module, adding Propellor.Base for all the exports --- config-simple.hs | 2 +- debian/changelog | 8 ++++++-- doc/haskell_newbie.mdwn | 1 - src/Propellor.hs | 4 +++- src/Propellor/PropAccum.hs | 18 ------------------ src/Propellor/Property.hs | 4 ++++ src/Propellor/Property/List.hs | 24 ++++++++++++++++++------ src/Propellor/Types.hs | 12 ++++++------ 8 files changed, 38 insertions(+), 35 deletions(-) (limited to 'src/Propellor.hs') diff --git a/config-simple.hs b/config-simple.hs index 9b314ada..67c06120 100644 --- a/config-simple.hs +++ b/config-simple.hs @@ -2,12 +2,12 @@ -- the propellor program. import Propellor -import Propellor.Property.Scheduled import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Network as Network --import qualified Propellor.Property.Ssh as Ssh import qualified Propellor.Property.Cron as Cron +import Propellor.Property.Scheduled --import qualified Propellor.Property.Sudo as Sudo import qualified Propellor.Property.User as User --import qualified Propellor.Property.Hostname as Hostname diff --git a/debian/changelog b/debian/changelog index 3d6832a7..55076ae8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,12 @@ propellor (2.9.0) UNRELEASED; urgency=medium * Added basic Uwsgi module, maintained by FĂ©lix Sipma. * Add Apt.hasForeignArch. Thanks, Per Olofsson. * Improved documentation, particularly of the Propellor module. - This involved some code changes, including some renaming of instance - methods. (ABI change) + * The Propellor module no longer exports many of the things it used to, + being now focused on only what's needed to write config.hs. + Use Propellor.Base to get all the things exported by Propellor before. + (API change) + * Some renaming of instance methods, and moving of functions to more + appropriate modules. (API change) -- Joey Hess Thu, 08 Oct 2015 11:09:01 -0400 diff --git a/doc/haskell_newbie.mdwn b/doc/haskell_newbie.mdwn index 24839b12..e368569c 100644 --- a/doc/haskell_newbie.mdwn +++ b/doc/haskell_newbie.mdwn @@ -16,7 +16,6 @@ So, `-- ` starts a comment in this file. [[!format haskell """ import Propellor -import Propellor.CmdLine import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.User as User diff --git a/src/Propellor.hs b/src/Propellor.hs index 46f56abe..4f777f11 100644 --- a/src/Propellor.hs +++ b/src/Propellor.hs @@ -37,6 +37,7 @@ module Propellor ( , host , (&) , (!) + , describe -- * Combining properties -- | Properties are often combined together in your propellor -- configuration. For example: @@ -47,6 +48,8 @@ module Propellor ( , before , onChange -- * Included modules + -- | These are only the core modules you'll need. There are many + -- more in propellor that you can import. , module Propellor.Types -- | Additional data types used by propellor , module Propellor.Property @@ -60,7 +63,6 @@ module Propellor ( -- | Combining a list of properties into a single property , module Propellor.Types.PrivData -- | Private data access for properties - , module Propellor.PropAccum , module X ) where diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index 350f4ab4..61cf3dc8 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -2,12 +2,10 @@ module Propellor.PropAccum ( host - , props , PropAccum(..) , (&) , (&^) , (!) - , PropList , propigateContainer ) where @@ -27,15 +25,6 @@ import Propellor.PrivData host :: HostName -> Host host hn = Host hn [] mempty --- | Starts accumulating a list of properties. --- --- > propertyList "foo" $ props --- > & someproperty --- > ! oldproperty --- > & otherproperty -props :: PropList -props = PropList [] - -- | Something that can accumulate properties. class PropAccum h where -- | Adds a property. @@ -71,13 +60,6 @@ instance PropAccum Host where (getInfoRecursive p <> is) getProperties = hostProperties -data PropList = PropList [Property HasInfo] - -instance PropAccum PropList where - PropList l `addProp` p = PropList (toProp p : l) - PropList l `addPropFront` p = PropList (l ++ [toProp p]) - getProperties (PropList l) = reverse l - -- | Adjust the provided Property, adding to its -- propertyChidren the properties of the provided container. -- diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 3ab66ca3..c7fc555f 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -100,6 +100,10 @@ onChangeFlagOnFail flagfile = combineWith go writeFile flagfile "" removeFlagFile = whenM (doesFileExist flagfile) $ removeFile flagfile +-- | Changes the description of a property. +describe :: IsProp p => p -> Desc -> p +describe = setDesc + -- | Alias for @flip describe@ (==>) :: IsProp (Property i) => Desc -> Property i -> Property i (==>) = flip describe diff --git a/src/Propellor/Property/List.hs b/src/Propellor/Property/List.hs index 283c5ec7..a88d44d7 100644 --- a/src/Propellor/Property/List.hs +++ b/src/Propellor/Property/List.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleInstances #-} module Propellor.Property.List ( + props, PropertyList(..), PropertyListType, ) where @@ -12,6 +13,22 @@ import Propellor.PropAccum import Data.Monoid +-- | Starts accumulating a list of properties. +-- +-- > propertyList "foo" $ props +-- > & someproperty +-- > ! oldproperty +-- > & otherproperty +props :: PropList +props = PropList [] + +data PropList = PropList [Property HasInfo] + +instance PropAccum PropList where + PropList l `addProp` p = PropList (toProp p : l) + PropList l `addPropFront` p = PropList (l ++ [toProp p]) + getProperties (PropList l) = reverse l + class PropertyList l where -- | Combines a list of properties, resulting in a single property -- that when run will run each property in the list in turn, @@ -21,12 +38,7 @@ class PropertyList l where -- Note that Property HasInfo and Property NoInfo are not the same -- type, and so cannot be mixed in a list. To make a list of -- mixed types, which can also include RevertableProperty, - -- use `props`: - -- - -- > propertyList "foo" $ props - -- > & someproperty - -- > ! oldproperty - -- > & otherproperty + -- use `props` propertyList :: Desc -> l -> Property (PropertyListType l) -- | Combines a list of properties, resulting in one property that diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index 0dfafbe8..fc700df0 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -177,9 +177,9 @@ data RevertableProperty = RevertableProperty (Property HasInfo) (Property HasInf () :: Property i1 -> Property i2 -> RevertableProperty p1 p2 = RevertableProperty (toIProperty p1) (toIProperty p2) +-- | Class of types that can be used as properties of a host. class IsProp p where - -- | Sets description. - describe :: p -> Desc -> p + setDesc :: p -> Desc -> p toProp :: p -> Property HasInfo getDesc :: p -> Desc -- | Gets the info of the property, combined with all info @@ -187,21 +187,21 @@ class IsProp p where getInfoRecursive :: p -> Info instance IsProp (Property HasInfo) where - describe (IProperty _ a i cs) d = IProperty d a i cs + setDesc (IProperty _ a i cs) d = IProperty d a i cs toProp = id getDesc = propertyDesc getInfoRecursive (IProperty _ _ i cs) = i <> mconcat (map getInfoRecursive cs) instance IsProp (Property NoInfo) where - describe (SProperty _ a cs) d = SProperty d a cs + setDesc (SProperty _ a cs) d = SProperty d a cs toProp = toIProperty getDesc = propertyDesc getInfoRecursive _ = mempty instance IsProp RevertableProperty where -- | Sets the description of both sides. - describe (RevertableProperty p1 p2) d = - RevertableProperty (describe p1 d) (describe p2 ("not " ++ d)) + setDesc (RevertableProperty p1 p2) d = + RevertableProperty (setDesc p1 d) (setDesc p2 ("not " ++ d)) getDesc (RevertableProperty p1 _) = getDesc p1 toProp (RevertableProperty p1 _) = p1 -- | Return the Info of the currently active side. -- cgit v1.2.3