add trivial HasImage instance for Image

This commit is contained in:
Joey Hess 2015-05-16 13:28:19 -04:00
parent a781e43b22
commit ed9203928b
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-}
-- | Docker support for propellor
--
@ -85,6 +85,9 @@ data Container = Container Image Host
class HasImage a where
getImageName :: a -> Image
instance HasImage Image where
getImageName = id
instance HasImage Container where
getImageName (Container i _) = i