ganeti
Safe HaskellSafe

Ganeti.PyValue

Description

PyValue contains instances for the PyValue typeclass.

The typeclass PyValue converts Haskell values to Python values. This module contains instances of this typeclass for several generic types. These instances are used in the Haskell to Python generation of opcodes and constants, for example.

Synopsis

PyValue represents data types convertible to Python

class PyValue a where Source #

Converts Haskell values into Python values

This is necessary for the default values of opcode parameters and return values. For example, if a default value or return type is a Data.Map, then it must be shown as a Python dictioanry.

Minimal complete definition

showValue

Methods

showValue :: a -> String Source #

showValueList :: [a] -> String Source #

Instances

Instances details
PyValue Bool # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Bool -> String Source #

showValueList :: [Bool] -> String Source #

PyValue Char # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Char -> String Source #

showValueList :: [Char] -> String Source #

PyValue Double # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Double -> String Source #

showValueList :: [Double] -> String Source #

PyValue Int # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Int -> String Source #

showValueList :: [Int] -> String Source #

PyValue Integer # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Integer -> String Source #

showValueList :: [Integer] -> String Source #

PyValue JSValue # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: JSValue -> String Source #

showValueList :: [JSValue] -> String Source #

PyValue ByteString # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: ByteString -> String Source #

showValueList :: [ByteString] -> String Source #

PyValue PyValueEx # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: PyValueEx -> String Source #

showValueList :: [PyValueEx] -> String Source #

PyValue Protocol #

PyValue instance of Protocol

This instance is used by the Haskell to Python constants

Instance details

Defined in Ganeti.ConstantUtils

Methods

showValue :: Protocol -> String Source #

showValueList :: [Protocol] -> String Source #

PyValue PythonNone # 
Instance details

Defined in Ganeti.ConstantUtils

Methods

showValue :: PythonNone -> String Source #

showValueList :: [PythonNone] -> String Source #

PyValue PythonChar # 
Instance details

Defined in Ganeti.ConstantUtils

Methods

showValue :: PythonChar -> String Source #

showValueList :: [PythonChar] -> String Source #

PyValue PyType # 
Instance details

Defined in Ganeti.THH.PyType

Methods

showValue :: PyType -> String Source #

showValueList :: [PyType] -> String Source #

PyValue DiskTemplate # 
Instance details

Defined in Ganeti.Types

Methods

showValue :: DiskTemplate -> String Source #

showValueList :: [DiskTemplate] -> String Source #

PyValue VerifyOptionalChecks # 
Instance details

Defined in Ganeti.OpCodes

PyValue CVErrorCode # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: CVErrorCode -> String Source #

showValueList :: [CVErrorCode] -> String Source #

PyValue Hypervisor # 
Instance details

Defined in Ganeti.Types

Methods

showValue :: Hypervisor -> String Source #

showValueList :: [Hypervisor] -> String Source #

PyValue ExportMode # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: ExportMode -> String Source #

showValueList :: [ExportMode] -> String Source #

PyValue VType # 
Instance details

Defined in Ganeti.Types

Methods

showValue :: VType -> String Source #

showValueList :: [VType] -> String Source #

PyValue AdminStateSource # 
Instance details

Defined in Ganeti.Types

PyValue DiskIndex # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: DiskIndex -> String Source #

showValueList :: [DiskIndex] -> String Source #

PyValue INicParams # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: INicParams -> String Source #

showValueList :: [INicParams] -> String Source #

PyValue RecreateDisksInfo # 
Instance details

Defined in Ganeti.OpCodes

PyValue IDiskParams # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: IDiskParams -> String Source #

showValueList :: [IDiskParams] -> String Source #

PyValue InstanceState # 
Instance details

Defined in Ganeti.Rpc

PyValue a => PyValue [a] # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: [a] -> String Source #

showValueList :: [[a]] -> String Source #

PyValue a => PyValue (JSObject a) # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: JSObject a -> String Source #

showValueList :: [JSObject a] -> String Source #

PyValue a => PyValue (ListSet a) # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: ListSet a -> String Source #

showValueList :: [ListSet a] -> String Source #

PyValue a => PyValue (FrozenSet a) #

Converts a Haskell Set into a Python frozenset

This instance was supposed to be for Set instead of FrozenSet. However, 'ghc-6.12.1' seems to be crashing with 'segmentation fault' due to the presence of more than one instance of Set, namely, this one and the one in OpCodes. For this reason, we wrap Set into FrozenSet.

Instance details

Defined in Ganeti.ConstantUtils

Methods

showValue :: FrozenSet a -> String Source #

showValueList :: [FrozenSet a] -> String Source #

PyValue a => PyValue (NonEmpty a) # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: NonEmpty a -> String Source #

showValueList :: [NonEmpty a] -> String Source #

PyValue a => PyValue (NonNegative a) # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: NonNegative a -> String Source #

showValueList :: [NonNegative a] -> String Source #

PyValue a => PyValue (Secret a) # 
Instance details

Defined in Ganeti.Types

Methods

showValue :: Secret a -> String Source #

showValueList :: [Secret a] -> String Source #

PyValue a => PyValue (Private a) # 
Instance details

Defined in Ganeti.Types

Methods

showValue :: Private a -> String Source #

showValueList :: [Private a] -> String Source #

PyValue a => PyValue (SetParamsMods a) # 
Instance details

Defined in Ganeti.OpCodes

Methods

showValue :: SetParamsMods a -> String Source #

showValueList :: [SetParamsMods a] -> String Source #

(PyValue a, PyValue b) => PyValue (a, b) # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: (a, b) -> String Source #

showValueList :: [(a, b)] -> String Source #

(PyValue k, PyValue a) => PyValue (Map k a) # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: Map k a -> String Source #

showValueList :: [Map k a] -> String Source #

(PyValue a, PyValue b, PyValue c) => PyValue (a, b, c) # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: (a, b, c) -> String Source #

showValueList :: [(a, b, c)] -> String Source #

PyValue represents an unspecified value convertible to Python

data PyValueEx Source #

Encapsulates Python default values

Constructors

forall a.PyValue a => PyValueEx a 

Instances

Instances details
PyValue PyValueEx # 
Instance details

Defined in Ganeti.PyValue

Methods

showValue :: PyValueEx -> String Source #

showValueList :: [PyValueEx] -> String Source #