Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data BaseInStructure = BaseInStructure {}
- data BaseOutStructure = BaseOutStructure {}
- type family Extends (a :: [Type] -> Type) (b :: Type) :: Constraint where ...
- class PeekChain es where
- class PokeChain es where
- type family Chain (xs :: [a]) = (r :: a) | r -> xs where ...
- type family Extendss (p :: [Type] -> Type) (xs :: [Type]) :: Constraint where ...
- data SomeStruct (a :: [Type] -> Type) where
- SomeStruct :: forall a es. (Extendss a es, PokeChain es, Show (Chain es)) => a es -> SomeStruct a
- extendSomeStruct :: (Extensible a, Extends a e, ToCStruct e, Show e) => e -> SomeStruct a -> SomeStruct a
- withSomeStruct :: forall a b. SomeStruct a -> (forall es. (Extendss a es, PokeChain es, Show (Chain es)) => a es -> b) -> b
- withSomeCStruct :: forall a b. (forall es. (Extendss a es, PokeChain es) => ToCStruct (a es)) => SomeStruct a -> (forall es. (Extendss a es, PokeChain es) => Ptr (a es) -> IO b) -> IO b
- peekSomeCStruct :: forall a. (Extensible a, forall es. (Extendss a es, PeekChain es) => FromCStruct (a es)) => Ptr (SomeStruct a) -> IO (SomeStruct a)
- pokeSomeCStruct :: (forall es. (Extendss a es, PokeChain es) => ToCStruct (a es)) => Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
- forgetExtensions :: Ptr (a es) -> Ptr (SomeStruct a)
- class Extensible (a :: [Type] -> Type) where
- pattern (::&) :: Extensible a => a es' -> Chain es -> a es
- pattern (:&) :: e -> Chain es -> Chain (e ': es)
- data SomeChild (a :: Type) where
- withSomeChild :: SomeChild a -> (Ptr (SomeChild a) -> IO b) -> IO b
- lowerChildPointer :: Inherits a b => Ptr b -> Ptr (SomeChild a)
- type family Inherits (a :: Type) (b :: Type) :: Constraint where ...
- class Inheritable (a :: Type) where
- peekSomeCChild :: Ptr (SomeChild a) -> IO (SomeChild a)
Documentation
data BaseInStructure Source #
XrBaseInStructure - Convenience type for iterating (read only)
Member Descriptions
Description
BaseInStructure
can be used to facilitate iterating through a
read-only structure pointer chain.
See Also
BaseInStructure | |
|
Instances
data BaseOutStructure Source #
XrBaseOutStructure - Convenience type for iterating (mutable)
Member Descriptions
Description
BaseOutStructure
can be used to facilitate iterating through a
structure pointer chain that returns data back to the application.
See Also
BaseOutStructure | |
|
Instances
type family Extends (a :: [Type] -> Type) (b :: Type) :: Constraint where ... Source #
data SomeStruct (a :: [Type] -> Type) where Source #
SomeStruct :: forall a es. (Extendss a es, PokeChain es, Show (Chain es)) => a es -> SomeStruct a |
Instances
(forall (es :: [Type]). Show (Chain es) => Show (a es)) => Show (SomeStruct a) Source # | |
Defined in OpenXR.CStruct.Extends showsPrec :: Int -> SomeStruct a -> ShowS # show :: SomeStruct a -> String # showList :: [SomeStruct a] -> ShowS # | |
Zero (a ('[] :: [Type])) => Zero (SomeStruct a) Source # | The constraint is so on this instance to encourage type inference |
Defined in OpenXR.CStruct.Extends zero :: SomeStruct a # |
extendSomeStruct :: (Extensible a, Extends a e, ToCStruct e, Show e) => e -> SomeStruct a -> SomeStruct a Source #
Add an extension to the beginning of the struct chain
This can be used to optionally extend structs based on some condition (for example, an extension or layer being available)
withSomeStruct :: forall a b. SomeStruct a -> (forall es. (Extendss a es, PokeChain es, Show (Chain es)) => a es -> b) -> b Source #
Consume a SomeStruct
value
withSomeCStruct :: forall a b. (forall es. (Extendss a es, PokeChain es) => ToCStruct (a es)) => SomeStruct a -> (forall es. (Extendss a es, PokeChain es) => Ptr (a es) -> IO b) -> IO b Source #
Write the C representation of some extended a
and use the pointer,
the pointer must not be returned from the continuation.
peekSomeCStruct :: forall a. (Extensible a, forall es. (Extendss a es, PeekChain es) => FromCStruct (a es)) => Ptr (SomeStruct a) -> IO (SomeStruct a) Source #
Given a pointer to a struct with an unknown chain, peek the struct and its chain.
:: (forall es. (Extendss a es, PokeChain es) => ToCStruct (a es)) | |
=> Ptr (SomeStruct a) | Pointer to some memory at least the size of the head of the struct chain. |
-> SomeStruct a | The struct to poke |
-> IO b | Computation to run while the poked tail is valid |
-> IO b |
Given some memory for the head of the chain, allocate and poke the tail and run an action.
forgetExtensions :: Ptr (a es) -> Ptr (SomeStruct a) Source #
Forget which extensions a pointed-to struct has by casting the pointer
class Extensible (a :: [Type] -> Type) where Source #
extensibleTypeName :: String Source #
For error reporting an invalid extension
getNext :: a es -> Chain es Source #
setNext :: a ds -> Chain es -> a es Source #
extends :: forall e b proxy. Typeable e => proxy e -> (Extends a e => b) -> Maybe b Source #
Instances
pattern (::&) :: Extensible a => a es' -> Chain es -> a es infix 6 Source #
A pattern synonym to separate the head of a struct chain from the
tail, use in conjunction with :&
to extract several members.
Head{..} ::& () <- returningNoTail a b c -- Equivalent to Head{..} <- returningNoTail @'[] a b c
Head{..} ::& Foo{..} :& Bar{..} :& () <- returningWithTail a b c
myFun (Head{..} :&& Foo{..} :& ())
type family Inherits (a :: Type) (b :: Type) :: Constraint where ... Source #
class Inheritable (a :: Type) where Source #
Instances
Inheritable HapticBaseHeader Source # | |
Defined in OpenXR.Core10.Haptics | |
Inheritable SwapchainImageBaseHeader Source # | |
Defined in OpenXR.Core10.Image | |
Inheritable EventDataBaseHeader Source # | |
Defined in OpenXR.Core10.OtherTypes | |
Inheritable LoaderInitInfoBaseHeaderKHR Source # | |
Inheritable (CompositionLayerBaseHeader ('[] :: [Type])) Source # | |
Defined in OpenXR.Core10.OtherTypes peekSomeCChild :: Ptr (SomeChild (CompositionLayerBaseHeader '[])) -> IO (SomeChild (CompositionLayerBaseHeader '[])) Source # |