| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Graphics.QML.Marshal
Description
Type classs and instances for marshalling values between Haskell and QML.
Synopsis
- class Marshal t where
- type MarshalMode t c d
- marshaller :: MarshallerFor t
- type family ModeBidi c
- type family ModeFrom c
- type family ModeTo c
- type family ModeRetVoid c
- type family ModeObjBidi a c
- type family ModeObjFrom a c
- type family ModeObjTo a c
- data Yes
- type CanGetFrom t = MarshalMode t ICanGetFrom ()
- data ICanGetFrom
- type CanPassTo t = MarshalMode t ICanPassTo ()
- data ICanPassTo
- type CanReturnTo t = MarshalMode t ICanReturnTo ()
- data ICanReturnTo
- type IsObjType t = MarshalMode t IIsObjType ()
- data IIsObjType
- type GetObjType t = MarshalMode t IGetObjType ()
- data IGetObjType
- data Marshaller t u v w x y
- data Ignored = Ignored
- bidiMarshallerIO :: forall a b. (Marshal a, CanGetFrom a ~ Yes, CanPassTo a ~ Yes) => (a -> IO b) -> (b -> IO a) -> BidiMarshaller a b
- bidiMarshaller :: forall a b. (Marshal a, CanGetFrom a ~ Yes, CanPassTo a ~ Yes) => (a -> b) -> (b -> a) -> BidiMarshaller a b
- fromMarshallerIO :: forall a b. (Marshal a, CanGetFrom a ~ Yes) => (a -> IO b) -> FromMarshaller a b
- fromMarshaller :: forall a b. (Marshal a, CanGetFrom a ~ Yes) => (a -> b) -> FromMarshaller a b
- toMarshallerIO :: forall a b. (Marshal a, CanPassTo a ~ Yes) => (b -> IO a) -> ToMarshaller a b
- toMarshaller :: forall a b. (Marshal a, CanPassTo a ~ Yes) => (b -> a) -> ToMarshaller a b
Marshalling Type-class
class Marshal t where Source #
The class Marshal allows Haskell values to be marshalled to and from the
QML environment.
Associated Types
type MarshalMode t c d Source #
The MarshalMode associated type family specifies the marshalling
capabilities offered by the instance. c indicates the capability being
queried. d is dummy parameter which allows certain instances to type
check.
Instances
type family ModeBidi c Source #
MarshalMode for non-object types with bidirectional marshalling.
Instances
| type ModeBidi ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeBidi ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeBidi ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeBidi IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeBidi IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type family ModeFrom c Source #
MarshalMode for non-object types with from-only marshalling.
Instances
| type ModeFrom ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
MarshalMode for non-object types with to-only marshalling.
Instances
| type ModeTo ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type family ModeRetVoid c Source #
MarshalMode for void in method returns.
Instances
| type ModeRetVoid ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type family ModeObjBidi a c Source #
MarshalMode for object types with bidirectional marshalling.
Instances
| type ModeObjBidi a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type family ModeObjFrom a c Source #
MarshalMode for object types with from-only marshalling.
Instances
| type ModeObjFrom a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type family ModeObjTo a c Source #
MarshalMode for object types with to-only marshalling.
Instances
| type ModeObjTo a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
type CanGetFrom t = MarshalMode t ICanGetFrom () Source #
Type function equal to Yes if the marshallable type t supports being
received from QML.
data ICanGetFrom Source #
Type index into MarshalMode for querying if the mode supports receiving
values from QML.
Instances
| type ModeBidi ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a ICanGetFrom Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type MarshalMode (Maybe a) ICanGetFrom d Source # | |
Defined in Graphics.QML.Marshal | |
| type MarshalMode [a] ICanGetFrom d Source # | |
Defined in Graphics.QML.Marshal | |
type CanPassTo t = MarshalMode t ICanPassTo () Source #
Type function equal to Yes if the marshallable type t supports being
passed to QML.
data ICanPassTo Source #
Type index into MarshalMode for querying if the mode supports passing
values to QML.
Instances
| type ModeBidi ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a ICanPassTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type MarshalMode (Maybe a) ICanPassTo d Source # | |
Defined in Graphics.QML.Marshal | |
| type MarshalMode [a] ICanPassTo d Source # | |
Defined in Graphics.QML.Marshal | |
type CanReturnTo t = MarshalMode t ICanReturnTo () Source #
Type function equal to Yes if the marshallable type t supports being
returned to QML.
data ICanReturnTo Source #
Type index into MarshalMode for querying if the mode supports returning
values to QML.
Instances
| type ModeBidi ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a ICanReturnTo Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type MarshalMode (Maybe a) ICanReturnTo d Source # | |
Defined in Graphics.QML.Marshal | |
| type MarshalMode [a] ICanReturnTo d Source # | |
Defined in Graphics.QML.Marshal | |
type IsObjType t = MarshalMode t IIsObjType () Source #
Type function equal to Yes if the marshallable type t is an object.
data IIsObjType Source #
Type index into MarshalMode for querying if the mode supports an object
type.
Instances
| type ModeBidi IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a IIsObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type MarshalMode (Maybe a) IIsObjType d Source # | |
Defined in Graphics.QML.Marshal | |
| type MarshalMode [a] IIsObjType d Source # | |
Defined in Graphics.QML.Marshal | |
type GetObjType t = MarshalMode t IGetObjType () Source #
Type function which returns the type encapsulated by the object handles
used by the marshallable type t.
data IGetObjType Source #
Type index into MarshalMode for querying the type encapsulated by the
mode's object handles.
Instances
| type ModeBidi IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeFrom IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeRetVoid IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeTo IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjBidi a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjFrom a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type ModeObjTo a IGetObjType Source # | |
Defined in Graphics.QML.Internal.Marshal | |
| type MarshalMode (Maybe a) IGetObjType d Source # | |
Defined in Graphics.QML.Marshal | |
| type MarshalMode [a] IGetObjType d Source # | |
Defined in Graphics.QML.Marshal | |
data Marshaller t u v w x y Source #
Encapsulates the functionality to needed to implement an instance of
Marshal so that such instances can be defined without access to
implementation details.
Data Types
Represents an argument whose value is ignored.
Constructors
| Ignored |
Instances
| Marshal Ignored Source # | |
Defined in Graphics.QML.Marshal Associated Types type MarshalMode Ignored c d Source # Methods marshaller :: MarshallerFor Ignored Source # | |
| type MarshalMode Ignored c d Source # | |
Defined in Graphics.QML.Marshal | |
Custom Marshallers
bidiMarshallerIO :: forall a b. (Marshal a, CanGetFrom a ~ Yes, CanPassTo a ~ Yes) => (a -> IO b) -> (b -> IO a) -> BidiMarshaller a b Source #
Provides a bidirectional Marshaller which allows you to define an
instance of Marshal for your own type b in terms of another marshallable
type a. Type b should have a MarshalMode of ModeObjBidi or
ModeBidi depending on whether a was an object type or not.
bidiMarshaller :: forall a b. (Marshal a, CanGetFrom a ~ Yes, CanPassTo a ~ Yes) => (a -> b) -> (b -> a) -> BidiMarshaller a b Source #
Variant of bidiMarshallerIO where the conversion functions between types
a and b do not live in the IO monad.
fromMarshallerIO :: forall a b. (Marshal a, CanGetFrom a ~ Yes) => (a -> IO b) -> FromMarshaller a b Source #
Provides a "from" Marshaller which allows you to define an instance of
Marshal for your own type b in terms of another marshallable type a.
Type b should have a MarshalMode of ModeObjFrom or ModeFrom
depending on whether a was an object type or not.
fromMarshaller :: forall a b. (Marshal a, CanGetFrom a ~ Yes) => (a -> b) -> FromMarshaller a b Source #
Variant of fromMarshallerIO where the conversion function between types
a and b does not live in the IO monad.
toMarshallerIO :: forall a b. (Marshal a, CanPassTo a ~ Yes) => (b -> IO a) -> ToMarshaller a b Source #
Provides a "to" Marshaller which allows you to define an instance of
Marshal for your own type b in terms of another marshallable type a.
Type b should have a MarshalMode of ModeObjTo or ModeTo
depending on whether a was an object type or not.
toMarshaller :: forall a b. (Marshal a, CanPassTo a ~ Yes) => (b -> a) -> ToMarshaller a b Source #
Variant of toMarshallerIO where the conversion function between types
a and b does not live in the IO monad.
Orphan instances
| Marshal Int32 Source # | |
Associated Types type MarshalMode Int32 c d Source # Methods marshaller :: MarshallerFor Int32 Source # | |
| Marshal Text Source # | |
Associated Types type MarshalMode Text c d Source # Methods marshaller :: MarshallerFor Text Source # | |
| Marshal Bool Source # | |
Associated Types type MarshalMode Bool c d Source # Methods marshaller :: MarshallerFor Bool Source # | |
| Marshal Double Source # | |
Associated Types type MarshalMode Double c d Source # Methods marshaller :: MarshallerFor Double Source # | |
| Marshal Int Source # | |
Associated Types type MarshalMode Int c d Source # Methods marshaller :: MarshallerFor Int Source # | |
| Marshal a => Marshal (Maybe a) Source # | |
Associated Types type MarshalMode (Maybe a) c d Source # Methods marshaller :: MarshallerFor (Maybe a) Source # | |
| Marshal a => Marshal [a] Source # | |
Associated Types type MarshalMode [a] c d Source # Methods marshaller :: MarshallerFor [a] Source # | |