From 58c8d74b4c4917f9f5e566709202ad432a7b2a6f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 May 2014 20:48:23 -0400 Subject: simplified record accessors --- src/Propellor/Attr.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/Propellor/Attr.hs') diff --git a/src/Propellor/Attr.hs b/src/Propellor/Attr.hs index 8f1c6b7c..29d7a01e 100644 --- a/src/Propellor/Attr.hs +++ b/src/Propellor/Attr.hs @@ -15,9 +15,6 @@ import Control.Applicative pureAttrProperty :: Desc -> Attr -> Property pureAttrProperty desc = Property ("has " ++ desc) (return NoChange) -getHostName :: Propellor HostName -getHostName = asks _hostName - os :: System -> Property os system = pureAttrProperty ("Operating " ++ show system) $ mempty { _os = Just system } @@ -63,14 +60,8 @@ sshPubKey k = pureAttrProperty ("ssh pubkey known") $ getSshPubKey :: Propellor (Maybe String) getSshPubKey = asks (_sshPubKey . hostAttr) -hostAttr :: Host -> Attr -hostAttr (Host _ _ attr) = attr - -hostProperties :: Host -> [Property] -hostProperties (Host _ ps _) = ps - hostMap :: [Host] -> M.Map HostName Host -hostMap l = M.fromList $ zip (map _hostName l) l +hostMap l = M.fromList $ zip (map hostName l) l findHost :: [Host] -> HostName -> Maybe Host findHost l hn = M.lookup hn (hostMap l) -- cgit v1.3-2-g0d8e