Safe Haskell | None |
---|---|
Language | Haskell2010 |
Graphics.QML.Marshal
Description
Type classs and instances for marshalling values between Haskell and QML.
- class Marshal t where
- type MarshalMode t c d
- 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.
Minimal complete definition
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.
type family ModeBidi c Source #
MarshalMode
for non-object types with bidirectional marshalling.
Instances
type ModeBidi IGetObjType Source # | |
type ModeBidi IIsObjType Source # | |
type ModeBidi ICanReturnTo Source # | |
type ModeBidi ICanPassTo Source # | |
type ModeBidi ICanGetFrom Source # | |
type family ModeFrom c Source #
MarshalMode
for non-object types with from-only marshalling.
Instances
type ModeFrom IGetObjType Source # | |
type ModeFrom IIsObjType Source # | |
type ModeFrom ICanReturnTo Source # | |
type ModeFrom ICanPassTo Source # | |
type ModeFrom ICanGetFrom Source # | |
MarshalMode
for non-object types with to-only marshalling.
Instances
type ModeTo IGetObjType Source # | |
type ModeTo IIsObjType Source # | |
type ModeTo ICanReturnTo Source # | |
type ModeTo ICanPassTo Source # | |
type ModeTo ICanGetFrom Source # | |
type family ModeRetVoid c Source #
MarshalMode
for void in method returns.
Instances
type ModeRetVoid IGetObjType Source # | |
type ModeRetVoid IIsObjType Source # | |
type ModeRetVoid ICanReturnTo Source # | |
type ModeRetVoid ICanPassTo Source # | |
type ModeRetVoid ICanGetFrom Source # | |
type family ModeObjBidi a c Source #
MarshalMode
for object types with bidirectional marshalling.
Instances
type ModeObjBidi a ICanGetFrom Source # | |
type ModeObjBidi a ICanPassTo Source # | |
type ModeObjBidi a ICanReturnTo Source # | |
type ModeObjBidi a IIsObjType Source # | |
type ModeObjBidi a IGetObjType Source # | |
type family ModeObjFrom a c Source #
MarshalMode
for object types with from-only marshalling.
Instances
type ModeObjFrom a ICanGetFrom Source # | |
type ModeObjFrom a ICanPassTo Source # | |
type ModeObjFrom a ICanReturnTo Source # | |
type ModeObjFrom a IIsObjType Source # | |
type ModeObjFrom a IGetObjType Source # | |
type family ModeObjTo a c Source #
MarshalMode
for object types with to-only marshalling.
Instances
type ModeObjTo a ICanGetFrom Source # | |
type ModeObjTo a ICanPassTo Source # | |
type ModeObjTo a ICanReturnTo Source # | |
type ModeObjTo a IIsObjType Source # | |
type ModeObjTo a IGetObjType Source # | |
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 ModeRetVoid ICanGetFrom Source # | |
type ModeTo ICanGetFrom Source # | |
type ModeFrom ICanGetFrom Source # | |
type ModeBidi ICanGetFrom Source # | |
type ModeObjTo a ICanGetFrom Source # | |
type ModeObjFrom a ICanGetFrom Source # | |
type ModeObjBidi a ICanGetFrom Source # | |
type MarshalMode [a] ICanGetFrom d Source # | |
type MarshalMode (Maybe a) ICanGetFrom d Source # | |
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 ModeRetVoid ICanPassTo Source # | |
type ModeTo ICanPassTo Source # | |
type ModeFrom ICanPassTo Source # | |
type ModeBidi ICanPassTo Source # | |
type ModeObjTo a ICanPassTo Source # | |
type ModeObjFrom a ICanPassTo Source # | |
type ModeObjBidi a ICanPassTo Source # | |
type MarshalMode [a] ICanPassTo d Source # | |
type MarshalMode (Maybe a) ICanPassTo d Source # | |
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 ModeRetVoid ICanReturnTo Source # | |
type ModeTo ICanReturnTo Source # | |
type ModeFrom ICanReturnTo Source # | |
type ModeBidi ICanReturnTo Source # | |
type ModeObjTo a ICanReturnTo Source # | |
type ModeObjFrom a ICanReturnTo Source # | |
type ModeObjBidi a ICanReturnTo Source # | |
type MarshalMode [a] ICanReturnTo d Source # | |
type MarshalMode (Maybe a) ICanReturnTo d Source # | |
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 ModeRetVoid IIsObjType Source # | |
type ModeTo IIsObjType Source # | |
type ModeFrom IIsObjType Source # | |
type ModeBidi IIsObjType Source # | |
type ModeObjTo a IIsObjType Source # | |
type ModeObjFrom a IIsObjType Source # | |
type ModeObjBidi a IIsObjType Source # | |
type MarshalMode [a] IIsObjType d Source # | |
type MarshalMode (Maybe a) IIsObjType d Source # | |
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 ModeRetVoid IGetObjType Source # | |
type ModeTo IGetObjType Source # | |
type ModeFrom IGetObjType Source # | |
type ModeBidi IGetObjType Source # | |
type ModeObjTo a IGetObjType Source # | |
type ModeObjFrom a IGetObjType Source # | |
type ModeObjBidi a IGetObjType Source # | |
type MarshalMode [a] IGetObjType d Source # | |
type MarshalMode (Maybe a) IGetObjType d Source # | |
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 |
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.