Revision 85bcb1de

b/src/Ganeti/PyValueInstances.hs
40 40
import Ganeti.BasicTypes
41 41
import Ganeti.THH
42 42

  
43
instance PyValue Bool
44
instance PyValue Int
45
instance PyValue Integer
46
instance PyValue Double
47
instance PyValue Char
43
instance PyValue Bool where
44
  showValue = show
45

  
46
instance PyValue Int where
47
  showValue = show
48

  
49
instance PyValue Integer where
50
  showValue = show
51

  
52
instance PyValue Double where
53
  showValue = show
54

  
55
instance PyValue Char where
56
  showValue = show
48 57

  
49 58
instance (PyValue a, PyValue b) => PyValue (a, b) where
50 59
  showValue (x, y) = "(" ++ showValue x ++ "," ++ showValue y ++ ")"
b/src/Ganeti/THH.hs
562 562
-- This is necessary for the default values of opcode parameters and
563 563
-- return values.  For example, if a default value or return type is a
564 564
-- Data.Map, then it must be shown as a Python dictioanry.
565
class Show a => PyValue a where
565
class PyValue a where
566 566
  showValue :: a -> String
567
  showValue = show
568 567

  
569 568
-- | Encapsulates Python default values
570 569
data PyValueEx = forall a. PyValue a => PyValueEx a

Also available in: Unified diff