Revision 5d4e1402 src/Ganeti/ConstantUtils.hs

b/src/Ganeti/ConstantUtils.hs
28 28
-}
29 29
module Ganeti.ConstantUtils where
30 30

  
31
import Data.Char (ord)
31 32
import Data.Set (Set)
32 33
import qualified Data.Set as Set (fromList, toList)
33 34

  
34 35
import Ganeti.THH (PyValue(..))
35 36
import Ganeti.PyValueInstances ()
36 37

  
38
-- | PythonChar wraps a Python 'char'
39
newtype PythonChar = PythonChar { unPythonChar :: Char }
40
  deriving (Show)
41

  
42
instance PyValue PythonChar where
43
  showValue c = "chr(" ++ show (ord (unPythonChar c)) ++ ")"
44

  
37 45
-- | FrozenSet wraps a Haskell 'Set'
38 46
--
39 47
-- See 'PyValue' instance for 'FrozenSet'.

Also available in: Unified diff