ganeti

Safe HaskellSafe-Infered

Ganeti.PyValue

Contents

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 whereSource

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.

Methods

showValue :: a -> StringSource

showValueList :: [a] -> StringSource

Instances

PyValue Bool 
PyValue Char 
PyValue Double 
PyValue Int 
PyValue Integer 
PyValue JSValue 
PyValue PyValueEx 
PyValue Protocol

PyValue instance of Protocol

This instance is used by the Haskell to Python constants

PyValue PythonNone 
PyValue PythonChar 
PyValue PyType 
PyValue DiskTemplate 
PyValue VerifyOptionalChecks 
PyValue CVErrorCode 
PyValue Hypervisor 
PyValue ExportMode 
PyValue VType 
PyValue AdminStateSource 
PyValue DiskIndex 
PyValue INicParams 
PyValue RecreateDisksInfo 
PyValue IDiskParams 
PyValue InstanceState 
PyValue a => PyValue [a] 
PyValue a => PyValue (JSObject a) 
PyValue a => PyValue (ListSet a) 
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.

PyValue a => PyValue (NonEmpty a) 
PyValue a => PyValue (NonNegative a) 
PyValue a => PyValue (Private a) 
PyValue a => PyValue (SetParamsMods a) 
(PyValue a, PyValue b) => PyValue (a, b) 
(PyValue k, PyValue a) => PyValue (Map k a) 
(PyValue a, PyValue b, PyValue c) => PyValue (a, b, c) 

PyValue represents an unspecified value convertible to Python

data PyValueEx Source

Encapsulates Python default values

Constructors

forall a . PyValue a => PyValueEx a 

Instances