From 55ed8e8743e861e2230e40670a56034353cf4e32 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 26 Feb 2017 16:11:38 -0400 Subject: use ConfigurableValue where applicable * Removed fromPort (use val instead). (API change) * Removed several Show instances that were only used for generating configuration, replacing with ConfigurableValue instances. (API change) It's somewhat annoying that IsInfo requires a Show instance. That's needed to be able to display Info in ghci, but some non-derived Show instances had to be kept to support that. --- src/Propellor/Types/ZFS.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Types/ZFS.hs') diff --git a/src/Propellor/Types/ZFS.hs b/src/Propellor/Types/ZFS.hs index 3ce4b22c..42ff74ec 100644 --- a/src/Propellor/Types/ZFS.hs +++ b/src/Propellor/Types/ZFS.hs @@ -6,6 +6,8 @@ module Propellor.Types.ZFS where +import Propellor.Types.ConfigurableValue + import Data.String import qualified Data.Set as Set import qualified Data.String.Utils as SU @@ -37,8 +39,11 @@ fromPropertyList props = zfsName :: ZFS -> String zfsName (ZFS (ZPool pool) dataset) = intercalate "/" [pool, show dataset] +instance ConfigurableValue ZDataset where + val (ZDataset paths) = intercalate "/" paths + instance Show ZDataset where - show (ZDataset paths) = intercalate "/" paths + show = val instance IsString ZDataset where fromString s = ZDataset $ SU.split "/" s -- cgit v1.2.3