code
stringlengths 5
1.03M
| repo_name
stringlengths 5
90
| path
stringlengths 4
158
| license
stringclasses 15
values | size
int64 5
1.03M
| n_ast_errors
int64 0
53.9k
| ast_max_depth
int64 2
4.17k
| n_whitespaces
int64 0
365k
| n_ast_nodes
int64 3
317k
| n_ast_terminals
int64 1
171k
| n_ast_nonterminals
int64 1
146k
| loc
int64 -1
37.3k
| cycloplexity
int64 -1
1.31k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
module Snap.Internal.Http.Server.GnuTLS
( GnuTLSException(..)
, initTLS
, stopTLS
, bindHttps
, freePort
, createSession
, endSession
, recv
, send
) where
------------------------------------------------------------------------------
import Control.Exception
import Data.ByteString (ByteString)
import Data.Dynamic
import Foreign.C
import Snap.Internal.Debug
import Snap.Internal.Http.Server.Backend
#ifdef GNUTLS
import qualified Data.ByteString as B
import Data.ByteString.Internal (w2c)
import qualified Data.ByteString.Internal as BI
import qualified Data.ByteString.Unsafe as BI
import Foreign
import qualified Network.Socket as Socket
#endif
------------------------------------------------------------------------------
data GnuTLSException = GnuTLSException String
deriving (Show, Typeable)
instance Exception GnuTLSException
#ifndef GNUTLS
initTLS :: IO ()
initTLS = throwIO $ GnuTLSException "TLS is not supported"
stopTLS :: IO ()
stopTLS = return ()
bindHttps :: ByteString -> Int -> FilePath -> FilePath -> IO ListenSocket
bindHttps _ _ _ _ = throwIO $ GnuTLSException "TLS is not supported"
freePort :: ListenSocket -> IO ()
freePort _ = return ()
createSession :: ListenSocket -> Int -> CInt -> IO () -> IO NetworkSession
createSession _ _ _ _ = throwIO $ GnuTLSException "TLS is not supported"
endSession :: NetworkSession -> IO ()
endSession _ = return ()
send :: IO () -> IO () -> NetworkSession -> ByteString -> IO ()
send _ _ _ _ = return ()
recv :: IO b -> NetworkSession -> IO (Maybe ByteString)
recv _ _ = throwIO $ GnuTLSException "TLS is not supported"
#else
------------------------------------------------------------------------------
-- | Init
initTLS :: IO ()
initTLS = gnutls_set_threading_helper >>
throwErrorIf "TLS init" gnutls_global_init
------------------------------------------------------------------------------
stopTLS :: IO ()
stopTLS = gnutls_global_deinit
------------------------------------------------------------------------------
-- | Binds ssl port
bindHttps :: ByteString
-> Int
-> FilePath
-> FilePath
-> IO ListenSocket
bindHttps bindAddress bindPort cert key = do
sock <- Socket.socket Socket.AF_INET Socket.Stream 0
addr <- getHostAddr bindPort bindAddress
Socket.setSocketOption sock Socket.ReuseAddr 1
Socket.bindSocket sock addr
Socket.listen sock 150
creds <- loadCredentials cert key
dh <- regenerateDHParam creds
return $ ListenHttps sock (castPtr creds) (castPtr dh)
------------------------------------------------------------------------------
loadCredentials :: FilePath --- ^ Path to certificate
-> FilePath --- ^ Path to key
-> IO (Ptr GnuTLSCredentials)
loadCredentials cert key = alloca $ \cPtr -> do
throwErrorIf "TLS allocate" $ gnutls_certificate_allocate_credentials cPtr
creds <- peek cPtr
withCString cert $ \certstr -> withCString key $ \keystr ->
throwErrorIf "TLS set Certificate" $
gnutls_certificate_set_x509_key_file
creds certstr keystr gnutls_x509_fmt_pem
return creds
------------------------------------------------------------------------------
regenerateDHParam :: Ptr GnuTLSCredentials -> IO (Ptr GnuTLSDHParam)
regenerateDHParam creds = alloca $ \dhptr -> do
throwErrorIf "TLS allocate" $ gnutls_dh_params_init dhptr
dh <- peek dhptr
throwErrorIf "TLS DHParm" $ gnutls_dh_params_generate2 dh 1024
gnutls_certificate_set_dh_params creds dh
return dh
------------------------------------------------------------------------------
freePort :: ListenSocket -> IO ()
freePort (ListenHttps _ creds dh) = do
gnutls_certificate_free_credentials $ castPtr creds
gnutls_dh_params_deinit $ castPtr dh
freePort _ = return ()
------------------------------------------------------------------------------
createSession :: ListenSocket -> Int -> CInt -> IO () -> IO NetworkSession
createSession (ListenHttps _ creds _) recvSize socket on_block =
alloca $ \sPtr -> do
throwErrorIf "TLS alloacte" $ gnutls_init sPtr 1
session <- peek sPtr
throwErrorIf "TLS session" $
gnutls_credentials_set session 1 $ castPtr creds
throwErrorIf "TLS session" $ gnutls_set_default_priority session
gnutls_certificate_send_x509_rdn_sequence session 1
gnutls_session_enable_compatibility_mode session
let s = NetworkSession socket (castPtr session) $
fromIntegral recvSize
gnutls_transport_set_ptr session $ intPtrToPtr $ fromIntegral $ socket
handshake s on_block
return s
createSession _ _ _ _ = error "Invalid socket"
------------------------------------------------------------------------------
endSession :: NetworkSession -> IO ()
endSession (NetworkSession _ session _) = do
throwErrorIf "TLS bye" $ gnutls_bye (castPtr session) 1 `finally` do
gnutls_deinit $ castPtr session
------------------------------------------------------------------------------
handshake :: NetworkSession -> IO () -> IO ()
handshake s@(NetworkSession { _session = session}) on_block = do
rc <- gnutls_handshake $ castPtr session
case rc of
x | x >= 0 -> return ()
| isIntrCode x -> handshake s on_block
| isAgainCode x -> on_block >> handshake s on_block
| otherwise -> throwError "TLS handshake" rc
------------------------------------------------------------------------------
send :: IO () -> IO () -> NetworkSession -> ByteString -> IO ()
send tickleTimeout onBlock (NetworkSession { _session = session}) bs =
BI.unsafeUseAsCStringLen bs $ uncurry loop
where
loop ptr len = do
sent <- gnutls_record_send (castPtr session) ptr $ fromIntegral len
let sent' = fromIntegral sent
case sent' of
x | x == 0 || x == len -> return ()
| x > 0 && x < len -> tickleTimeout >>
loop (plusPtr ptr sent') (len - sent')
| isIntrCode x -> loop ptr len
| isAgainCode x -> onBlock >> loop ptr len
| otherwise -> throwError "TLS send" $
fromIntegral sent'
------------------------------------------------------------------------------
recv :: IO b -> NetworkSession -> IO (Maybe ByteString)
recv onBlock (NetworkSession _ session recvLen) = do
fp <- BI.mallocByteString recvLen
sz <- withForeignPtr fp loop
if (sz :: Int) <= 0
then return Nothing
else return $ Just $ BI.fromForeignPtr fp 0 $ fromEnum sz
where
loop recvBuf = do
debug $ "TLS: calling record_recv with recvLen=" ++ show recvLen
size <- gnutls_record_recv (castPtr session) recvBuf $ toEnum recvLen
debug $ "TLS: record_recv returned with size=" ++ show size
let size' = fromIntegral size
case size' of
x | x >= 0 -> return x
| isIntrCode x -> loop recvBuf
| isAgainCode x -> onBlock >> loop recvBuf
| otherwise -> (throwError "TLS recv" $ fromIntegral size')
------------------------------------------------------------------------------
throwError :: String -> ReturnCode -> IO a
throwError prefix rc = gnutls_strerror rc >>=
peekCString >>=
throwIO . GnuTLSException . (prefix'++)
where
prefix' = prefix ++ "<" ++ show rc ++ ">: "
------------------------------------------------------------------------------
throwErrorIf :: String -> IO ReturnCode -> IO ()
throwErrorIf prefix action = do
rc <- action
if (rc < 0)
then throwError prefix rc
else return ()
------------------------------------------------------------------------------
isAgainCode :: (Integral a) => a -> Bool
isAgainCode x = (fromIntegral x) == (-28 :: Int)
------------------------------------------------------------------------------
isIntrCode :: (Integral a) => a -> Bool
isIntrCode x = (fromIntegral x) == (-52 :: Int)
------------------------------------------------------------------------------
getHostAddr :: Int
-> ByteString
-> IO Socket.SockAddr
getHostAddr p s = do
h <- if s == "*"
then return Socket.iNADDR_ANY
else Socket.inet_addr (map w2c . B.unpack $ s)
return $ Socket.SockAddrInet (fromIntegral p) h
-- Types
newtype ReturnCode = ReturnCode CInt
deriving (Show, Eq, Ord, Num, Real, Enum, Integral)
data GnuTLSCredentials
data GnuTLSSession
data GnuTLSDHParam
------------------------------------------------------------------------------
-- Global init/errors
foreign import ccall safe
"gnutls_set_threading_helper"
gnutls_set_threading_helper :: IO ()
foreign import ccall safe
"gnutls/gnutls.h gnutls_global_init"
gnutls_global_init :: IO ReturnCode
foreign import ccall safe
"gnutls/gnutls.h gnutls_global_deinit"
gnutls_global_deinit :: IO ()
foreign import ccall safe
"gnutls/gnutls.h gnutls_strerror"
gnutls_strerror :: ReturnCode -> IO CString
------------------------------------------------------------------------------
-- Sessions. All functions here except handshake and bye just
-- allocate memory or update members of structures, so they are ok with
-- unsafe ccall.
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_init"
gnutls_init :: Ptr (Ptr GnuTLSSession) -> CInt -> IO ReturnCode
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_deinit"
gnutls_deinit :: Ptr GnuTLSSession -> IO ()
foreign import ccall safe
"gnutls/gnutls.h gnutls_handshake"
gnutls_handshake :: Ptr GnuTLSSession -> IO ReturnCode
foreign import ccall safe
"gnutls/gnutls.h gnutls_bye"
gnutls_bye :: Ptr GnuTLSSession -> CInt -> IO ReturnCode
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_set_default_priority"
gnutls_set_default_priority :: Ptr GnuTLSSession -> IO ReturnCode
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_session_enable_compatibility_mode"
gnutls_session_enable_compatibility_mode :: Ptr GnuTLSSession -> IO ()
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_certificate_send_x509_rdn_sequence"
gnutls_certificate_send_x509_rdn_sequence
:: Ptr GnuTLSSession -> CInt -> IO ()
------------------------------------------------------------------------------
-- Certificates. Perhaps these could be unsafe but they are not performance
-- critical, since they are called only once during server startup.
foreign import ccall safe
"gnutls/gnutls.h gnutls_certificate_allocate_credentials"
gnutls_certificate_allocate_credentials
:: Ptr (Ptr GnuTLSCredentials) -> IO ReturnCode
foreign import ccall safe
"gnutls/gnutls.h gnutls_certificate_free_credentials"
gnutls_certificate_free_credentials
:: Ptr GnuTLSCredentials -> IO ()
gnutls_x509_fmt_pem :: CInt
gnutls_x509_fmt_pem = 1
foreign import ccall safe
"gnutls/gnutls.h gnutls_certificate_set_x509_key_file"
gnutls_certificate_set_x509_key_file
:: Ptr GnuTLSCredentials -> CString -> CString -> CInt -> IO ReturnCode
------------------------------------------------------------------------------
-- Credentials. This is ok as unsafe because it just sets members in the
-- session structure.
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_credentials_set"
gnutls_credentials_set
:: Ptr GnuTLSSession -> CInt -> Ptr a -> IO ReturnCode
------------------------------------------------------------------------------
-- Records. These are marked unsafe because they are very performance
-- critical. Since we are using non-blocking sockets send and recv will not
-- block.
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_transport_set_ptr"
gnutls_transport_set_ptr :: Ptr GnuTLSSession -> Ptr a -> IO ()
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_record_recv"
gnutls_record_recv :: Ptr GnuTLSSession -> Ptr a -> CSize -> IO CSize
foreign import ccall unsafe
"gnutls/gnutls.h gnutls_record_send"
gnutls_record_send :: Ptr GnuTLSSession -> Ptr a -> CSize -> IO CSize
------------------------------------------------------------------------------
-- DHParam. Perhaps these could be unsafe but they are not performance
-- critical.
foreign import ccall safe
"gnutls/gnutls.h gnutls_dh_params_init"
gnutls_dh_params_init :: Ptr (Ptr GnuTLSDHParam) -> IO ReturnCode
foreign import ccall safe
"gnutls/gnutls.h gnutls_dh_params_deinit"
gnutls_dh_params_deinit :: Ptr GnuTLSDHParam -> IO ()
foreign import ccall safe
"gnutls/gnutls.h gnutls_dh_params_generate2"
gnutls_dh_params_generate2 :: Ptr GnuTLSDHParam -> CUInt -> IO ReturnCode
foreign import ccall safe
"gnutls/gnutls.h gnutls_certificate_set_dh_params"
gnutls_certificate_set_dh_params
:: Ptr GnuTLSCredentials -> Ptr GnuTLSDHParam -> IO ()
#endif
|
janrain/snap-server
|
src/Snap/Internal/Http/Server/GnuTLS.hs
|
bsd-3-clause
| 13,357
| 0
| 10
| 2,735
| 457
| 255
| 202
| 41
| 1
|
module Image where
import Data.Array.IArray
import Text.Printf
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as C
type IntMat = Array (Int, Int) Int
data Image = Image
{ imgHeight :: Int
, imgWidth :: Int
, imgPixels :: IntMat
} deriving (Show, Eq)
safeParseP5 :: C.ByteString -> Maybe Image
safeParseP5 bs = parse' . words . removeComments . C.unpack $ bs
where
removeComments = unlines . removeComment . lines
removeComment = map $ takeWhile (/= '#')
takeEnd n xs = C.drop (C.length xs - n) xs
parse' (magic : hstr : wstr : maxValue : _) = do
guard $ magic == "P5"
guard $ read maxValue == (255 :: Int)
let
[h, w] = map read [hstr, wstr]
raster = takeEnd (fromIntegral (h*w)) bs
toArr = listArray ((1, 1), (h, w))
parseRaster = toArr . map fromEnum . C.unpack
return $ Image h w (parseRaster raster)
parse' _ = Nothing
parseP5 :: C.ByteString -> Image
parseP5 = maybe (error "Failed to parse image") id . safeParseP5
readP5 :: FilePath -> IO Image
readP5 filepath = parseP5 <$> C.readFile filepath
-- parseP5 . formatP5 should be id
-- At least it's true for lena
formatP5 :: Image -> C.ByteString
formatP5 (Image height width pxls) =
C.append header rasterScan
where
header = C.pack . unlines $
[ "P5"
, printf "%d %d" height width
, "255"
, ""]
rasterScan = C.pack . map toEnum . elems $ pxls
writeP5 :: FilePath -> Image -> IO ()
writeP5 = (. formatP5) . C.writeFile
|
lauzi/ms-final
|
src/Image.hs
|
bsd-3-clause
| 1,524
| 0
| 16
| 382
| 554
| 297
| 257
| 41
| 2
|
{-# LANGUAGE BangPatterns #-}
module D18Lib where
import Data.List
import Data.Maybe
import qualified Data.Map.Strict as Map
import qualified Data.Sequence as Seq
import Debug.Trace
data Operand = Const Int | RegRef Char deriving (Eq, Show)
data Op = Snd Operand
| Set Operand Operand
| Add Operand Operand
| Mul Operand Operand
| Mod Operand Operand
| Rcv Operand
| Jgz Operand Operand
deriving (Eq, Show)
data Machine = Machine
{ mOps :: Seq.Seq Op
, mPos :: Int
, mRegs :: Map.Map Char Int
, mLastPlayed :: Maybe Int
} deriving (Eq, Show)
newRegs :: Map.Map Char Int
newRegs = foldl' (\m r -> Map.insert r 0 m) Map.empty ['a'..'z']
newMachine :: [Op] -> Machine
newMachine ops = Machine { mOps = Seq.fromList ops, mPos = 0, mRegs = newRegs, mLastPlayed = Nothing }
runUntil :: (Machine -> Bool) -> Machine -> Machine
runUntil f = until (\m -> halted m || f m) step
halted :: Machine -> Bool
halted Machine { mPos = p, mOps = ops } = p >= Seq.length ops || p < 0
willRecover :: Machine -> Bool
willRecover m = case nextOp m of
(Rcv x) -> opVal m x /= 0
_ -> False
nextOp :: Machine -> Op
nextOp m = (mOps m) `Seq.index` (mPos m)
step :: Machine -> Machine
step m = apply m (nextOp m)
opVal :: Machine -> Operand -> Int
opVal _ (Const i) = i
opVal m (RegRef c) = regVal m c
regVal :: Machine -> Char -> Int
regVal m c = (mRegs m) Map.! c
setReg :: Machine -> Char -> Int -> Machine
setReg m c v = m { mRegs = Map.insert c v (mRegs m) }
incrPos :: Machine -> Machine
incrPos m = m { mPos = 1 + mPos m }
apply :: Machine -> Op -> Machine
apply m (Snd x) = incrPos $ m { mLastPlayed = Just (opVal m x) }
apply m (Set (RegRef r) x) = incrPos . setReg m r $ opVal m x
apply m (Add (RegRef r) x) = incrPos . setReg m r $ regVal m r + opVal m x
apply m (Mul (RegRef r) x) = incrPos . setReg m r $ regVal m r * opVal m x
apply m (Mod (RegRef r) x) = incrPos . setReg m r $ regVal m r `mod` opVal m x
apply m (Rcv _) = incrPos m -- receiving does not appear to change observable machine state
apply m (Jgz x y) = if opVal m x == 0 then incrPos m else m { mPos = opVal m y + mPos m }
apply _ op = error $ "invalid operation: " ++ show op
--- Part 2
data System = System
{ sM0 :: Machine
, sM1 :: Machine
, sChan0 :: Seq.Seq Int
, sChan1 :: Seq.Seq Int
, sSndCount0 :: Int
, sSndCount1 :: Int
}
newSystem :: [Op] -> System
newSystem ops = System
{ sM0 = newMachine ops
, sM1 = setReg (newMachine ops) 'p' 1
, sChan0 = Seq.empty -- the in channel for m0, out channel for m1
, sChan1 = Seq.empty -- scratch that, reverse it
, sSndCount0 = 0
, sSndCount1 = 0
}
step' :: Machine -> Seq.Seq Int -> (Machine, Maybe Int, Seq.Seq Int)
step' m inChan | halted m = (m, Nothing, inChan)
| otherwise = apply' m inChan (nextOp m)
apply' :: Machine -> Seq.Seq Int -> Op -> (Machine, Maybe Int, Seq.Seq Int)
apply' m inChan (Snd x) = (incrPos m, Just (opVal m x), inChan)
apply' m inChan (Rcv (RegRef r)) = case Seq.viewl inChan of
Seq.EmptyL -> (m, Nothing, inChan)
(h Seq.:< t) -> (incrPos (setReg m r h), Nothing, t)
apply' m inChan op = (apply m op, Nothing, inChan)
pushMaybe :: Seq.Seq a -> Maybe a -> Seq.Seq a
pushMaybe s Nothing = s
pushMaybe s (Just x) = s Seq.|> x
stepSys :: System -> System
stepSys s = let
(m0', sent0, chan0') = step' (sM0 s) (sChan0 s)
(m1', sent1, chan1') = step' (sM1 s) (sChan1 s)
in
System { sM0 = m0' `seq` m0'
, sM1 = m1' `seq` m1'
, sChan0 = pushMaybe chan0' sent1
, sChan1 = pushMaybe chan1' sent0
, sSndCount0 = if isJust sent0 then 1 + sSndCount0 s else sSndCount0 s
, sSndCount1 = if isJust sent0 then 1 + sSndCount1 s else sSndCount1 s
}
waiting :: Machine -> Seq.Seq Int -> Bool
waiting m inChan = case (nextOp m, Seq.length inChan) of
(Rcv _, 0) -> True
_ -> False
terminated :: System -> Bool
terminated s = let
waitingOrHalted m chan = waiting m chan || halted m
in
waitingOrHalted (sM0 s) (sChan0 s) &&
waitingOrHalted (sM1 s) (sChan1 s)
runSys :: System -> System
-- runSys !s = until (\s' -> haltedSys s' || deadlocked s') stepSys s
runSys !s | terminated s = s
| otherwise = let
s' = stepSys s
in
-- trace ("DEBUG: chan0 len =" ++ ((show . length . sChan0) s') ++ " chan1 len =" ++ ((show . length . sChan1) s')) $
runSys s'
|
wfleming/advent-of-code-2016
|
2017/D18/src/D18Lib.hs
|
bsd-3-clause
| 4,438
| 0
| 11
| 1,152
| 1,881
| 983
| 898
| 107
| 3
|
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Network.DNS.Transport (
Resolver(..)
, resolve
) where
import Control.Concurrent.Async (async, waitAnyCancel)
import Control.Exception as E
import qualified Data.ByteString.Char8 as BS
import qualified Data.List.NonEmpty as NE
import Network.Socket (AddrInfo(..), SockAddr(..), Family(AF_INET, AF_INET6), Socket, SocketType(Stream), close, socket, connect, defaultProtocol)
import System.IO.Error (annotateIOError)
import System.Timeout (timeout)
import Network.DNS.IO
import Network.DNS.Imports
import Network.DNS.Types.Internal
import Network.DNS.Types.Resolver
-- | Check response for a matching identifier and question. If we ever do
-- pipelined TCP, we'll need to handle out of order responses. See:
-- https://tools.ietf.org/html/rfc7766#section-7
--
checkResp :: Question -> Identifier -> DNSMessage -> Bool
checkResp q seqno = isNothing . checkRespM q seqno
-- When the response 'RCODE' is 'FormatErr', the server did not understand our
-- query packet, and so is not expected to return a matching question.
--
checkRespM :: Question -> Identifier -> DNSMessage -> Maybe DNSError
checkRespM q seqno resp
| identifier (header resp) /= seqno = Just SequenceNumberMismatch
| FormatErr <- rcode $ flags $ header resp
, [] <- question resp = Nothing
| [q] /= question resp = Just QuestionMismatch
| otherwise = Nothing
----------------------------------------------------------------
data TCPFallback = TCPFallback deriving (Show, Typeable)
instance Exception TCPFallback
type Rslv0 = QueryControls -> (Socket -> IO DNSMessage)
-> IO (Either DNSError DNSMessage)
type Rslv1 = Question
-> Int -- Timeout
-> Int -- Retry
-> Rslv0
type TcpRslv = AddrInfo
-> Question
-> Int -- Timeout
-> QueryControls
-> IO DNSMessage
type UdpRslv = Int -- Retry
-> (Socket -> IO DNSMessage)
-> TcpRslv
-- In lookup loop, we try UDP until we get a response. If the response
-- is truncated, we try TCP once, with no further UDP retries.
--
-- For now, we optimize for low latency high-availability caches
-- (e.g. running on a loopback interface), where TCP is cheap
-- enough. We could attempt to complete the TCP lookup within the
-- original time budget of the truncated UDP query, by wrapping both
-- within a a single 'timeout' thereby staying within the original
-- time budget, but it seems saner to give TCP a full opportunity to
-- return results. TCP latency after a truncated UDP reply will be
-- atypical.
--
-- Future improvements might also include support for TCP on the
-- initial query.
--
-- This function merges the query flag overrides from the resolver
-- configuration with any additional overrides from the caller.
--
resolve :: Domain -> TYPE -> Resolver -> Rslv0
resolve dom typ rlv qctls rcv
| isIllegal dom = return $ Left IllegalDomain
| typ == AXFR = return $ Left InvalidAXFRLookup
| onlyOne = resolveOne (head nss) (head gens) q tm retry ctls rcv
| concurrent = resolveConcurrent nss gens q tm retry ctls rcv
| otherwise = resolveSequential nss gens q tm retry ctls rcv
where
q = case BS.last dom of
'.' -> Question dom typ
_ -> Question (dom <> ".") typ
gens = NE.toList $ genIds rlv
seed = resolvseed rlv
nss = NE.toList $ nameservers seed
onlyOne = length nss == 1
ctls = qctls <> resolvQueryControls (resolvconf $ resolvseed rlv)
conf = resolvconf seed
concurrent = resolvConcurrent conf
tm = resolvTimeout conf
retry = resolvRetry conf
resolveSequential :: [AddrInfo] -> [IO Identifier] -> Rslv1
resolveSequential nss gs q tm retry ctls rcv = loop nss gs
where
loop [ai] [gen] = resolveOne ai gen q tm retry ctls rcv
loop (ai:ais) (gen:gens) = do
eres <- resolveOne ai gen q tm retry ctls rcv
case eres of
Left _ -> loop ais gens
res -> return res
loop _ _ = error "resolveSequential:loop"
resolveConcurrent :: [AddrInfo] -> [IO Identifier] -> Rslv1
resolveConcurrent nss gens q tm retry ctls rcv = do
asyncs <- mapM mkAsync $ zip nss gens
snd <$> waitAnyCancel asyncs
where
mkAsync (ai,gen) = async $ resolveOne ai gen q tm retry ctls rcv
resolveOne :: AddrInfo -> IO Identifier -> Rslv1
resolveOne ai gen q tm retry ctls rcv =
E.try $ udpTcpLookup gen retry rcv ai q tm ctls
----------------------------------------------------------------
-- UDP attempts must use the same ID and accept delayed answers
-- but we use a fresh ID for each TCP lookup.
--
udpTcpLookup :: IO Identifier -> UdpRslv
udpTcpLookup gen retry rcv ai q tm ctls = do
ident <- gen
udpLookup ident retry rcv ai q tm ctls `E.catch`
\TCPFallback -> tcpLookup gen ai q tm ctls
----------------------------------------------------------------
ioErrorToDNSError :: AddrInfo -> String -> IOError -> IO DNSMessage
ioErrorToDNSError ai protoName ioe = throwIO $ NetworkFailure aioe
where
loc = protoName ++ "@" ++ show (addrAddress ai)
aioe = annotateIOError ioe loc Nothing Nothing
----------------------------------------------------------------
udpOpen :: AddrInfo -> IO Socket
udpOpen ai = do
sock <- socket (addrFamily ai) (addrSocketType ai) (addrProtocol ai)
connect sock (addrAddress ai)
return sock
-- This throws DNSError or TCPFallback.
udpLookup :: Identifier -> UdpRslv
udpLookup ident retry rcv ai q tm ctls = do
let qry = encodeQuestion ident q ctls
E.handle (ioErrorToDNSError ai "udp") $
bracket (udpOpen ai) close (loop qry ctls 0 RetryLimitExceeded)
where
loop qry lctls cnt err sock
| cnt == retry = E.throwIO err
| otherwise = do
mres <- timeout tm (send sock qry >> getAns sock)
case mres of
Nothing -> loop qry lctls (cnt + 1) RetryLimitExceeded sock
Just res -> do
let fl = flags $ header res
tc = trunCation fl
rc = rcode fl
eh = ednsHeader res
cs = ednsEnabled FlagClear <> lctls
if tc then E.throwIO TCPFallback
else if rc == FormatErr && eh == NoEDNS && cs /= lctls
then let qry' = encodeQuestion ident q cs
in loop qry' cs cnt RetryLimitExceeded sock
else return res
-- | Closed UDP ports are occasionally re-used for a new query, with
-- the nameserver returning an unexpected answer to the wrong socket.
-- Such answers should be simply dropped, with the client continuing
-- to wait for the right answer, without resending the question.
-- Note, this eliminates sequence mismatch as a UDP error condition,
-- instead we'll time out if no matching answer arrives.
--
getAns sock = do
resp <- rcv sock
if checkResp q ident resp
then return resp
else getAns sock
----------------------------------------------------------------
-- Create a TCP socket with the given socket address.
tcpOpen :: SockAddr -> IO Socket
tcpOpen peer = case peer of
SockAddrInet{} -> socket AF_INET Stream defaultProtocol
SockAddrInet6{} -> socket AF_INET6 Stream defaultProtocol
_ -> E.throwIO ServerFailure
-- Perform a DNS query over TCP, if we were successful in creating
-- the TCP socket.
-- This throws DNSError only.
tcpLookup :: IO Identifier -> TcpRslv
tcpLookup gen ai q tm ctls =
E.handle (ioErrorToDNSError ai "tcp") $ do
res <- bracket (tcpOpen addr) close (perform ctls)
let rc = rcode $ flags $ header res
eh = ednsHeader res
cs = ednsEnabled FlagClear <> ctls
-- If we first tried with EDNS, retry without on FormatErr.
if rc == FormatErr && eh == NoEDNS && cs /= ctls
then bracket (tcpOpen addr) close (perform cs)
else return res
where
addr = addrAddress ai
perform cs vc = do
ident <- gen
let qry = encodeQuestion ident q cs
mres <- timeout tm $ do
connect vc addr
sendVC vc qry
receiveVC vc
case mres of
Nothing -> E.throwIO TimeoutExpired
Just res -> maybe (return res) E.throwIO (checkRespM q ident res)
----------------------------------------------------------------
badLength :: Domain -> Bool
badLength dom
| BS.null dom = True
| BS.last dom == '.' = BS.length dom > 254
| otherwise = BS.length dom > 253
isIllegal :: Domain -> Bool
isIllegal dom
| badLength dom = True
| '.' `BS.notElem` dom = True
| ':' `BS.elem` dom = True
| '/' `BS.elem` dom = True
| any (\x -> BS.length x > 63)
(BS.split '.' dom) = True
| otherwise = False
|
kazu-yamamoto/dns
|
Network/DNS/Transport.hs
|
bsd-3-clause
| 9,134
| 0
| 21
| 2,507
| 2,290
| 1,160
| 1,130
| 158
| 5
|
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import THilbert
--import Test.HUnit
--import Test.QuickCheck
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2
main :: IO ()
main = defaultMain hilbertTests
hilbertTests :: [Test]
hilbertTests = [
testGroup "Type / Instance / Utility"
[
testProperty "Bool / Num Bijective (small)" prop_boolNumBijectiveSmall
, testProperty "Bool / Num Bijective (large)" prop_boolNumBijectiveLarge
, testCase "Number to Bool list" test_NumToBool
, testCase "Bool list to Number" test_BoolToNum
, testCase "convertPointToHypercube (A)" test_ConvertPointToHypercubeA
, testCase "convertPointToHypercube (B)" test_ConvertPointToHypercubeB
, testCase "convertInteger (A)" test_ConvertIntegerA
, testCase "convertInteger (B)" test_ConvertIntegerB
, testProperty "Convert Integer yields equal pieces" prop_ConvertIntegerEqualPieces
, testProperty "RotateL-RotateR bijective" prop_rotationsBijective
, testCase "RotateL (A)" test_RotateLmodnA
, testCase "RotateL (B)" test_RotateLmodnB
, testCase "RotateL (C)" test_RotateLmodnC
, testCase "RotateL (D)" test_RotateLmodnD
, testCase "RotateR (A)" test_RotateRmodnA
, testCase "RotateR (B)" test_RotateRmodnB
, testProperty "Precision represents" prop_precisionRepresents
, testCase "Precision (A)" test_PrecisionRequiredA
, testCase "Precision (B)" test_PrecisionRequiredB
, testCase "Precision (C)" test_PrecisionRequiredC
, testCase "mkPrecisionNum" test_MkPrecisionNum
, testCase "Num instance" test_Num
, testCase "shiftRALarge" test_ShiftRALarge
, testCase "ShiftRASmall" test_ShiftRASmall
, testCase "ShiftRAPrecision" test_ShiftRAPrecision
, testCase "ShiftLASmall" test_ShiftLASmall
, testCase "ShiftLAPrecision" test_ShiftLAPrecision
],
testGroup "Utility Functions"
[
testProperty "Successor bit determined by trailingSetBits" prop_SuccessorBitByTrailingBits
, testProperty "trailingSetBits is Symmetric" prop_trailingSetBitsSymmetric
, testProperty "entryPointExitPoint is Symmetric" prop_entryPointExitPointSymmetric
, testProperty "Direction symmetric" prop_directionSymmetric
, testProperty "Relationship between entry, direction, exit" prop_entryDirectionExit
, testProperty "Direction When i=0 is 0" prop_directionWhenIZero
, testProperty "Direction is same if one dimension higher" prop_directionOneHigherDimension
, testProperty "Transform function bijective" prop_transformBijective
, testCase "EntryPoint (A)" test_EntryPointA
, testCase "EntryPoint (B)" test_EntryPointB
, testCase "EntryPoint (C)" test_EntryPointC
, testCase "EntryPoint (D)" test_EntryPointD
, testCase "ExitPoint (A)" test_ExitPointA
, testCase "ExitPoint (B)" test_ExitPointB
, testCase "ExitPoint (C)" test_ExitPointC
, testCase "ExitPoint (D)" test_ExitPointD
, testCase "transform (A)" test_TransformA
, testCase "transform (B)" test_TransformB
, testCase "transform (C)" test_TransformC
, testCase "transform (D)" test_TransformD
, testCase "inverseTransform (A)" test_InverseTransformA
, testCase "inverseTransform (B)" test_InverseTransformB
, testCase "inverseTransform (C)" test_InverseTransformC
, testCase "inverseTransform (D)" test_InverseTransformD
, testCase "inverseTransform (E)" test_InverseTransformE
, testCase "text_Exp" test_Exp
, testCase "test_Direction (A)" test_DirectionA
, testCase "test_Direction (B)" test_DirectionB
],
testGroup "Gray code tests"
[
testProperty "Gray code is bijective" prop_graycodeBijective
, testCase "Graycode (A) test" test_GrayCodeA
, testCase "Graycode (B) test" test_GrayCodeB
, testCase "Graycode (C) test" test_GrayCodeC
, testCase "Graycode (D) test" test_GrayCodeD
, testProperty "grayCodeSymmetric" prop_grayCodeSymmetric
, testProperty "grayCodeSymmetricLarge" prop_grayCodeSymmetricLarge
, testProperty "Gray code maintains precision" prop_grayCodeMaintainsPrecision
, testCase "iGrayCode1" test_iGrayCode1
, testCase "iGrayCode2" test_iGrayCode2
, testCase "iGrayCode3" test_iGrayCode3
],
testGroup "Hilbert tests"
[
testProperty "Order 32, Dimension 32 Hilbert Transform / Untransform" prop_hilbertBijectiveO32D32
, testProperty "Hilbert Transform bijective" prop_hilbertBijective
, testProperty "Hilbert Exhaustive over range" prop_hilbertExhaustive
, testCase "test_HilbertExhaustive" test_HilbertExhaustive
, testCase "test_SetTrailingBits" test_SetTrailingBits
, testCase "test_SetTrailingBits2" test_SetTrailingBits2
, testCase "test_SetTrailingBits3" test_SetTrailingBits3
, testCase "test_SetTrailingBits4" test_SetTrailingBits4
, testCase "test_SetTrailingBits5" test_SetTrailingBits5
, testCase "test_TransformRef1" test_TransformRef1
, testCase "test_TransformRef2" test_TransformRef2
, testCase "test_TransformRef3" test_TransformRef3
, testCase "test_WRef1" test_WRef1
, testCase "test_WRef2" test_WRef2
, testCase "test_WRef3" test_WRef3
, testCase "test_ERef1" test_ERef1
, testCase "test_ERef2" test_ERef2
, testCase "test_ERef3" test_ERef3
, testCase "test_DRef1" test_DRef1
, testCase "test_DRef2" test_DRef2
, testCase "test_DRef3" test_DRef3
, testCase "test_HilbertIndex" test_HilbertIndex
, testCase "test_Stage1overall" test_Stage1overall
, testCase "test_Stage1overallPrecision" test_Stage1overallPrecision
, testCase "test_Stage1ShiftL" test_Stage1ShiftL
, testCase "test_Stage1t" test_Stage1t
, testCase "test_Stage1tPrecision" test_Stage1tPrecision
, testCase "test_Stage1w" test_Stage1w
, testCase "test_Stage1wPrecision" test_Stage1wPrecision
, testCase "test_Stage1e'" test_Stage1e'
, testCase "test_Stage1e'Precision" test_Stage1e'Precision
, testCase "test_Stage1d'" test_Stage1d'
, testCase "test_Stage1d'Precision" test_Stage1d'Precision
, testCase "test_Stage2overall" test_Stage2overall
, testCase "test_Stage2t" test_Stage2t
, testCase "test_Stage2w" test_Stage2w
, testCase "test_Stage2e'" test_Stage2e'
, testCase "test_stage2d'" test_Stage2d'
, testCase "test_Stage3overall" test_Stage3overall
, testCase "test_Stage3transform" test_Stage3transform
, testCase "test_Stage3transformDim" test_Stage3transformDim
, testCase "test_Stage3transformXor" test_Stage3transformXor
, testCase "test_Stage3transformRotateR" test_Stage3transformRotateR
, testCase "test_Stage3w" test_Stage3w
, testCase "test_Stage3e'" test_Stage3e'
, testCase "test_Stage3d'" test_Stage3d'
, testCase "test_HilbertIndex2" test_HilbertIndex2
, testCase "test_HilbertIndex3" test_HilbertIndex3
, testCase "test_HilbertIndex4" test_HilbertIndex4
, testCase "test_HilbertIndexInverse" test_HilbertIndexInverse
, testCase "test_HilbertIndexInverse'" test_HilbertIndexInverse'
, testCase "test_HilbertIndexInverseGrayCode" test_HilbertIndexInverseGrayCode
, testCase "test_HilbertIndexInverseTransform" test_HilbertIndexInverseInverseTransform
, testCase "test_HilbertIndexInverseNewE" test_HilbertIndexInverseNewE
, testCase "test_HilbertIndexInverseNewD" test_HilbertIndexInverseNewD
, testCase "test_HilbertIndexInverseB" test_HilbertIndexInverseB
, testCase "test_HilbertIndexInverse'B" test_HilbertIndexInverse'B
, testCase "test_HilbertIndexInverseC" test_HilbertIndexInverseC
, testCase "test_HilbertIndexInverse'C" test_HilbertIndexInverse'C
, testCase "test_HilbertIndexInverse'C1a" test_HilbertIndexInverse'C1a
, testCase "test_HilbertIndexInverse'C1aInvTransform" test_HilbertIndexInverse'C1aInvTransform
, testCase "test_HilbertIndexInverse'C1b" test_HilbertIndexInverse'C1b
, testCase "test_HilbertIndexInverse'C2a" test_HilbertIndexInverse'C2a
, testCase "test_HilbertIndexInverse'C2newD" test_HilbertIndexInverse'C2newD
, testCase "test_HilbertIndexInverse'C3a" test_HilbertIndexInverse'C3a
, testCase "test_HilbertIndexInverse'C3b" test_HilbertIndexInverse'C3b
]
]
|
cje/hilbert
|
test/TMain.hs
|
bsd-3-clause
| 10,518
| 0
| 8
| 3,528
| 1,148
| 582
| 566
| 150
| 1
|
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE UnicodeSyntax #-}
{-|
[@ISO639-1@] id
[@ISO639-2@] ind
[@ISO639-3@] ind
[@Native name@] Bahasa Indonesia
[@English name@] Indonesian
-}
module Text.Numeral.Language.IND.TestData (cardinals) where
--------------------------------------------------------------------------------
-- Imports
--------------------------------------------------------------------------------
import "base" Prelude ( Num )
import "numerals" Text.Numeral.Grammar.Reified ( defaultInflection )
import "this" Text.Numeral.Test ( TestData )
--------------------------------------------------------------------------------
-- Test data
--------------------------------------------------------------------------------
{-
Sources:
http://www.languagesandnumbers.com/how-to-count-in-indonesian/en/ind/
-}
cardinals ∷ (Num i) ⇒ TestData i
cardinals =
[ ( "default"
, defaultInflection
, [ (0, "kosong")
, (1, "satu")
, (2, "dua")
, (3, "tiga")
, (4, "empat")
, (5, "lima")
, (6, "enam")
, (7, "tujuh")
, (8, "delapan")
, (9, "sembilan")
, (10, "sepuluh")
, (11, "sebelas")
, (12, "dua belas")
, (13, "tiga belas")
, (14, "empat belas")
, (15, "lima belas")
, (16, "enam belas")
, (17, "tujuh belas")
, (18, "delapan belas")
, (19, "sembilan belas")
, (20, "dua puluh")
, (21, "dua puluh satu")
, (22, "dua puluh dua")
, (23, "dua puluh tiga")
, (24, "dua puluh empat")
, (25, "dua puluh lima")
, (26, "dua puluh enam")
, (27, "dua puluh tujuh")
, (28, "dua puluh delapan")
, (29, "dua puluh sembilan")
, (30, "tiga puluh")
, (31, "tiga puluh satu")
, (32, "tiga puluh dua")
, (33, "tiga puluh tiga")
, (34, "tiga puluh empat")
, (35, "tiga puluh lima")
, (36, "tiga puluh enam")
, (37, "tiga puluh tujuh")
, (38, "tiga puluh delapan")
, (39, "tiga puluh sembilan")
, (40, "empat puluh")
, (41, "empat puluh satu")
, (42, "empat puluh dua")
, (43, "empat puluh tiga")
, (44, "empat puluh empat")
, (45, "empat puluh lima")
, (46, "empat puluh enam")
, (47, "empat puluh tujuh")
, (48, "empat puluh delapan")
, (49, "empat puluh sembilan")
, (50, "lima puluh")
, (51, "lima puluh satu")
, (52, "lima puluh dua")
, (53, "lima puluh tiga")
, (54, "lima puluh empat")
, (55, "lima puluh lima")
, (56, "lima puluh enam")
, (57, "lima puluh tujuh")
, (58, "lima puluh delapan")
, (59, "lima puluh sembilan")
, (60, "enam puluh")
, (61, "enam puluh satu")
, (62, "enam puluh dua")
, (63, "enam puluh tiga")
, (64, "enam puluh empat")
, (65, "enam puluh lima")
, (66, "enam puluh enam")
, (67, "enam puluh tujuh")
, (68, "enam puluh delapan")
, (69, "enam puluh sembilan")
, (70, "tujuh puluh")
, (71, "tujuh puluh satu")
, (72, "tujuh puluh dua")
, (73, "tujuh puluh tiga")
, (74, "tujuh puluh empat")
, (75, "tujuh puluh lima")
, (76, "tujuh puluh enam")
, (77, "tujuh puluh tujuh")
, (78, "tujuh puluh delapan")
, (79, "tujuh puluh sembilan")
, (80, "delapan puluh")
, (81, "delapan puluh satu")
, (82, "delapan puluh dua")
, (83, "delapan puluh tiga")
, (84, "delapan puluh empat")
, (85, "delapan puluh lima")
, (86, "delapan puluh enam")
, (87, "delapan puluh tujuh")
, (88, "delapan puluh delapan")
, (89, "delapan puluh sembilan")
, (90, "sembilan puluh")
, (91, "sembilan puluh satu")
, (92, "sembilan puluh dua")
, (93, "sembilan puluh tiga")
, (94, "sembilan puluh empat")
, (95, "sembilan puluh lima")
, (96, "sembilan puluh enam")
, (97, "sembilan puluh tujuh")
, (98, "sembilan puluh delapan")
, (99, "sembilan puluh sembilan")
, (100, "seratus")
, (101, "seratus satu")
, (102, "seratus dua")
, (103, "seratus tiga")
, (104, "seratus empat")
, (105, "seratus lima")
, (106, "seratus enam")
, (107, "seratus tujuh")
, (108, "seratus delapan")
, (109, "seratus sembilan")
, (110, "seratus sepuluh")
, (123, "seratus dua puluh tiga")
, (200, "dua ratus")
, (300, "tiga ratus")
, (321, "tiga ratus dua puluh satu")
, (400, "empat ratus")
, (500, "lima ratus")
, (600, "enam ratus")
, (700, "tujuh ratus")
, (800, "delapan ratus")
, (900, "sembilan ratus")
, (909, "sembilan ratus sembilan")
, (990, "sembilan ratus sembilan puluh")
, (999, "sembilan ratus sembilan puluh sembilan")
, (1000, "seribu")
, (1001, "seribu satu")
, (1008, "seribu delapan")
, (1234, "seribu dua ratus tiga puluh empat")
, (2000, "dua ribu")
, (3000, "tiga ribu")
, (4000, "empat ribu")
, (4321, "empat ribu tiga ratus dua puluh satu")
, (5000, "lima ribu")
, (6000, "enam ribu")
, (7000, "tujuh ribu")
, (8000, "delapan ribu")
, (9000, "sembilan ribu")
, (10000, "sepuluh ribu")
, (12345, "belas dua ribu tiga ratus empat puluh lima")
, (20000, "dua puluh ribu")
, (30000, "tiga puluh ribu")
, (40000, "empat puluh ribu")
, (50000, "lima puluh ribu")
, (54321, "lima puluh empat ribu tiga ratus dua puluh satu")
, (60000, "enam puluh ribu")
, (70000, "tujuh puluh ribu")
, (80000, "delapan puluh ribu")
, (90000, "sembilan puluh ribu")
, (100000, "seratus ribu")
, (123456, "seratus dua puluh tiga ribu empat ratus lima puluh enam")
, (200000, "dua ratus ribu")
, (300000, "tiga ratus ribu")
, (400000, "empat ratus ribu")
, (500000, "lima ratus ribu")
, (600000, "enam ratus ribu")
, (654321, "enam ratus lima puluh empat ribu tiga ratus dua puluh satu")
, (700000, "tujuh ratus ribu")
, (800000, "delapan ratus ribu")
, (900000, "sembilan ratus ribu")
, (1000000, "sejuta")
, (1000001, "sejuta satu")
, (1234567, "sejuta dua ratus tiga puluh empat ribu lima ratus enam puluh tujuh")
, (2000000, "dua juta")
, (3000000, "tiga juta")
, (4000000, "empat juta")
, (5000000, "lima juta")
, (6000000, "enam juta")
, (7000000, "tujuh juta")
, (7654321, "tujuh juta enam ratus lima puluh empat ribu tiga ratus dua puluh satu")
, (8000000, "delapan juta")
, (9000000, "sembilan juta")
, (1000000000, "milyar")
, (1000000001, "milyar satu")
, (2000000000, "dua milyar")
, (3000000000, "tiga milyar")
, (4000000000, "empat milyar")
, (5000000000, "lima milyar")
, (6000000000, "enam milyar")
, (7000000000, "tujuh milyar")
, (8000000000, "delapan milyar")
, (9000000000, "sembilan milyar")
, (1000000000000, "seribu milyar")
, (1000000000001, "seribu milyar satu")
, (2000000000000, "dua seribu milyar")
, (3000000000000, "tiga seribu milyar")
, (4000000000000, "empat seribu milyar")
, (5000000000000, "lima seribu milyar")
, (6000000000000, "enam seribu milyar")
, (7000000000000, "tujuh seribu milyar")
, (8000000000000, "delapan seribu milyar")
, (9000000000000, "sembilan seribu milyar")
]
)
]
|
telser/numerals
|
src-test/Text/Numeral/Language/IND/TestData.hs
|
bsd-3-clause
| 7,667
| 0
| 8
| 2,211
| 1,813
| 1,211
| 602
| 203
| 1
|
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.AmountOfMoney.MN.Tests
( tests ) where
import Data.String
import Prelude
import Test.Tasty
import Duckling.AmountOfMoney.MN.Corpus
import Duckling.Dimensions.Types
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "MN Tests"
[ makeCorpusTest [Seal AmountOfMoney] corpus
]
|
facebookincubator/duckling
|
tests/Duckling/AmountOfMoney/MN/Tests.hs
|
bsd-3-clause
| 522
| 0
| 9
| 78
| 79
| 50
| 29
| 11
| 1
|
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Stack.Setup
( setupEnv
, ensureGHC
, SetupOpts (..)
) where
import Control.Applicative
import Control.Exception.Enclosed (catchIO)
import Control.Monad (liftM, when, join, void)
import Control.Monad.Catch
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Logger
import Control.Monad.Reader (MonadReader, ReaderT (..), asks)
import Control.Monad.State (get, put, modify)
import Control.Monad.Trans.Control
import Data.Aeson.Extended
import qualified Data.ByteString as S
import qualified Data.ByteString.Char8 as S8
import Data.Conduit (Conduit, ($$), (=$), await, yield, awaitForever)
import Data.Conduit.Lift (evalStateC)
import qualified Data.Conduit.List as CL
import Data.Either
import Data.IORef
import Data.List (intercalate)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (mapMaybe, catMaybes, fromMaybe)
import Data.Monoid
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.Encoding.Error as T
import Data.Time.Clock (NominalDiffTime, diffUTCTime, getCurrentTime)
import Data.Typeable (Typeable)
import qualified Data.Yaml as Yaml
import Distribution.System (OS (..), Arch (..), Platform (..))
import Distribution.Text (simpleParse)
import Network.HTTP.Client.Conduit
import Network.HTTP.Download (verifiedDownload, DownloadRequest(..), drRetryPolicyDefault)
import Path
import Path.IO
import Prelude -- Fix AMP warning
import Safe (headMay, readMay)
import Stack.Build.Types
import Stack.Constants (distRelativeDir)
import Stack.GhcPkg (createDatabase, getCabalPkgVer, getGlobalDB)
import Stack.Solver (getGhcVersion)
import Stack.Types
import Stack.Types.StackT
import System.Environment (getExecutablePath)
import System.Exit (ExitCode (ExitSuccess))
import System.FilePath (searchPathSeparator)
import qualified System.FilePath as FP
import System.IO.Temp (withSystemTempDirectory)
import System.Process (rawSystem)
import System.Process.Read
import Text.Printf (printf)
data SetupOpts = SetupOpts
{ soptsInstallIfMissing :: !Bool
, soptsUseSystem :: !Bool
, soptsExpected :: !Version
, soptsStackYaml :: !(Maybe (Path Abs File))
-- ^ If we got the desired GHC version from that file
, soptsForceReinstall :: !Bool
, soptsSanityCheck :: !Bool
-- ^ Run a sanity check on the selected GHC
, soptsSkipGhcCheck :: !Bool
-- ^ Don't check for a compatible GHC version/architecture
, soptsSkipMsys :: !Bool
-- ^ Do not use a custom msys installation on Windows
}
deriving Show
data SetupException = UnsupportedSetupCombo OS Arch
| MissingDependencies [String]
| UnknownGHCVersion Text Version (Set MajorVersion)
| UnknownOSKey Text
| GHCSanityCheckCompileFailed ReadProcessException (Path Abs File)
deriving Typeable
instance Exception SetupException
instance Show SetupException where
show (UnsupportedSetupCombo os arch) = concat
[ "I don't know how to install GHC for "
, show (os, arch)
, ", please install manually"
]
show (MissingDependencies tools) =
"The following executables are missing and must be installed: " ++
intercalate ", " tools
show (UnknownGHCVersion oskey version known) = concat
[ "No information found for GHC version "
, versionString version
, ".\nSupported GHC major versions for OS key '" ++ T.unpack oskey ++ "': "
, intercalate ", " (map show $ Set.toList known)
]
show (UnknownOSKey oskey) =
"Unable to find installation URLs for OS key: " ++
T.unpack oskey
show (GHCSanityCheckCompileFailed e ghc) = concat
[ "The GHC located at "
, toFilePath ghc
, " failed to compile a sanity check. Please see:\n\n"
, " https://github.com/commercialhaskell/stack/wiki/Downloads\n\n"
, "for more information. Exception was:\n"
, show e
]
-- | Modify the environment variables (like PATH) appropriately, possibly doing installation too
setupEnv :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasBuildConfig env, HasHttpManager env, MonadBaseControl IO m)
=> m EnvConfig
setupEnv = do
bconfig <- asks getBuildConfig
let platform = getPlatform bconfig
sopts = SetupOpts
{ soptsInstallIfMissing = configInstallGHC $ bcConfig bconfig
, soptsUseSystem = configSystemGHC $ bcConfig bconfig
, soptsExpected = bcGhcVersionExpected bconfig
, soptsStackYaml = Just $ bcStackYaml bconfig
, soptsForceReinstall = False
, soptsSanityCheck = False
, soptsSkipGhcCheck = configSkipGHCCheck $ bcConfig bconfig
, soptsSkipMsys = configSkipMsys $ bcConfig bconfig
}
mghcBin <- ensureGHC sopts
menv0 <- getMinimalEnvOverride
-- Modify the initial environment to include the GHC path, if a local GHC
-- is being used
let env = removeHaskellEnvVars $ case mghcBin of
Nothing -> unEnvOverride menv0
Just ghcBin ->
let x = unEnvOverride menv0
mpath = Map.lookup "PATH" x
path = T.intercalate (T.singleton searchPathSeparator)
$ map (stripTrailingSlashT . T.pack) ghcBin
++ maybe [] return mpath
in Map.insert "PATH" path x
menv <- mkEnvOverride platform env
ghcVer <- getGhcVersion menv
cabalVer <- getCabalPkgVer menv
let envConfig0 = EnvConfig
{ envConfigBuildConfig = bconfig
, envConfigCabalVersion = cabalVer
, envConfigGhcVersion = ghcVer
}
-- extra installation bin directories
mkDirs <- runReaderT extraBinDirs envConfig0
let mpath = Map.lookup "PATH" env
mkDirs' = map toFilePath . mkDirs
depsPath = augmentPath (mkDirs' False) mpath
localsPath = augmentPath (mkDirs' True) mpath
deps <- runReaderT packageDatabaseDeps envConfig0
createDatabase menv deps
localdb <- runReaderT packageDatabaseLocal envConfig0
createDatabase menv localdb
globalDB <- getGlobalDB menv
let mkGPP locals = T.pack $ intercalate [searchPathSeparator] $ concat
[ [toFilePathNoTrailingSlash localdb | locals]
, [toFilePathNoTrailingSlash deps]
, [toFilePathNoTrailingSlash globalDB]
]
distDir <- runReaderT distRelativeDir envConfig0
executablePath <- liftIO getExecutablePath
envRef <- liftIO $ newIORef Map.empty
let getEnvOverride' es = do
m <- readIORef envRef
case Map.lookup es m of
Just eo -> return eo
Nothing -> do
eo <- mkEnvOverride platform
$ Map.insert "PATH" (if esIncludeLocals es then localsPath else depsPath)
$ (if esIncludeGhcPackagePath es
then Map.insert "GHC_PACKAGE_PATH" (mkGPP (esIncludeLocals es))
else id)
$ (if esStackExe es
then Map.insert "STACK_EXE" (T.pack executablePath)
else id)
-- For reasoning and duplication, see: https://github.com/fpco/stack/issues/70
$ Map.insert "HASKELL_PACKAGE_SANDBOX" (T.pack $ toFilePathNoTrailingSlash deps)
$ Map.insert "HASKELL_PACKAGE_SANDBOXES"
(T.pack $ if esIncludeLocals es
then intercalate [searchPathSeparator]
[ toFilePathNoTrailingSlash localdb
, toFilePathNoTrailingSlash deps
, ""
]
else intercalate [searchPathSeparator]
[ toFilePathNoTrailingSlash deps
, ""
])
$ Map.insert "HASKELL_DIST_DIR" (T.pack $ toFilePathNoTrailingSlash distDir)
$ env
!() <- atomicModifyIORef envRef $ \m' ->
(Map.insert es eo m', ())
return eo
return EnvConfig
{ envConfigBuildConfig = bconfig
{ bcConfig = (bcConfig bconfig) { configEnvOverride = getEnvOverride' }
}
, envConfigCabalVersion = cabalVer
, envConfigGhcVersion = ghcVer
}
-- | Augment the PATH environment variable with the given extra paths
augmentPath :: [FilePath] -> Maybe Text -> Text
augmentPath dirs mpath =
T.pack $ intercalate [searchPathSeparator]
(map stripTrailingSlashS dirs ++ maybe [] (return . T.unpack) mpath)
where
stripTrailingSlashS = T.unpack . stripTrailingSlashT . T.pack
stripTrailingSlashT :: Text -> Text
stripTrailingSlashT t = fromMaybe t $ T.stripSuffix
(T.singleton FP.pathSeparator)
t
-- | Ensure GHC is installed and provide the PATHs to add if necessary
ensureGHC :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> SetupOpts
-> m (Maybe [FilePath])
ensureGHC sopts = do
when (getMajorVersion expected < MajorVersion 7 8) $ do
$logWarn "stack will almost certainly fail with GHC below version 7.8"
$logWarn "Valiantly attempting to run anyway, but I know this is doomed"
$logWarn "For more information, see: https://github.com/commercialhaskell/stack/issues/648"
$logWarn ""
-- Check the available GHCs
menv0 <- getMinimalEnvOverride
msystem <-
if soptsUseSystem sopts
then getSystemGHC menv0
else return Nothing
Platform expectedArch _ <- asks getPlatform
let needLocal = case msystem of
Nothing -> True
Just _ | soptsSkipGhcCheck sopts -> False
Just (system, arch) ->
-- we allow a newer version of GHC within the same major series
getMajorVersion system /= getMajorVersion expected ||
expected > system ||
arch /= expectedArch
-- If we need to install a GHC, try to do so
mpaths <- if needLocal
then do
config <- asks getConfig
let tools =
case configPlatform config of
Platform _ os | isWindows os ->
($(mkPackageName "ghc"), Just expected)
: (if soptsSkipMsys sopts
then []
else [($(mkPackageName "git"), Nothing)])
_ ->
[ ($(mkPackageName "ghc"), Just expected)
]
-- Avoid having to load it twice
siRef <- liftIO $ newIORef Nothing
manager <- asks getHttpManager
let getSetupInfo' = liftIO $ do
msi <- readIORef siRef
case msi of
Just si -> return si
Nothing -> do
si <- getSetupInfo manager
writeIORef siRef $ Just si
return si
installed <- runReaderT listInstalled config
idents <- mapM (ensureTool menv0 sopts installed getSetupInfo' msystem) tools
paths <- runReaderT (mapM binDirs $ catMaybes idents) config
return $ Just $ map toFilePathNoTrailingSlash $ concat paths
else return Nothing
when (soptsSanityCheck sopts) $ do
menv <-
case mpaths of
Nothing -> return menv0
Just paths -> do
config <- asks getConfig
let m0 = unEnvOverride menv0
path0 = Map.lookup "PATH" m0
path = augmentPath paths path0
m = Map.insert "PATH" path m0
mkEnvOverride (configPlatform config) (removeHaskellEnvVars m)
sanityCheck menv
return mpaths
where
expected = soptsExpected sopts
-- | Get the major version of the system GHC, if available
getSystemGHC :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> m (Maybe (Version, Arch))
getSystemGHC menv = do
exists <- doesExecutableExist menv "ghc"
if exists
then do
eres <- tryProcessStdout Nothing menv "ghc" ["--info"]
return $ do
Right bs <- Just eres
pairs <- readMay $ S8.unpack bs :: Maybe [(String, String)]
version <- lookup "Project version" pairs >>= parseVersionFromString
arch <- lookup "Target platform" pairs >>= simpleParse . takeWhile (/= '-')
Just (version, arch)
else return Nothing
data DownloadPair = DownloadPair Version Text
deriving Show
instance FromJSON DownloadPair where
parseJSON = withObject "DownloadPair" $ \o -> DownloadPair
<$> o .: "version"
<*> o .: "url"
data SetupInfo = SetupInfo
{ siSevenzExe :: Text
, siSevenzDll :: Text
, siPortableGit :: DownloadPair
, siGHCs :: Map Text (Map MajorVersion DownloadPair)
}
deriving Show
instance FromJSON SetupInfo where
parseJSON = withObject "SetupInfo" $ \o -> SetupInfo
<$> o .: "sevenzexe"
<*> o .: "sevenzdll"
<*> o .: "portable-git"
<*> o .: "ghc"
-- | Download the most recent SetupInfo
getSetupInfo :: (MonadIO m, MonadThrow m) => Manager -> m SetupInfo
getSetupInfo manager = do
bss <- liftIO $ flip runReaderT manager
$ withResponse req $ \res -> responseBody res $$ CL.consume
let bs = S8.concat bss
either throwM return $ Yaml.decodeEither' bs
where
req = "https://raw.githubusercontent.com/fpco/stackage-content/master/stack/stack-setup.yaml"
markInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m)
=> PackageIdentifier -- ^ e.g., ghc-7.8.4, git-2.4.0.1
-> m ()
markInstalled ident = do
dir <- asks $ configLocalPrograms . getConfig
fpRel <- parseRelFile $ packageIdentifierString ident ++ ".installed"
liftIO $ writeFile (toFilePath $ dir </> fpRel) "installed"
unmarkInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m)
=> PackageIdentifier
-> m ()
unmarkInstalled ident = do
dir <- asks $ configLocalPrograms . getConfig
fpRel <- parseRelFile $ packageIdentifierString ident ++ ".installed"
removeFileIfExists $ dir </> fpRel
listInstalled :: (MonadIO m, MonadReader env m, HasConfig env, MonadThrow m)
=> m [PackageIdentifier]
listInstalled = do
dir <- asks $ configLocalPrograms . getConfig
createTree dir
(_, files) <- listDirectory dir
return $ mapMaybe toIdent files
where
toIdent fp = do
x <- T.stripSuffix ".installed" $ T.pack $ toFilePath $ filename fp
parsePackageIdentifierFromString $ T.unpack x
installDir :: (MonadReader env m, HasConfig env, MonadThrow m, MonadLogger m)
=> PackageIdentifier
-> m (Path Abs Dir)
installDir ident = do
config <- asks getConfig
reldir <- parseRelDir $ packageIdentifierString ident
return $ configLocalPrograms config </> reldir
-- | Binary directories for the given installed package
binDirs :: (MonadReader env m, HasConfig env, MonadThrow m, MonadLogger m)
=> PackageIdentifier
-> m [Path Abs Dir]
binDirs ident = do
config <- asks getConfig
dir <- installDir ident
case (configPlatform config, packageNameString $ packageIdentifierName ident) of
(Platform _ (isWindows -> True), "ghc") -> return
[ dir </> $(mkRelDir "bin")
, dir </> $(mkRelDir "mingw") </> $(mkRelDir "bin")
]
(Platform _ (isWindows -> True), "git") -> return
[ dir </> $(mkRelDir "cmd")
, dir </> $(mkRelDir "usr") </> $(mkRelDir "bin")
]
(_, "ghc") -> return
[ dir </> $(mkRelDir "bin")
]
(Platform _ x, tool) -> do
$logWarn $ "binDirs: unexpected OS/tool combo: " <> T.pack (show (x, tool))
return []
ensureTool :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> EnvOverride
-> SetupOpts
-> [PackageIdentifier] -- ^ already installed
-> m SetupInfo
-> Maybe (Version, Arch) -- ^ installed GHC
-> (PackageName, Maybe Version)
-> m (Maybe PackageIdentifier)
ensureTool menv sopts installed getSetupInfo' msystem (name, mversion)
| not $ null available = return $ Just $ PackageIdentifier name $ maximum available
| not $ soptsInstallIfMissing sopts =
if name == $(mkPackageName "ghc")
then do
Platform arch _ <- asks getPlatform
throwM $ GHCVersionMismatch msystem (soptsExpected sopts, arch) (soptsStackYaml sopts)
else do
$logWarn $ "Continuing despite missing tool: " <> T.pack (packageNameString name)
return Nothing
| otherwise = do
si <- getSetupInfo'
(pair@(DownloadPair version _), installer) <-
case packageNameString name of
"git" -> do
let pair = siPortableGit si
return (pair, installGitWindows)
"ghc" -> do
osKey <- getOSKey menv
pairs <-
case Map.lookup osKey $ siGHCs si of
Nothing -> throwM $ UnknownOSKey osKey
Just pairs -> return pairs
version <-
case mversion of
Nothing -> error "invariant violated: ghc must have a version"
Just version -> return version
pair <-
case Map.lookup (getMajorVersion version) pairs of
Nothing -> throwM $ UnknownGHCVersion osKey version (Map.keysSet pairs)
Just pair -> return pair
platform <- asks $ configPlatform . getConfig
let installer =
case platform of
Platform _ os | isWindows os -> installGHCWindows
_ -> installGHCPosix
return (pair, installer)
x -> error $ "Invariant violated: ensureTool on " ++ x
let ident = PackageIdentifier name version
(file, at) <- downloadPair pair ident
dir <- installDir ident
unmarkInstalled ident
installer si file at dir ident
markInstalled ident
return $ Just ident
where
available
| soptsForceReinstall sopts = []
| otherwise = filter goodVersion
$ map packageIdentifierVersion
$ filter (\pi' -> packageIdentifierName pi' == name) installed
goodVersion =
case mversion of
Nothing -> const True
Just expected -> \actual ->
getMajorVersion expected == getMajorVersion actual &&
actual >= expected
getOSKey :: (MonadReader env m, MonadThrow m, HasConfig env, MonadLogger m, MonadIO m, MonadCatch m, MonadBaseControl IO m)
=> EnvOverride -> m Text
getOSKey menv = do
platform <- asks $ configPlatform . getConfig
case platform of
Platform I386 Linux -> ("linux32" <>) <$> getLinuxSuffix
Platform X86_64 Linux -> ("linux64" <>) <$> getLinuxSuffix
Platform I386 OSX -> return "macosx"
Platform X86_64 OSX -> return "macosx"
Platform I386 FreeBSD -> return "freebsd32"
Platform X86_64 FreeBSD -> return "freebsd64"
Platform I386 OpenBSD -> return "openbsd32"
Platform X86_64 OpenBSD -> return "openbsd64"
Platform I386 Windows -> return "windows32"
Platform X86_64 Windows -> return "windows64"
Platform I386 (OtherOS "windowsintegersimple") -> return "windowsintegersimple32"
Platform X86_64 (OtherOS "windowsintegersimple") -> return "windowsintegersimple64"
Platform arch os -> throwM $ UnsupportedSetupCombo os arch
where
getLinuxSuffix = do
executablePath <- liftIO getExecutablePath
elddOut <- tryProcessStdout Nothing menv "ldd" [executablePath]
return $ case elddOut of
Left _ -> ""
Right lddOut -> if hasLineWithFirstWord "libgmp.so.3" lddOut then "-gmp4" else ""
hasLineWithFirstWord w =
elem (Just w) . map (headMay . T.words) . T.lines . T.decodeUtf8With T.lenientDecode
downloadPair :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> DownloadPair
-> PackageIdentifier
-> m (Path Abs File, ArchiveType)
downloadPair (DownloadPair _ url) ident = do
config <- asks getConfig
at <-
case extension of
".tar.xz" -> return TarXz
".tar.bz2" -> return TarBz2
".7z.exe" -> return SevenZ
_ -> error $ "Unknown extension: " ++ extension
relfile <- parseRelFile $ packageIdentifierString ident ++ extension
let path = configLocalPrograms config </> relfile
chattyDownload (packageIdentifierText ident) url path
return (path, at)
where
extension =
loop $ T.unpack url
where
loop fp
| ext `elem` [".tar", ".bz2", ".xz", ".exe", ".7z"] = loop fp' ++ ext
| otherwise = ""
where
(fp', ext) = FP.splitExtension fp
data ArchiveType
= TarBz2
| TarXz
| SevenZ
installGHCPosix :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> SetupInfo
-> Path Abs File
-> ArchiveType
-> Path Abs Dir
-> PackageIdentifier
-> m ()
installGHCPosix _ archiveFile archiveType destDir ident = do
platform <- asks getPlatform
menv0 <- getMinimalEnvOverride
menv <- mkEnvOverride platform (removeHaskellEnvVars (unEnvOverride menv0))
$logInfo $ "menv = " <> T.pack (show (unEnvOverride menv))
zipTool' <-
case archiveType of
TarXz -> return "xz"
TarBz2 -> return "bzip2"
SevenZ -> error "Don't know how to deal with .7z files on non-Windows"
(zipTool, makeTool, tarTool) <- checkDependencies $ (,,)
<$> checkDependency zipTool'
<*> (checkDependency "gmake" <|> checkDependency "make")
<*> checkDependency "tar"
$logDebug $ "ziptool: " <> T.pack zipTool
$logDebug $ "make: " <> T.pack makeTool
$logDebug $ "tar: " <> T.pack tarTool
withSystemTempDirectory "stack-setup" $ \root' -> do
root <- parseAbsDir root'
dir <- liftM (root Path.</>) $ parseRelDir $ packageIdentifierString ident
$logSticky $ "Unpacking GHC ..."
$logDebug $ "Unpacking " <> T.pack (toFilePath archiveFile)
readInNull root tarTool menv ["xf", toFilePath archiveFile] Nothing
$logSticky "Configuring GHC ..."
readInNull dir (toFilePath $ dir Path.</> $(mkRelFile "configure"))
menv ["--prefix=" ++ toFilePath destDir] Nothing
$logSticky "Installing GHC ..."
readInNull dir makeTool menv ["install"] Nothing
$logStickyDone $ "Installed GHC."
$logDebug $ "GHC installed to " <> T.pack (toFilePath destDir)
where
-- | Check if given processes appear to be present, throwing an exception if
-- missing.
checkDependencies :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env)
=> CheckDependency a -> m a
checkDependencies (CheckDependency f) = do
menv <- getMinimalEnvOverride
liftIO (f menv) >>= either (throwM . MissingDependencies) return
checkDependency :: String -> CheckDependency String
checkDependency tool = CheckDependency $ \menv -> do
exists <- doesExecutableExist menv tool
return $ if exists then Right tool else Left [tool]
newtype CheckDependency a = CheckDependency (EnvOverride -> IO (Either [String] a))
deriving Functor
instance Applicative CheckDependency where
pure x = CheckDependency $ \_ -> return (Right x)
CheckDependency f <*> CheckDependency x = CheckDependency $ \menv -> do
f' <- f menv
x' <- x menv
return $
case (f', x') of
(Left e1, Left e2) -> Left $ e1 ++ e2
(Left e, Right _) -> Left e
(Right _, Left e) -> Left e
(Right f'', Right x'') -> Right $ f'' x''
instance Alternative CheckDependency where
empty = CheckDependency $ \_ -> return $ Left []
CheckDependency x <|> CheckDependency y = CheckDependency $ \menv -> do
res1 <- x menv
case res1 of
Left _ -> y menv
Right x' -> return $ Right x'
installGHCWindows :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> SetupInfo
-> Path Abs File
-> ArchiveType
-> Path Abs Dir
-> PackageIdentifier
-> m ()
installGHCWindows si archiveFile archiveType destDir _ = do
suffix <-
case archiveType of
TarXz -> return ".xz"
TarBz2 -> return ".bz2"
_ -> error $ "GHC on Windows must be a tarball file"
tarFile <-
case T.stripSuffix suffix $ T.pack $ toFilePath archiveFile of
Nothing -> error $ "Invalid GHC filename: " ++ show archiveFile
Just x -> parseAbsFile $ T.unpack x
config <- asks getConfig
run7z <- setup7z si config
run7z (parent archiveFile) archiveFile
run7z (parent archiveFile) tarFile
removeFile tarFile `catchIO` \e ->
$logWarn (T.concat
[ "Exception when removing "
, T.pack $ toFilePath tarFile
, ": "
, T.pack $ show e
])
$logInfo $ "GHC installed to " <> T.pack (toFilePath destDir)
installGitWindows :: (MonadIO m, MonadMask m, MonadLogger m, MonadReader env m, HasConfig env, HasHttpManager env, MonadBaseControl IO m)
=> SetupInfo
-> Path Abs File
-> ArchiveType
-> Path Abs Dir
-> PackageIdentifier
-> m ()
installGitWindows si archiveFile archiveType destDir _ = do
case archiveType of
SevenZ -> return ()
_ -> error $ "Git on Windows must be a 7z archive"
config <- asks getConfig
run7z <- setup7z si config
run7z destDir archiveFile
-- | Download 7z as necessary, and get a function for unpacking things.
--
-- Returned function takes an unpack directory and archive.
setup7z :: (MonadReader env m, HasHttpManager env, MonadThrow m, MonadIO m, MonadIO n, MonadLogger m, MonadBaseControl IO m)
=> SetupInfo
-> Config
-> m (Path Abs Dir -> Path Abs File -> n ())
setup7z si config = do
chattyDownload "7z.dll" (siSevenzDll si) dll
chattyDownload "7z.exe" (siSevenzExe si) exe
return $ \outdir archive -> liftIO $ do
ec <- rawSystem (toFilePath exe)
[ "x"
, "-o" ++ toFilePath outdir
, "-y"
, toFilePath archive
]
when (ec /= ExitSuccess)
$ error $ "Problem while decompressing " ++ toFilePath archive
where
dir = configLocalPrograms config </> $(mkRelDir "7z")
exe = dir </> $(mkRelFile "7z.exe")
dll = dir </> $(mkRelFile "7z.dll")
chattyDownload :: (MonadReader env m, HasHttpManager env, MonadIO m, MonadLogger m, MonadThrow m, MonadBaseControl IO m)
=> Text
-> Text -- ^ URL
-> Path Abs File -- ^ destination
-> m ()
chattyDownload label url path = do
req <- parseUrl $ T.unpack url
$logSticky $ T.concat
[ "Preparing to download "
, label
, " ..."
]
$logDebug $ T.concat
[ "Downloading from "
, url
, " to "
, T.pack $ toFilePath path
, " ..."
]
let dReq = DownloadRequest
{ drRequest = req
, drHashChecks = []
, drLengthCheck = Nothing
, drRetryPolicy = drRetryPolicyDefault
}
runInBase <- liftBaseWith $ \run -> return (void . run)
x <- verifiedDownload dReq path (chattyDownloadProgress runInBase)
if x
then $logStickyDone ("Downloaded " <> label <> ".")
else $logStickyDone "Already downloaded."
where
chattyDownloadProgress runInBase mcontentLength = do
_ <- liftIO $ runInBase $ $logSticky $
label <> ": download has begun"
CL.map (Sum . S.length)
=$ chunksOverTime 1
=$ go
where
go = evalStateC 0 $ awaitForever $ \(Sum size) -> do
modify (+ size)
totalSoFar <- get
liftIO $ runInBase $ $logSticky $ T.pack $
case mcontentLength of
Nothing -> chattyProgressNoTotal totalSoFar
Just 0 -> chattyProgressNoTotal totalSoFar
Just total -> chattyProgressWithTotal totalSoFar total
-- Example: ghc: 42.13 KiB downloaded...
chattyProgressNoTotal totalSoFar =
printf ("%s: " <> bytesfmt "%7.2f" totalSoFar <> " downloaded...")
(T.unpack label)
-- Example: ghc: 50.00 MiB / 100.00 MiB (50.00%) downloaded...
chattyProgressWithTotal totalSoFar total =
printf ("%s: " <>
bytesfmt "%7.2f" totalSoFar <> " / " <>
bytesfmt "%.2f" total <>
" (%6.2f%%) downloaded...")
(T.unpack label)
percentage
where percentage :: Double
percentage = (fromIntegral totalSoFar / fromIntegral total * 100)
-- | Given a printf format string for the decimal part and a number of
-- bytes, formats the bytes using an appropiate unit and returns the
-- formatted string.
--
-- >>> bytesfmt "%.2" 512368
-- "500.359375 KiB"
bytesfmt :: Integral a => String -> a -> String
bytesfmt formatter bs = printf (formatter <> " %s")
(fromIntegral (signum bs) * dec :: Double)
(bytesSuffixes !! i)
where
(dec,i) = getSuffix (abs bs)
getSuffix n = until p (\(x,y) -> (x / 1024, y+1)) (fromIntegral n,0)
where p (n',numDivs) = n' < 1024 || numDivs == (length bytesSuffixes - 1)
bytesSuffixes :: [String]
bytesSuffixes = ["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]
-- Await eagerly (collect with monoidal append),
-- but space out yields by at least the given amount of time.
-- The final yield may come sooner, and may be a superfluous mempty.
-- Note that Integer and Float literals can be turned into NominalDiffTime
-- (these literals are interpreted as "seconds")
chunksOverTime :: (Monoid a, MonadIO m) => NominalDiffTime -> Conduit a m a
chunksOverTime diff = do
currentTime <- liftIO getCurrentTime
evalStateC (currentTime, mempty) go
where
-- State is a tuple of:
-- * the last time a yield happened (or the beginning of the sink)
-- * the accumulated awaits since the last yield
go = await >>= \case
Nothing -> do
(_, acc) <- get
yield acc
Just a -> do
(lastTime, acc) <- get
let acc' = acc <> a
currentTime <- liftIO getCurrentTime
if diff < diffUTCTime currentTime lastTime
then put (currentTime, mempty) >> yield acc'
else put (lastTime, acc')
go
-- | Perform a basic sanity check of GHC
sanityCheck :: (MonadIO m, MonadMask m, MonadLogger m, MonadBaseControl IO m)
=> EnvOverride
-> m ()
sanityCheck menv = withSystemTempDirectory "stack-sanity-check" $ \dir -> do
dir' <- parseAbsDir dir
let fp = toFilePath $ dir' </> $(mkRelFile "Main.hs")
liftIO $ writeFile fp $ unlines
[ "import Distribution.Simple" -- ensure Cabal library is present
, "main = putStrLn \"Hello World\""
]
ghc <- join $ findExecutable menv "ghc"
$logDebug $ "Performing a sanity check on: " <> T.pack (toFilePath ghc)
eres <- tryProcessStdout (Just dir') menv "ghc"
[ fp
, "-no-user-package-db"
]
case eres of
Left e -> throwM $ GHCSanityCheckCompileFailed e ghc
Right _ -> return () -- TODO check that the output of running the command is correct
toFilePathNoTrailingSlash :: Path loc Dir -> FilePath
toFilePathNoTrailingSlash = FP.dropTrailingPathSeparator . toFilePath
-- Remove potentially confusing environment variables
removeHaskellEnvVars :: Map Text Text -> Map Text Text
removeHaskellEnvVars =
Map.delete "GHC_PACKAGE_PATH" .
Map.delete "HASKELL_PACKAGE_SANDBOX" .
Map.delete "HASKELL_PACKAGE_SANDBOXES" .
Map.delete "HASKELL_DIST_DIR"
|
chreekat/stack
|
src/Stack/Setup.hs
|
bsd-3-clause
| 34,542
| 0
| 30
| 11,174
| 8,650
| 4,302
| 4,348
| 709
| 15
|
import Control.StartStop.Core
import Control.StartStop.Lib
import Control.StartStop.Gloss
import Graphics.Gloss
import Buttons
count :: EvStream t x -> Hold t (Behavior t Int)
count e = foldEs' (\v _ -> v + 1) e 0
main :: IO ()
main = runGlossHoldIO (InWindow "FRP-Zoo" (500,500) (10, 10)) white 10 $ \time events -> liftHold $ do
let click0 = filterEs (==Click) $ filterMapEs filter0 events
click5 = filterEs (==Click) $ filterMapEs filter5 events
click10 = filterEs (==Click) $ filterMapEs filter10 events
toggle0 = filterEs (==Toggle) $ filterMapEs filter0 events
toggle5 = filterEs (==Toggle) $ filterMapEs filter5 events
toggle10 = filterEs (==Toggle) $ filterMapEs filter10 events
mode0 <- toggle toggle0 True
mode5 <- toggle toggle5 True
mode10 <- toggle toggle10 True
count0 <- foldEs (\v f -> f v) (leftmost (const 0 <$ toggle0) ((+1) <$ gate mode0 click0)) 0
count5 <- count $ gate mode5 click5
count10 <- count click10
{- senario 0 -}
let toggleDyn0 False = return $ return 0
toggleDyn0 True = count click0
dToggle0 = startOnFire $ toggleDyn0 <$> changes mode0
dCount0 <- switcher count0 dToggle0
let picture = renderButtons <$> count0 <*> fmap Just dCount0 <*> count5 <*> pure Nothing <*> count10 <*> pure Nothing
return picture
|
tylerwx51/StartStopFRP
|
frpzoo.hs
|
bsd-3-clause
| 1,318
| 0
| 18
| 277
| 504
| 250
| 254
| 27
| 2
|
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE CPP #-}
module Generics.Deriving.Base (
#if __GLASGOW_HASKELL__ < 701
-- * Generic representation types
V1, U1(..), Par1(..), Rec1(..), K1(..), M1(..)
, (:+:)(..), (:*:)(..), (:.:)(..)
-- ** Synonyms for convenience
, Rec0, Par0, R, P
, D1, C1, S1, D, C, S
-- * Meta-information
, Datatype(..), Constructor(..), Selector(..), NoSelector
, Fixity(..), Associativity(..), Arity(..), prec
-- * Generic type classes
, Generic(..), Generic1(..)
,
#else
module GHC.Generics,
#endif
) where
#if __GLASGOW_HASKELL__ >= 701
import GHC.Generics
#else
--------------------------------------------------------------------------------
-- Representation types
--------------------------------------------------------------------------------
-- | Void: used for datatypes without constructors
data V1 p
-- | Unit: used for constructors without arguments
data U1 p = U1
-- | Used for marking occurrences of the parameter
newtype Par1 p = Par1 { unPar1 :: p }
-- | Recursive calls of kind * -> *
newtype Rec1 f p = Rec1 { unRec1 :: f p }
-- | Constants, additional parameters and recursion of kind *
newtype K1 i c p = K1 { unK1 :: c }
-- | Meta-information (constructor names, etc.)
newtype M1 i c f p = M1 { unM1 :: f p }
-- | Sums: encode choice between constructors
infixr 5 :+:
data (:+:) f g p = L1 { unL1 :: f p } | R1 { unR1 :: g p }
-- | Products: encode multiple arguments to constructors
infixr 6 :*:
data (:*:) f g p = f p :*: g p
-- | Composition of functors
infixr 7 :.:
newtype (:.:) f g p = Comp1 { unComp1 :: f (g p) }
-- | Tag for K1: recursion (of kind *)
data R
-- | Tag for K1: parameters (other than the last)
data P
-- | Type synonym for encoding recursion (of kind *)
type Rec0 = K1 R
-- | Type synonym for encoding parameters (other than the last)
type Par0 = K1 P
-- | Tag for M1: datatype
data D
-- | Tag for M1: constructor
data C
-- | Tag for M1: record selector
data S
-- | Type synonym for encoding meta-information for datatypes
type D1 = M1 D
-- | Type synonym for encoding meta-information for constructors
type C1 = M1 C
-- | Type synonym for encoding meta-information for record selectors
type S1 = M1 S
-- | Class for datatypes that represent datatypes
class Datatype d where
-- | The name of the datatype, fully qualified
datatypeName :: t d (f :: * -> *) a -> String
moduleName :: t d (f :: * -> *) a -> String
-- | Class for datatypes that represent records
class Selector s where
-- | The name of the selector
selName :: t s (f :: * -> *) a -> String
-- | Used for constructor fields without a name
data NoSelector
instance Selector NoSelector where selName _ = ""
-- | Class for datatypes that represent data constructors
class Constructor c where
-- | The name of the constructor
conName :: t c (f :: * -> *) a -> String
-- | The fixity of the constructor
conFixity :: t c (f :: * -> *) a -> Fixity
conFixity = const Prefix
-- | Marks if this constructor is a record
conIsRecord :: t c (f :: * -> *) a -> Bool
conIsRecord = const False
-- | Datatype to represent the arity of a tuple.
data Arity = NoArity | Arity Int
deriving (Eq, Show, Ord, Read)
-- | Datatype to represent the fixity of a constructor. An infix
-- | declaration directly corresponds to an application of 'Infix'.
data Fixity = Prefix | Infix Associativity Int
deriving (Eq, Show, Ord, Read)
-- | Get the precedence of a fixity value.
prec :: Fixity -> Int
prec Prefix = 10
prec (Infix _ n) = n
-- | Datatype to represent the associativy of a constructor
data Associativity = LeftAssociative
| RightAssociative
| NotAssociative
deriving (Eq, Show, Ord, Read)
-- | Representable types of kind *
class Generic a where
type Rep a :: * -> *
-- | Convert from the datatype to its representation
from :: a -> Rep a x
-- | Convert from the representation to the datatype
to :: Rep a x -> a
-- | Representable types of kind * -> *
class Generic1 f where
type Rep1 f :: * -> *
-- | Convert from the datatype to its representation
from1 :: f a -> Rep1 f a
-- | Convert from the representation to the datatype
to1 :: Rep1 f a -> f a
#endif
|
ekmett/generic-deriving
|
src/Generics/Deriving/Base.hs
|
bsd-3-clause
| 4,584
| 0
| 5
| 1,140
| 189
| 139
| 50
| -1
| -1
|
-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.AmountOfMoney.EN.NZ.Corpus
( allExamples
, negativeExamples
) where
import Data.String
import Data.Text (Text)
import Prelude
import Duckling.AmountOfMoney.Types
import Duckling.Testing.Types
allExamples :: [Example]
allExamples = concat
[ examples (simple NZD 1000)
[ "a grand"
, "1 grand"
]
, examples (simple NZD 10000)
[ "10 grand"
, "two hundred thousand nickels"
]
, examples (simple NZD 1)
[ "four quarters"
, "ten dimes"
, "twenty nickels"
]
, examples (simple NZD 0.1)
[ "dime"
, "a dime"
, "two nickels"
]
, examples (simple NZD 0.25)
[ "quarter"
, "a quarter"
, "five nickels"
]
, examples (simple NZD 0.05)
[ "nickel"
, "a nickel"
]
]
negativeExamples :: [Text]
negativeExamples =
[ "grand"
]
|
facebookincubator/duckling
|
Duckling/AmountOfMoney/EN/NZ/Corpus.hs
|
bsd-3-clause
| 1,264
| 0
| 9
| 456
| 226
| 134
| 92
| 35
| 1
|
module Ling.Type where
import Ling.Abs
type Typ = Term
|
np/ling
|
Ling/Type.hs
|
bsd-3-clause
| 67
| 0
| 4
| 21
| 17
| 11
| 6
| 3
| 0
|
module Main where
import ABS
(x:n:base:i:next:nn:obj:f:max_val:log_val:the_end) = [0..]
main_ :: Method
main_ [] this wb k =
Assign n (Val (I 4000)) $
Assign base (Val (I 2)) $
Assign max_val (Val (I 11)) $
Assign x (Sync logarithm [n,base,max_val]) $
k
logarithm :: Method
logarithm [pn, pb, pmax] this wb k =
Assign i (Val (I 0)) $
Assign next (Val (I pb)) $
Assign log_val (Val (I 0)) $
While (ILTE (Attr i) (I pmax)) (\k' ->
If (IGTE (Attr next) (I pn))
(\k' -> Assign log_val (Val (Attr i)) k')
(\k' -> k') $
Assign i (Val (Add (Attr i) (I 1))) $
Assign next (Val (Prod (Attr next) (I pb))) $
k'
) $
Return i wb k
main':: IO ()
main'= run' 1000000 main_ (head the_end)
main:: IO ()
main= printHeap =<< run 1000000 main_ (head the_end)
|
abstools/abs-haskell-formal
|
benchmarks/1_integer_part_logarithm/progs/4000.hs
|
bsd-3-clause
| 801
| 0
| 20
| 203
| 500
| 253
| 247
| 28
| 1
|
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}
--
-- Generators for various distributions of particle positions
--
module Random.Position
where
import Common.Type
import System.Random.SFMT ( uniformR )
import Data.Array.Accelerate.System.Random.SFMT ( (:~>) )
import Data.Array.Accelerate.Array.Sugar as A
-- | Points distributed as a disc
--
disc :: Position -> R -> sh :~> Position
disc (originX, originY, originZ) radiusMax _ix gen
= do radius <- uniformR (0,radiusMax) gen
theta <- uniformR (0, pi) gen
phi <- uniformR (0, 2*pi) gen
return ( originX + radius * sin theta * cos phi
, originY + radius * sin theta * sin phi
, originZ + radius * cos theta )
-- | A point cloud with areas of high and low density
--
cloud :: Shape sh => (Int,Int) -> R -> sh :~> Position
cloud (fromIntegral -> sizeX, fromIntegral -> sizeY) radiusMax ix gen
= let
blob (sx,sy,sz) r
= disc (sx * sizeX, sy * sizeY, sz * (sizeX `min` sizeY))
(radiusMax * r)
in case A.size ix `mod` 5 of
0 -> blob ( 0.25, 0.25, 0.25) 1.00 ix gen
1 -> blob (-0.10, 0.10, 0.10) 0.60 ix gen
2 -> blob (-0.05, 0.30,-0.30) 0.35 ix gen
3 -> blob (-0.20,-0.12,-0.12) 0.45 ix gen
_ -> blob ( 0.15,-0.10, 0.20) 0.75 ix gen
|
vollmerm/shallow-fission
|
tests/n-body/src-acc/Random/Position.hs
|
bsd-3-clause
| 1,437
| 0
| 13
| 460
| 491
| 271
| 220
| 27
| 5
|
module Query2 where
import Frenetic.NetCore
main addr = do
let f (sw, n) = do
putStrLn ("Counter is: " ++ show n)
let pol = Any ==> [Forward AllPorts unmodified] <+>
(Switch 5 <&&> DlSrc (EthernetAddress 1)) ==> [CountPackets 0 1000 f]
controller addr pol
|
frenetic-lang/netcore-1.0
|
examples/Query2.hs
|
bsd-3-clause
| 284
| 0
| 16
| 73
| 117
| 57
| 60
| 8
| 1
|
module Main where
import MainW (mainW)
import Reflex.Dom (run)
main :: IO ()
main = run mainW
|
gspia/reflex-dom-htmlea
|
example1/app/Main.hs
|
bsd-3-clause
| 105
| 0
| 6
| 28
| 40
| 23
| 17
| 5
| 1
|
module DtdToHaskell.Instance
( mkInstance
) where
import Data.List (intersperse)
import DtdToHaskell.TypeDef
import Text.PrettyPrint.HughesPJ
-- | Convert typedef to appropriate instance declaration, either @XmlContent@,
-- @XmlAttributes@, or @XmlAttrType@.
mkInstance :: TypeDef -> Doc
-- no constructors - represents an element with empty content but attributes.
mkInstance (DataDef _ n fs []) =
let (_, frattr, topat, toattr) = attrpats fs
frretval = if null fs then ppHName n else frattr
topatval = if null fs then ppHName n else topat
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName n <> text "\" [] []" )
$$
text "instance XmlContent" <+> ppHName n <+> text "where" $$
nest 4 (
text "toContents" <+> topatval <+> text "=" $$
nest 4 (text "[CElem (Elem (N \"" <> ppXName n <> text "\")"
<+> toattr <+> text "[]) ()]")
$$
text "parseContents = do" $$
nest 4 ((if not $ null fs then
text "{ (Elem _ as []) <- element [\""
else
text "{ (Elem _ _ []) <- element [\"")
<> ppXName n <> text "\"]" $$
text "; return" <+> frretval $$
text "} `adjustErr` (\"in <" <> ppXName n
<> text ">, \"++)"
)
)
$$
mkInstanceAttrs Same n fs
-- single constructor, "real" (non-auxiliary) type
mkInstance (DataDef False n fs [(n0,sts)]) =
let vs = nameSupply sts
(frpat, frattr, topat, toattr) = attrpats fs
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName n <> text "\" [] []" )
$$
text "instance XmlContent" <+> ppHName n <+> text "where" $$
nest 4 (
text "toContents" <+> parens (mkCpat n0 topat vs) <+> text "=" $$
nest 4 (text "[CElem (Elem (N \"" <> ppXName n <> text "\")"
<+> toattr <+> parens (mkToElem sts vs)
<> text ") ()]")
$$
text "parseContents = do" $$
nest 4 (text "{ e@(Elem _"<+> frpat <+> text "_) <- element [\""
<> ppXName n <> text "\"]"
$$ text "; interior e $"
<+> (mkParseConstr frattr (n0,sts))
$$ text "} `adjustErr` (\"in <" <> ppXName n
<> text ">, \"++)")
)
$$
mkInstanceAttrs Extended n fs
-- single constructor, auxiliary type (i.e. no corresponding element tag)
-- cannot be attributes here?
mkInstance (DataDef True n [] [(n0,sts)]) =
let vs = nameSupply sts
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName n <> text "\" [] []" )
$$
text "instance XmlContent" <+> ppHName n <+> text "where" $$
nest 4 ( text "toContents" <+> parens (mkCpat n0 empty vs)
<+> text "="
$$ nest 4 (parens (mkToElem sts vs))
$$
text "parseContents =" <+> mkParseConstr empty (n0,sts)
)
-- multiple constructors (real)
mkInstance (DataDef False n fs cs) =
let _ = nameSupply cs
(frpat, frattr, topat, toattr) = attrpats fs
_ = if null fs then False else True
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName n <> text "\" [] []" )
$$
text "instance XmlContent" <+> ppHName n <+> text "where" $$
nest 4 ( vcat (map (mkToMult n topat toattr) cs)
$$ text "parseContents = do "
$$ nest 4 (text "{ e@(Elem _"<+> frpat <+> text "_) <- element [\""
<> ppXName n <> text "\"]"
$$ text "; interior e $ oneOf"
$$ nest 4 ( text "[" <+> mkParseConstr frattr (head cs)
$$ vcat (map (\c-> text "," <+> mkParseConstr frattr c)
(tail cs))
$$ text "] `adjustErr` (\"in <" <> ppXName n
<> text ">, \"++)"
)
$$ text "}"
)
)
$$
mkInstanceAttrs Extended n fs
-- multiple constructors (auxiliary)
mkInstance (DataDef True n fs cs) =
let _ = nameSupply cs
(_, frattr, _, _) = attrpats fs
mixattrs = if null fs then False else True
in
text "instance HTypeable" <+> ppHName n <+> text "where" $$
nest 4 ( text "toHType _ = Defined \"" <> ppXName n <> text "\" [] []" )
$$
text "instance XmlContent" <+> ppHName n <+> text "where" $$
nest 4 ( vcat (map (mkToAux mixattrs) cs)
$$ text "parseContents = oneOf"
$$ nest 4 ( text "[" <+> mkParseConstr frattr (head cs)
$$ vcat (map (\c-> text "," <+> mkParseConstr frattr c)
(tail cs))
$$ text "] `adjustErr` (\"in <" <> ppXName n
<> text ">, \"++)"
)
)
$$
mkInstanceAttrs Extended n fs
-- enumeration of attribute values
mkInstance (EnumDef n es) =
text "instance XmlAttrType" <+> ppHName n <+> text "where" $$
nest 4 ( text "fromAttrToTyp n (n',v)" $$
nest 4 (text "| n==n' = translate (attr2str v)" $$
text "| otherwise = Nothing") $$
nest 2 (text "where" <+> mkTranslate es)
$$
vcat (map mkToAttr es)
)
data SameName = Same | Extended
mkInstanceAttrs :: SameName -> Name -> AttrFields -> Doc
mkInstanceAttrs _ _ [] = empty
mkInstanceAttrs s n fs =
let ppName = case s of { Same-> ppHName; Extended-> ppAName; }
in
text "instance XmlAttributes" <+> ppName n <+> text "where" $$
nest 4 ( text "fromAttrs as =" $$
nest 4 ( ppName n $$
nest 2 (vcat ((text "{" <+> mkFrFld n (head fs)):
map (\x-> comma <+> mkFrFld n x) (tail fs)) $$
text "}"))
$$
text "toAttrs v = catMaybes " $$
nest 4 (vcat ((text "[" <+> mkToFld (head fs)):
map (\x-> comma <+> mkToFld x) (tail fs)) $$
text "]")
)
-- respectively (frpat,frattr,topat,toattr)
attrpats :: AttrFields -> (Doc,Doc,Doc,Doc)
attrpats fs =
if null fs then (text "[]", empty, empty, text "[]")
else (text "as", parens (text "fromAttrs as"), text "as", parens (text "toAttrs as"))
-- mkFrElem :: Name -> [StructType] -> [Doc] -> Doc -> Doc
-- mkFrElem n sts vs inner =
-- foldr (frElem n) inner (zip3 sts vs cvs)
-- where
-- cvs = let ns = nameSupply2 vs
-- in zip ns (text "c0": init ns)
-- frElem _ (st,v,(cvi,cvo)) inner =
-- parens (text "\\" <> parens (v<>comma<>cvi) <> text "->" $$
-- nest 2 inner) $$
-- parens (
-- case st of
-- (Maybe String) -> text "fromText" <+> cvo
-- (Maybe _) -> text "fromElem" <+> cvo
-- (List String) -> text "many fromText" <+> cvo
-- (List _) -> text "many fromElem" <+> cvo
-- (List1 s) -> text "definite fromElem"
-- <+> text "\"" <> text (show s)<> text "+\""
-- <+> text "\"" <> ppXName n <> text "\""
-- <+> cvo
-- (Tuple ss) -> text "definite fromElem"
-- <+> text "\"(" <> hcat (intersperse (text ",")
-- (map (text.show) ss))
-- <> text ")\""
-- <+> text "\"" <> ppXName n <> text "\""
-- <+> cvo
-- (OneOf _) -> text "definite fromElem"
-- <+> text "\"OneOf\""
-- <+> text "\"" <> ppXName n <> text "\""
-- <+> cvo
-- (String) -> text "definite fromText" <+> text "\"text\" \"" <>
-- ppXName n <> text "\"" <+> cvo
-- (Any) -> text "definite fromElem" <+> text "\"ANY\" \"" <>
-- ppXName n <> text "\"" <+> cvo
-- (Defined m) -> text "definite fromElem" <+>
-- text "\"<" <> ppXName m <> text ">\" \"" <>
-- ppXName m <> text "\"" <+> cvo
-- (Defaultable _ _) -> text "nyi_fromElem_Defaultable" <+> cvo
-- )
--
{-
mkParseContents :: Name -> [StructType] -> [Doc] -> Doc -> Doc
mkParseContents n sts vs inner =
foldr (frElem n) inner (zip3 sts vs cvs)
where
cvs = let ns = nameSupply2 vs
in zip ns (text "c0": init ns)
frElem n (st,v,(cvi,cvo)) inner =
parens (text "\\" <> parens (v<>comma<>cvi) <> text "->" $$
nest 2 inner) $$
parens (
)
-}
mkParseConstr :: Doc -> (Name, [StructType]) -> Doc
mkParseConstr frattr (c,sts) =
fsep (text "return" <+> parens (ppHName c <+> frattr)
: map mkParseContents sts)
mkParseContents :: StructType -> Doc
mkParseContents st =
let ap = text "`apply`" in
case st of
(Maybe String) -> ap <+> text "optional text"
(Maybe _) -> ap <+> text "optional parseContents"
(List String) -> ap <+> text "many text"
(List _) -> ap <+> text "many parseContents"
(List1 _) -> ap <+> text "parseContents"
(Tuple _) -> ap <+> text "parseContents"
(OneOf _) -> ap <+> text "parseContents"
(StringMixed) -> ap <+> text "text"
(String) -> ap <+> text "(text `onFail` return \"\")"
(Any) -> ap <+> text "parseContents"
(Defined _) -> ap <+> text "parseContents"
(Defaultable _ _) -> ap <+> text "nyi_fromElem_Defaultable"
--
mkToElem :: [StructType] -> [Doc] -> Doc
mkToElem [] [] = text "[]"
mkToElem sts vs =
fsep (intersperse (text "++") (zipWith toElem sts vs))
where
toElem st v =
case st of
(Maybe String) -> text "maybe [] toText" <+> v
(Maybe _) -> text "maybe [] toContents" <+> v
(List String) -> text "concatMap toText" <+> v
(List _) -> text "concatMap toContents" <+> v
(List1 _) -> text "toContents" <+> v
(Tuple _) -> text "toContents" <+> v
(OneOf _) -> text "toContents" <+> v
(StringMixed) -> text "toText" <+> v
(String) -> text "toText" <+> v
(Any) -> text "toContents" <+> v
(Defined _) -> text "toContents" <+> v
(Defaultable _ _) -> text "nyi_toElem_Defaultable" <+> v
-- mkRpat :: [Doc] -> Doc
-- mkRpat [v] = v
-- mkRpat vs = (parens . hcat . intersperse comma) vs
mkCpat :: Name -> Doc -> [Doc] -> Doc
mkCpat n i vs = ppHName n <+> i <+> fsep vs
nameSupply :: [b] -> [Doc]
nameSupply ss = take (length ss) (map char ['a'..'z']
++ map text [ a:n:[] | n <- ['0'..'9']
, a <- ['a'..'z'] ])
-- nameSupply2 ss = take (length ss) [ text ('c':v:[]) | v <- ['a'..]]
mkTranslate :: [Name] -> Doc
mkTranslate es =
vcat (map trans es) $$
text "translate _ = Nothing"
where
trans n = text "translate \"" <> ppXName n <> text "\" =" <+>
text "Just" <+> ppHName n
mkToAttr :: Name -> Doc
mkToAttr n = text "toAttrFrTyp n" <+> ppHName n <+> text "=" <+>
text "Just (n, str2attr" <+> doubleQuotes (ppXName n) <> text ")"
mkFrFld :: Name -> (Name,StructType) -> Doc
mkFrFld tag (n,st) =
ppHName n <+> text "=" <+>
( case st of
(Defaultable String s) -> text "defaultA fromAttrToStr" <+>
doubleQuotes (text s)
(Defaultable _ s) -> text "defaultA fromAttrToTyp" <+> text s
(Maybe String) -> text "possibleA fromAttrToStr"
(Maybe _) -> text "possibleA fromAttrToTyp"
String -> text "definiteA fromAttrToStr" <+>
doubleQuotes (ppXName tag)
_ -> text "definiteA fromAttrToTyp" <+>
doubleQuotes (ppXName tag)
) <+> doubleQuotes (ppXName n) <+> text "as"
mkToFld :: (Name,StructType) -> Doc
mkToFld (n,st) =
( case st of
(Defaultable String _) -> text "defaultToAttr toAttrFrStr"
(Defaultable _ _) -> text "defaultToAttr toAttrFrTyp"
(Maybe String) -> text "maybeToAttr toAttrFrStr"
(Maybe _) -> text "maybeToAttr toAttrFrTyp"
String -> text "toAttrFrStr"
_ -> text "toAttrFrTyp"
) <+> doubleQuotes (ppXName n) <+> parens (ppHName n <+> text "v")
-- mkFrAux :: Bool -> Doc -> [(Name,[StructType])] -> Doc
-- mkFrAux keeprest attrs cs = foldr frAux inner cs
-- where
-- inner = text "(Nothing, c0)"
-- rest = if keeprest then text "rest" else text "_"
-- frAux (n,sts) innr =
-- let vs = nameSupply sts in
-- nest 4 (text "case" <+> blah sts vs <+> text "of" $$
-- succpat sts vs <+> text "-> (Just" <+>
-- parens (mkCpat n attrs vs) <> text ", rest)"
-- $$
-- failpat sts <+> text "->" $$ nest 4 innr
-- )
-- blah [st] [_] =
-- blahblahblah st (text "c0")
-- blah sts vs =
-- let ns = nameSupply2 vs
-- cvs = zip ns (text "c0": init ns)
-- blahblah (st,v,(cvi,cvo)) innr =
-- parens (text "\\" <> parens (v<>comma<>cvi) <> text "->" $$
-- nest 2 innr) $$
-- blahblahblah st cvo
-- in
-- foldr blahblah (mkRpat (vs++[last ns])) (zip3 sts vs cvs)
-- blahblahblah st cvo = parens (
-- case st of
-- (Maybe String) -> text "fromText" <+> cvo
-- (Maybe _) -> text "fromElem" <+> cvo
-- (List String) -> text "many fromText" <+> cvo
-- (List _) -> text "many fromElem" <+> cvo
-- (List1 _) -> text "fromElem" <+> cvo
-- (Tuple _) -> text "fromElem" <+> cvo -- ??
-- (OneOf _) -> text "fromElem" <+> cvo
-- (String) -> text "fromText" <+> cvo
-- (Any) -> text "fromElem" <+> cvo
-- (Defined _) -> text "fromElem" <+> cvo
-- )
-- failpat sts =
-- let fp st =
-- case st of
-- (Maybe _) -> text "Nothing"
-- (List _) -> text "[]"
-- (List1 _) -> text "_"
-- (Tuple _) -> text "_"
-- (OneOf _) -> text "_"
-- (String) -> text "_"
-- (Any) -> text "_"
-- (Defined _) -> text "_"
-- in parens (hcat (intersperse comma (map fp sts++[text "_"])))
-- succpat sts vs =
-- let sp st v =
-- case st of
-- (Maybe _) -> v
-- (List _) -> v
-- (List1 _) -> text "Just" <+> v
-- (Tuple _) -> text "Just" <+> v
-- (OneOf _) -> text "Just" <+> v
-- (String) -> text "Just" <+> v
-- (Any) -> text "Just" <+> v
-- (Defined _) -> text "Just" <+> v
-- in parens (hcat (intersperse comma (zipWith sp sts vs++[rest])))
mkToAux :: Bool -> (Name,[StructType]) -> Doc
mkToAux mixattrs (n,sts) =
let vs = nameSupply sts
attrs = if mixattrs then text "as" else empty
in
text "toContents" <+> parens (mkCpat n attrs vs) <+> text "=" <+>
mkToElem sts vs
mkToMult :: Name -> Doc -> Doc -> (Name,[StructType]) -> Doc
mkToMult tag attrpat attrexp (n,sts) =
let vs = nameSupply sts
in
text "toContents" <+> parens (mkCpat n attrpat vs) <+> text "="
$$ nest 4 (text "[CElem (Elem (N \"" <> ppXName tag <> text "\")"<+> attrexp
<+> parens (mkToElem sts vs) <+> text ") ()]")
|
nevrenato/Hets_Fork
|
utils/DtdToHaskell-src/current/Instance.hs
|
gpl-2.0
| 17,030
| 0
| 28
| 6,873
| 3,633
| 1,814
| 1,819
| 217
| 12
|
{-# LANGUAGE OverloadedStrings #-}
module Haddock.Parser.UtilSpec (main, spec) where
import Test.Hspec
import Data.Either
import Data.Attoparsec.ByteString.Char8
import Haddock.Parser.Util
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "takeUntil" $ do
it "takes everything until a specified byte sequence" $ do
parseOnly (takeUntil "end") "someend" `shouldBe` Right "some"
it "requires the end sequence" $ do
parseOnly (takeUntil "end") "someen" `shouldSatisfy` isLeft
it "takes escaped bytes unconditionally" $ do
parseOnly (takeUntil "end") "some\\endend" `shouldBe` Right "some\\end"
|
jwiegley/ghc-release
|
utils/haddock/test/Haddock/Parser/UtilSpec.hs
|
gpl-3.0
| 683
| 0
| 16
| 157
| 173
| 89
| 84
| 17
| 1
|
{- Copyright 2013 Gabriel Gonzalez
This file is part of the Suns Search Engine
The Suns Search Engine is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or (at your
option) any later version.
The Suns Search Engine is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
the Suns Search Engine. If not, see <http://www.gnu.org/licenses/>.
-}
{-| Utilities to securely read in user passwords from standard input.
All the programs in the Suns suite do not accept any passwords as command
line arguments because process listings like @ps@ would leak passwords
passed this way.
To securely automate these programs, store the password a single line in a
file with appropriate permissions and feed the file to the program's
standard input like this:
> $ suns-server < password.txt
The only way to obtain a value of type 'Password' is to use the 'password'
function. This allows functions to demand an argument of type 'Password'
if they want to ensure that their argument safely originates from the
'password' function.
-}
module Password (Password, Password.getPassword, password) where
import Control.Monad (when)
import Control.Exception (throwIO)
import Control.Monad.Trans.Class (lift)
import Data.Text (Text, pack)
import System.Console.Haskeline (
getPassword, runInputT, defaultSettings, haveTerminalUI )
-- | User password
newtype Password = Password
{ getPassword :: Text
-- ^ Extract the password as 'Text'
}
{-| Retrieve a password from standard input, displaying a prompt if connected to
an interactive terminal
-}
password :: IO Password
password = runInputT defaultSettings $ do
interactive <- haveTerminalUI
when interactive $ lift $ putStrLn "Enter server password:"
mPassword <- System.Console.Haskeline.getPassword Nothing ""
case mPassword of
Nothing -> lift $ throwIO $
userError "Failed to read password due to premature end of input"
Just pwd -> return $ Password (pack pwd)
|
Gabriel439/suns-search
|
src/Password.hs
|
gpl-3.0
| 2,426
| 0
| 14
| 507
| 206
| 115
| 91
| 18
| 2
|
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-| Unittests for 'Ganeti.Types'.
-}
{-
Copyright (C) 2012, 2013 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-}
module Test.Ganeti.Types
( testTypes
, AllocPolicy(..)
, DiskTemplate(..)
, allDiskTemplates
, InstanceStatus(..)
, NonEmpty(..)
, Hypervisor(..)
, JobId(..)
, genReasonTrail
) where
import System.Time (ClockTime(..))
import Test.QuickCheck as QuickCheck hiding (Result)
import Test.HUnit
import qualified Text.JSON as J
import Test.Ganeti.TestHelper
import Test.Ganeti.TestCommon
import Ganeti.BasicTypes
import qualified Ganeti.Constants as C
import qualified Ganeti.ConstantUtils as ConstantUtils
import Ganeti.Types as Types
import Ganeti.JSON
{-# ANN module "HLint: ignore Use camelCase" #-}
-- * Arbitrary instance
instance Arbitrary ClockTime where
arbitrary = TOD <$> arbitrary <*> fmap (`mod` (10^(12::Int))) arbitrary
instance (Arbitrary a, Ord a, Num a, Show a) =>
Arbitrary (Types.Positive a) where
arbitrary = do
(QuickCheck.Positive i) <- arbitrary
Types.mkPositive i
instance (Arbitrary a, Ord a, Num a, Show a) =>
Arbitrary (Types.NonNegative a) where
arbitrary = do
(QuickCheck.NonNegative i) <- arbitrary
Types.mkNonNegative i
instance (Arbitrary a, Ord a, Num a, Show a) =>
Arbitrary (Types.Negative a) where
arbitrary = do
(QuickCheck.Positive i) <- arbitrary
Types.mkNegative $ negate i
instance (Arbitrary a) => Arbitrary (Types.NonEmpty a) where
arbitrary = do
QuickCheck.NonEmpty lst <- arbitrary
Types.mkNonEmpty lst
$(genArbitrary ''AllocPolicy)
-- | Valid disk templates (depending on configure options).
allDiskTemplates :: [DiskTemplate]
allDiskTemplates = [minBound..maxBound]::[DiskTemplate]
-- | Custom 'Arbitrary' instance for 'DiskTemplate', which needs to
-- handle the case of file storage being disabled at configure time.
instance Arbitrary DiskTemplate where
arbitrary = elements allDiskTemplates
$(genArbitrary ''InstanceStatus)
$(genArbitrary ''MigrationMode)
$(genArbitrary ''VerifyOptionalChecks)
$(genArbitrary ''DdmSimple)
$(genArbitrary ''DdmFull)
$(genArbitrary ''CVErrorCode)
$(genArbitrary ''Hypervisor)
$(genArbitrary ''TagKind)
$(genArbitrary ''OobCommand)
-- | Valid storage types.
allStorageTypes :: [StorageType]
allStorageTypes = [minBound..maxBound]::[StorageType]
-- | Custom 'Arbitrary' instance for 'StorageType', which needs to
-- handle the case of file storage being disabled at configure time.
instance Arbitrary StorageType where
arbitrary = elements allStorageTypes
$(genArbitrary ''EvacMode)
$(genArbitrary ''FileDriver)
$(genArbitrary ''InstCreateMode)
$(genArbitrary ''RebootType)
$(genArbitrary ''ExportMode)
$(genArbitrary ''IAllocatorTestDir)
$(genArbitrary ''IAllocatorMode)
$(genArbitrary ''NICMode)
$(genArbitrary ''JobStatus)
$(genArbitrary ''FinalizedJobStatus)
instance Arbitrary JobId where
arbitrary = do
(Positive i) <- arbitrary
makeJobId i
$(genArbitrary ''JobIdDep)
$(genArbitrary ''JobDependency)
$(genArbitrary ''OpSubmitPriority)
$(genArbitrary ''OpStatus)
$(genArbitrary ''ELogType)
-- | Generates one element of a reason trail
genReasonElem :: Gen ReasonElem
genReasonElem = (,,) <$> genFQDN <*> genFQDN <*> arbitrary
-- | Generates a reason trail
genReasonTrail :: Gen ReasonTrail
genReasonTrail = do
size <- choose (0, 10)
vectorOf size genReasonElem
-- * Properties
prop_AllocPolicy_serialisation :: AllocPolicy -> Property
prop_AllocPolicy_serialisation = testSerialisation
-- | Test 'AllocPolicy' ordering is as expected.
case_AllocPolicy_order :: Assertion
case_AllocPolicy_order =
assertEqual "sort order" [ Types.AllocPreferred
, Types.AllocLastResort
, Types.AllocUnallocable
] [minBound..maxBound]
prop_DiskTemplate_serialisation :: DiskTemplate -> Property
prop_DiskTemplate_serialisation = testSerialisation
prop_InstanceStatus_serialisation :: InstanceStatus -> Property
prop_InstanceStatus_serialisation = testSerialisation
-- | Tests building non-negative numbers.
prop_NonNeg_pass :: QuickCheck.NonNegative Int -> Property
prop_NonNeg_pass (QuickCheck.NonNegative i) =
case mkNonNegative i of
Bad msg -> failTest $ "Fail to build non-negative: " ++ msg
Ok nn -> fromNonNegative nn ==? i
-- | Tests building non-negative numbers.
prop_NonNeg_fail :: QuickCheck.Positive Int -> Property
prop_NonNeg_fail (QuickCheck.Positive i) =
case mkNonNegative (negate i)::Result (Types.NonNegative Int) of
Bad _ -> passTest
Ok nn -> failTest $ "Built non-negative number '" ++ show nn ++
"' from negative value " ++ show i
-- | Tests building positive numbers.
prop_Positive_pass :: QuickCheck.Positive Int -> Property
prop_Positive_pass (QuickCheck.Positive i) =
case mkPositive i of
Bad msg -> failTest $ "Fail to build positive: " ++ msg
Ok nn -> fromPositive nn ==? i
-- | Tests building positive numbers.
prop_Positive_fail :: QuickCheck.NonNegative Int -> Property
prop_Positive_fail (QuickCheck.NonNegative i) =
case mkPositive (negate i)::Result (Types.Positive Int) of
Bad _ -> passTest
Ok nn -> failTest $ "Built positive number '" ++ show nn ++
"' from negative or zero value " ++ show i
-- | Tests building negative numbers.
prop_Neg_pass :: QuickCheck.Positive Int -> Property
prop_Neg_pass (QuickCheck.Positive i) =
case mkNegative i' of
Bad msg -> failTest $ "Fail to build negative: " ++ msg
Ok nn -> fromNegative nn ==? i'
where i' = negate i
-- | Tests building negative numbers.
prop_Neg_fail :: QuickCheck.NonNegative Int -> Property
prop_Neg_fail (QuickCheck.NonNegative i) =
case mkNegative i::Result (Types.Negative Int) of
Bad _ -> passTest
Ok nn -> failTest $ "Built negative number '" ++ show nn ++
"' from non-negative value " ++ show i
-- | Tests building non-empty lists.
prop_NonEmpty_pass :: QuickCheck.NonEmptyList String -> Property
prop_NonEmpty_pass (QuickCheck.NonEmpty xs) =
case mkNonEmpty xs of
Bad msg -> failTest $ "Fail to build non-empty list: " ++ msg
Ok nn -> fromNonEmpty nn ==? xs
-- | Tests building positive numbers.
case_NonEmpty_fail :: Assertion
case_NonEmpty_fail =
assertEqual "building non-empty list from an empty list"
(Bad "Received empty value for non-empty list") (mkNonEmpty ([]::[Int]))
-- | Tests migration mode serialisation.
prop_MigrationMode_serialisation :: MigrationMode -> Property
prop_MigrationMode_serialisation = testSerialisation
-- | Tests verify optional checks serialisation.
prop_VerifyOptionalChecks_serialisation :: VerifyOptionalChecks -> Property
prop_VerifyOptionalChecks_serialisation = testSerialisation
-- | Tests 'DdmSimple' serialisation.
prop_DdmSimple_serialisation :: DdmSimple -> Property
prop_DdmSimple_serialisation = testSerialisation
-- | Tests 'DdmFull' serialisation.
prop_DdmFull_serialisation :: DdmFull -> Property
prop_DdmFull_serialisation = testSerialisation
-- | Tests 'CVErrorCode' serialisation.
prop_CVErrorCode_serialisation :: CVErrorCode -> Property
prop_CVErrorCode_serialisation = testSerialisation
-- | Tests equivalence with Python, based on Constants.hs code.
case_CVErrorCode_pyequiv :: Assertion
case_CVErrorCode_pyequiv = do
let all_py_codes = C.cvAllEcodesStrings
all_hs_codes = ConstantUtils.mkSet $
map Types.cVErrorCodeToRaw [minBound..maxBound]
assertEqual "for CVErrorCode equivalence" all_py_codes all_hs_codes
-- | Test 'Hypervisor' serialisation.
prop_Hypervisor_serialisation :: Hypervisor -> Property
prop_Hypervisor_serialisation = testSerialisation
-- | Test 'OobCommand' serialisation.
prop_OobCommand_serialisation :: OobCommand -> Property
prop_OobCommand_serialisation = testSerialisation
-- | Test 'StorageType' serialisation.
prop_StorageType_serialisation :: StorageType -> Property
prop_StorageType_serialisation = testSerialisation
-- | Test 'NodeEvacMode' serialisation.
prop_NodeEvacMode_serialisation :: EvacMode -> Property
prop_NodeEvacMode_serialisation = testSerialisation
-- | Test 'FileDriver' serialisation.
prop_FileDriver_serialisation :: FileDriver -> Property
prop_FileDriver_serialisation = testSerialisation
-- | Test 'InstCreate' serialisation.
prop_InstCreateMode_serialisation :: InstCreateMode -> Property
prop_InstCreateMode_serialisation = testSerialisation
-- | Test 'RebootType' serialisation.
prop_RebootType_serialisation :: RebootType -> Property
prop_RebootType_serialisation = testSerialisation
-- | Test 'ExportMode' serialisation.
prop_ExportMode_serialisation :: ExportMode -> Property
prop_ExportMode_serialisation = testSerialisation
-- | Test 'IAllocatorTestDir' serialisation.
prop_IAllocatorTestDir_serialisation :: IAllocatorTestDir -> Property
prop_IAllocatorTestDir_serialisation = testSerialisation
-- | Test 'IAllocatorMode' serialisation.
prop_IAllocatorMode_serialisation :: IAllocatorMode -> Property
prop_IAllocatorMode_serialisation = testSerialisation
-- | Tests equivalence with Python, based on Constants.hs code.
case_IAllocatorMode_pyequiv :: Assertion
case_IAllocatorMode_pyequiv = do
let all_py_codes = C.validIallocatorModes
all_hs_codes = ConstantUtils.mkSet $
map Types.iAllocatorModeToRaw [minBound..maxBound]
assertEqual "for IAllocatorMode equivalence" all_py_codes all_hs_codes
-- | Test 'NICMode' serialisation.
prop_NICMode_serialisation :: NICMode -> Property
prop_NICMode_serialisation = testSerialisation
-- | Test 'OpStatus' serialisation.
prop_OpStatus_serialization :: OpStatus -> Property
prop_OpStatus_serialization = testSerialisation
-- | Test 'JobStatus' serialisation.
prop_JobStatus_serialization :: JobStatus -> Property
prop_JobStatus_serialization = testSerialisation
-- | Test 'JobStatus' ordering is as expected.
case_JobStatus_order :: Assertion
case_JobStatus_order =
assertEqual "sort order" [ Types.JOB_STATUS_QUEUED
, Types.JOB_STATUS_WAITING
, Types.JOB_STATUS_CANCELING
, Types.JOB_STATUS_RUNNING
, Types.JOB_STATUS_CANCELED
, Types.JOB_STATUS_SUCCESS
, Types.JOB_STATUS_ERROR
] [minBound..maxBound]
-- | Tests equivalence with Python, based on Constants.hs code.
case_NICMode_pyequiv :: Assertion
case_NICMode_pyequiv = do
let all_py_codes = C.nicValidModes
all_hs_codes = ConstantUtils.mkSet $
map Types.nICModeToRaw [minBound..maxBound]
assertEqual "for NICMode equivalence" all_py_codes all_hs_codes
-- | Test 'FinalizedJobStatus' serialisation.
prop_FinalizedJobStatus_serialisation :: FinalizedJobStatus -> Property
prop_FinalizedJobStatus_serialisation = testSerialisation
-- | Tests equivalence with Python, based on Constants.hs code.
case_FinalizedJobStatus_pyequiv :: Assertion
case_FinalizedJobStatus_pyequiv = do
let all_py_codes = C.jobsFinalized
all_hs_codes = ConstantUtils.mkSet $
map Types.finalizedJobStatusToRaw [minBound..maxBound]
assertEqual "for FinalizedJobStatus equivalence" all_py_codes all_hs_codes
-- | Tests JobId serialisation (both from string and ints).
prop_JobId_serialisation :: JobId -> Property
prop_JobId_serialisation jid =
conjoin [ testSerialisation jid
, (J.readJSON . J.showJSON . show $ fromJobId jid) ==? J.Ok jid
, case (fromJVal . J.showJSON . negate $
fromJobId jid)::Result JobId of
Bad _ -> passTest
Ok jid' -> failTest $ "Parsed negative job id as id " ++
show (fromJobId jid')
]
-- | Tests that fractional job IDs are not accepted.
prop_JobId_fractional :: Property
prop_JobId_fractional =
forAll (arbitrary `suchThat`
(\d -> fromIntegral (truncate d::Int) /= d)) $ \d ->
case J.readJSON (J.showJSON (d::Double)) of
J.Error _ -> passTest
J.Ok jid -> failTest $ "Parsed fractional value " ++ show d ++
" as job id " ++ show (fromJobId jid)
-- | Tests that a job ID is not parseable from \"bad\" JSON values.
case_JobId_BadTypes :: Assertion
case_JobId_BadTypes = do
let helper jsval = case J.readJSON jsval of
J.Error _ -> return ()
J.Ok jid -> assertFailure $ "Parsed " ++ show jsval
++ " as job id " ++ show (fromJobId jid)
helper J.JSNull
helper (J.JSBool True)
helper (J.JSBool False)
helper (J.JSArray [])
-- | Test 'JobDependency' serialisation.
prop_JobDependency_serialisation :: JobDependency -> Property
prop_JobDependency_serialisation = testSerialisation
-- | Test 'OpSubmitPriority' serialisation.
prop_OpSubmitPriority_serialisation :: OpSubmitPriority -> Property
prop_OpSubmitPriority_serialisation = testSerialisation
-- | Tests string formatting for 'OpSubmitPriority'.
prop_OpSubmitPriority_string :: OpSubmitPriority -> Property
prop_OpSubmitPriority_string prio =
parseSubmitPriority (fmtSubmitPriority prio) ==? Just prio
-- | Test 'ELogType' serialisation.
prop_ELogType_serialisation :: ELogType -> Property
prop_ELogType_serialisation = testSerialisation
testSuite "Types"
[ 'prop_AllocPolicy_serialisation
, 'case_AllocPolicy_order
, 'prop_DiskTemplate_serialisation
, 'prop_InstanceStatus_serialisation
, 'prop_NonNeg_pass
, 'prop_NonNeg_fail
, 'prop_Positive_pass
, 'prop_Positive_fail
, 'prop_Neg_pass
, 'prop_Neg_fail
, 'prop_NonEmpty_pass
, 'case_NonEmpty_fail
, 'prop_MigrationMode_serialisation
, 'prop_VerifyOptionalChecks_serialisation
, 'prop_DdmSimple_serialisation
, 'prop_DdmFull_serialisation
, 'prop_CVErrorCode_serialisation
, 'case_CVErrorCode_pyequiv
, 'prop_Hypervisor_serialisation
, 'prop_OobCommand_serialisation
, 'prop_StorageType_serialisation
, 'prop_NodeEvacMode_serialisation
, 'prop_FileDriver_serialisation
, 'prop_InstCreateMode_serialisation
, 'prop_RebootType_serialisation
, 'prop_ExportMode_serialisation
, 'prop_IAllocatorTestDir_serialisation
, 'prop_IAllocatorMode_serialisation
, 'case_IAllocatorMode_pyequiv
, 'prop_NICMode_serialisation
, 'prop_OpStatus_serialization
, 'prop_JobStatus_serialization
, 'case_JobStatus_order
, 'case_NICMode_pyequiv
, 'prop_FinalizedJobStatus_serialisation
, 'case_FinalizedJobStatus_pyequiv
, 'prop_JobId_serialisation
, 'prop_JobId_fractional
, 'case_JobId_BadTypes
, 'prop_JobDependency_serialisation
, 'prop_OpSubmitPriority_serialisation
, 'prop_OpSubmitPriority_string
, 'prop_ELogType_serialisation
]
|
mbakke/ganeti
|
test/hs/Test/Ganeti/Types.hs
|
bsd-2-clause
| 16,007
| 0
| 16
| 2,735
| 2,872
| 1,527
| 1,345
| 295
| 2
|
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
module SDL.Input.Mouse
( -- * Relative Mouse Mode
LocationMode(..)
, setMouseLocationMode
, getMouseLocationMode
, setRelativeMouseMode --deprecated
, getRelativeMouseMode --deprecated
-- * Mouse and Touch Input
, MouseButton(..)
, MouseDevice(..)
-- * Mouse State
, getModalMouseLocation
, getMouseLocation --deprecated
, getAbsoluteMouseLocation
, getRelativeMouseLocation
, getMouseButtons
-- * Warping the Mouse
, WarpMouseOrigin
, warpMouse
-- * Cursor Visibility
, cursorVisible
-- * Cursor Shape
, Cursor
, activeCursor
, createCursor
, freeCursor
, createColorCursor
) where
import Control.Monad (void)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Data.Bits
import Data.Bool
import Data.Data (Data)
import Data.StateVar
import Data.Typeable
import Data.Word
import Foreign.C
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
import GHC.Generics (Generic)
import Linear
import Linear.Affine
import SDL.Exception
import SDL.Internal.Numbered
import SDL.Internal.Types (Window(Window))
import SDL.Video.Renderer (Surface(Surface))
import qualified Data.Vector.Storable as V
import qualified SDL.Raw.Enum as Raw
import qualified SDL.Raw.Event as Raw
import qualified SDL.Raw.Types as Raw
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
#endif
data LocationMode = AbsoluteLocation | RelativeLocation deriving Eq
-- | Sets the current relative mouse mode.
--
-- When relative mouse mode is enabled, cursor is hidden and mouse position
-- will not change. However, you will be delivered relative mouse position
-- change events.
setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
setMouseLocationMode mode =
Raw.setRelativeMouseMode (mode == RelativeLocation) >> getMouseLocationMode
-- | Check which mouse location mode is currently active.
getMouseLocationMode :: MonadIO m => m LocationMode
getMouseLocationMode = do
relativeMode <- Raw.getRelativeMouseMode
return $ if relativeMode then RelativeLocation else AbsoluteLocation
-- | Return proper mouse location depending on mouse mode
getModalMouseLocation :: MonadIO m => m (LocationMode, Point V2 CInt)
getModalMouseLocation = do
mode <- getMouseLocationMode
location <- case mode of
RelativeLocation -> getRelativeMouseLocation
_ -> getAbsoluteMouseLocation
return (mode, location)
-- deprecated
setRelativeMouseMode :: (Functor m, MonadIO m) => Bool -> m ()
{-# DEPRECATED setRelativeMouseMode "Use setMouseLocationMode instead" #-}
setRelativeMouseMode enable =
throwIfNeg_ "SDL.Input.Mouse" "SDL_SetRelativeMouseMode" $
Raw.setRelativeMouseMode enable
--deprecated
getRelativeMouseMode :: MonadIO m => m Bool
{-# DEPRECATED getRelativeMouseMode "Use getMouseLocationMode instead" #-}
getRelativeMouseMode = Raw.getRelativeMouseMode
--deprecated
getMouseLocation :: MonadIO m => m (Point V2 CInt)
{-# DEPRECATED getMouseLocation "Use getAbsoluteMouseLocation instead, or getModalMouseLocation to match future behavior." #-}
getMouseLocation = getAbsoluteMouseLocation
data MouseButton
= ButtonLeft
| ButtonMiddle
| ButtonRight
| ButtonX1
| ButtonX2
| ButtonExtra !Int -- ^ An unknown mouse button.
deriving (Data, Eq, Generic, Ord, Read, Show, Typeable)
-- | Identifies what kind of mouse-like device this is.
data MouseDevice
= Mouse !Int -- ^ An actual mouse. The number identifies which mouse.
| Touch -- ^ Some sort of touch device.
deriving (Data, Eq, Generic, Ord, Read, Show, Typeable)
instance FromNumber MouseDevice Word32 where
fromNumber n' = case n' of
Raw.SDL_TOUCH_MOUSEID -> Touch
n -> Mouse $ fromIntegral n
data WarpMouseOrigin
= WarpInWindow Window
-- ^ Move the mouse pointer within a given 'Window'.
| WarpCurrentFocus
-- ^ Move the mouse pointer within whichever 'Window' currently has focus.
-- WarpGlobal -- Needs 2.0.4
deriving (Data, Eq, Generic, Ord, Show, Typeable)
-- | Move the current location of a mouse pointer. The 'WarpMouseOrigin' specifies the origin for the given warp coordinates.
warpMouse :: MonadIO m => WarpMouseOrigin -> Point V2 CInt -> m ()
warpMouse (WarpInWindow (Window w)) (P (V2 x y)) = Raw.warpMouseInWindow w x y
warpMouse WarpCurrentFocus (P (V2 x y)) = Raw.warpMouseInWindow nullPtr x y
-- | Get or set whether the cursor is currently visible.
--
-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
--
-- See @<https://wiki.libsdl.org/SDL_ShowCursor SDL_ShowCursor>@ and @<https://wiki.libsdl.org/SDL_HideCursor SDL_HideCursor>@ for C documentation.
cursorVisible :: StateVar Bool
cursorVisible = makeStateVar getCursorVisible setCursorVisible
where
-- The usage of 'void' is OK here - Raw.showCursor just returns the old state.
setCursorVisible :: (Functor m, MonadIO m) => Bool -> m ()
setCursorVisible True = void $ Raw.showCursor 1
setCursorVisible False = void $ Raw.showCursor 0
getCursorVisible :: (Functor m, MonadIO m) => m Bool
getCursorVisible = (== 1) <$> Raw.showCursor (-1)
-- | Retrieve the current location of the mouse, relative to the currently focused window.
getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt)
getAbsoluteMouseLocation = liftIO $
alloca $ \x ->
alloca $ \y -> do
_ <- Raw.getMouseState x y -- We don't deal with button states here
P <$> (V2 <$> peek x <*> peek y)
-- | Retrieve mouse motion
getRelativeMouseLocation :: MonadIO m => m (Point V2 CInt)
getRelativeMouseLocation = liftIO $
alloca $ \x ->
alloca $ \y -> do
_ <- Raw.getRelativeMouseState x y
P <$> (V2 <$> peek x <*> peek y)
-- | Retrieve a mapping of which buttons are currently held down.
getMouseButtons :: MonadIO m => m (MouseButton -> Bool)
getMouseButtons = liftIO $
convert <$> Raw.getMouseState nullPtr nullPtr
where
convert w b = w `testBit` index
where
index = case b of
ButtonLeft -> 0
ButtonMiddle -> 1
ButtonRight -> 2
ButtonX1 -> 3
ButtonX2 -> 4
ButtonExtra i -> i
newtype Cursor = Cursor { unwrapCursor :: Raw.Cursor }
deriving (Eq, Typeable)
-- | Get or set the currently active cursor. You can create new 'Cursor's with 'createCursor'.
--
-- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
--
-- See @<https://wiki.libsdl.org/SDL_SetCursor SDL_SetCursor>@ and @<https://wiki.libsdl.org/SDL_GetCursor SDL_GetCursor>@ for C documentation.
activeCursor :: StateVar Cursor
activeCursor = makeStateVar getCursor setCursor
where
getCursor :: MonadIO m => m Cursor
getCursor = liftIO . fmap Cursor $
throwIfNull "SDL.Input.Mouse.getCursor" "SDL_getCursor"
Raw.getCursor
setCursor :: MonadIO m => Cursor -> m ()
setCursor = Raw.setCursor . unwrapCursor
-- | Create a cursor using the specified bitmap data and mask (in MSB format).
--
--
createCursor :: MonadIO m
=> V.Vector Bool -- ^ Whether this part of the cursor is black. Use 'False' for white and 'True' for black.
-> V.Vector Bool -- ^ Whether or not pixels are visible. Use 'True' for visible and 'False' for transparent.
-> V2 CInt -- ^ The width and height of the cursor.
-> Point V2 CInt -- ^ The X- and Y-axis location of the upper left corner of the cursor relative to the actual mouse position
-> m Cursor
createCursor dta msk (V2 w h) (P (V2 hx hy)) =
liftIO . fmap Cursor $
throwIfNull "SDL.Input.Mouse.createCursor" "SDL_createCursor" $
V.unsafeWith (V.map (bool 0 1) dta) $ \unsafeDta ->
V.unsafeWith (V.map (bool 0 1) msk) $ \unsafeMsk ->
Raw.createCursor unsafeDta unsafeMsk w h hx hy
-- | Free a cursor created with 'createCursor' and 'createColorCusor'.
--
-- See @<https://wiki.libsdl.org/SDL_FreeCursor SDL_FreeCursor>@ for C documentation.
freeCursor :: MonadIO m => Cursor -> m ()
freeCursor = Raw.freeCursor . unwrapCursor
-- | Create a color cursor.
--
-- See @<https://wiki.libsdl.org/SDL_CreateColorCursor SDL_CreateColorCursor>@ for C documentation.
createColorCursor :: MonadIO m
=> Surface
-> Point V2 CInt -- ^ The location of the cursor hot spot
-> m Cursor
createColorCursor (Surface surfPtr _) (P (V2 hx hy)) =
liftIO . fmap Cursor $
throwIfNull "SDL.Input.Mouse.createColorCursor" "SDL_createColorCursor" $
Raw.createColorCursor surfPtr hx hy
|
seppeljordan/sdl2
|
src/SDL/Input/Mouse.hs
|
bsd-3-clause
| 8,773
| 0
| 15
| 1,737
| 1,739
| 946
| 793
| 167
| 6
|
{-# LANGUAGE OverloadedStrings #-}
module ConnectCmds (connectCmds) where
import Control.Lens
import Data.Foldable (for_)
import Data.Text.Encoding
import Data.Monoid ((<>))
import Irc.Message
import Irc.Format
import ClientState
import ServerSettings
connectCmds :: EventHandler
connectCmds = EventHandler
{ _evName = "connect commands"
, _evOnEvent = handler
}
handler :: Identifier -> IrcMessage -> ClientState -> IO ClientState
handler ident mesg st
| ident == ""
, views mesgSender userNick mesg == "Welcome" =
do let cmds = view (clientServer0 . ccServerSettings . ssConnectCmds) st
for_ cmds $ \cmd ->
clientSend (encodeUtf8 cmd<>"\r\n") st
return st
| otherwise = return (reschedule st)
-- Reschedule the autojoin handler for the next message
reschedule :: ClientState -> ClientState
reschedule = over clientAutomation (cons connectCmds)
|
TomMD/irc-core
|
driver/ConnectCmds.hs
|
bsd-3-clause
| 900
| 0
| 14
| 170
| 245
| 130
| 115
| 25
| 1
|
{-# LANGUAGE NoImplicitPrelude, MagicHash, TypeOperators,
DataKinds, TypeFamilies, FlexibleContexts #-}
-----------------------------------------------------------------------------
-- |
-- Module : Java.NIO
-- Copyright : (c) Jyothsna Srinivas 2017
--
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : jyothsnasrinivas17@gmail.com
-- Stability : provisional
-- Portability : portable
--
-- Bindings for Java NIO utilities
--
-----------------------------------------------------------------------------
module Java.NIO where
import GHC.Base
import GHC.Int
import Java.Array
import Java.Collections
import Java.Primitive
-- Start java.nio.Buffer
data {-# CLASS "java.nio.Buffer" #-} Buffer = Buffer (Object# Buffer)
deriving Class
foreign import java unsafe array :: (a <: Buffer) => Java a Object
foreign import java unsafe arrayOffset :: (a <: Buffer) => Java a Int
foreign import java unsafe capacity :: (a <: Buffer) => Java a Int
foreign import java unsafe clear :: (a <: Buffer) => Java a Buffer
foreign import java unsafe flip :: (a <: Buffer) => Java a Buffer
foreign import java unsafe hasArray :: (a <: Buffer) => Java a Bool
foreign import java unsafe hasRemaining :: (a <: Buffer) => Java a Bool
foreign import java unsafe isDirect :: (a <: Buffer) => Java a Bool
foreign import java unsafe isReadOnly :: (a <: Buffer) => Java a Bool
foreign import java unsafe limit :: (a <: Buffer) => Java a Int
foreign import java unsafe "limit" limitInt :: (a <: Buffer) => Int -> Java a Buffer
foreign import java unsafe mark :: (a <: Buffer) => Java a Buffer
foreign import java unsafe position :: (a <: Buffer) => Java a Int
foreign import java unsafe "position" positionInt :: (a <: Buffer) => Int -> Java a Buffer
foreign import java unsafe remaining :: (a <: Buffer) => Java a Int
foreign import java unsafe reset :: (a <: Buffer) => Java a Buffer
foreign import java unsafe rewind :: (a <: Buffer) => Java a Buffer
-- End java.nio.Buffer
-- Start java.nio.ByteBuffer
data {-# CLASS "java.nio.ByteBuffer" #-} ByteBuffer = ByteBuffer (Object# ByteBuffer)
deriving Class
foreign import java unsafe "array" arrayByteBuffer :: (a <: ByteBuffer) => Java a JByteArray
foreign import java unsafe "arrayOffset"
arrayOffsetByteBuffer :: (a <: ByteBuffer) => Java a Int
foreign import java unsafe asCharBuffer :: (a <: ByteBuffer) => Java a CharBuffer
foreign import java unsafe asDoubleBuffer :: (a <: ByteBuffer) => Java a DoubleBuffer
foreign import java unsafe asFloatBuffer :: (a <: ByteBuffer) => Java a FloatBuffer
foreign import java unsafe asIntBuffer :: (a <: ByteBuffer) => Java a IntBuffer
foreign import java unsafe asLongBuffer :: (a <: ByteBuffer) => Java a LongBuffer
foreign import java unsafe asReadOnlyBuffer :: (a <: ByteBuffer) => Java a ByteBuffer
foreign import java unsafe asShortBuffer :: (a <: ByteBuffer) => Java a ShortBuffer
foreign import java unsafe compact :: (a <: ByteBuffer) => Java a ByteBuffer
foreign import java unsafe compareTo :: (a <: ByteBuffer) => ByteBuffer -> Java a Int
foreign import java unsafe duplicate :: (a <: ByteBuffer) => Java a ByteBuffer
foreign import java unsafe equals :: (a <: ByteBuffer) => Object -> Java a Bool
foreign import java unsafe get :: (a <: ByteBuffer) => Java a Byte
foreign import java unsafe "get" getByte :: (a <: ByteBuffer) => JByteArray -> Java a ByteBuffer
foreign import java unsafe "get"
getByte2 :: (a <: ByteBuffer) => JByteArray -> Int -> Int -> Java a ByteBuffer
foreign import java unsafe "get" get2 :: (a <: ByteBuffer) => Int -> Java a Byte
foreign import java unsafe getChar :: (a <: ByteBuffer) => Java a Char
foreign import java unsafe "getChar" getCharInt :: (a <: ByteBuffer) => Int -> Java a Char
foreign import java unsafe getDouble :: (a <: ByteBuffer) => Java a Double
foreign import java unsafe "getDouble" getDoubleInt :: (a <: ByteBuffer) => Int -> Java a Double
foreign import java unsafe getFloat :: (a <: ByteBuffer) => Java a Float
foreign import java unsafe "getFloat" getFloatInt :: (a <: ByteBuffer) => Int -> Java a Float
foreign import java unsafe getInt :: (a <: ByteBuffer) => Java a Int
foreign import java unsafe "getInt" getIntInt :: (a <: ByteBuffer) => Int -> Java a Int
foreign import java unsafe getLong :: (a <: ByteBuffer) => Java a Int64
foreign import java unsafe "getLong" getLongInt :: (a <: ByteBuffer) => Int -> Java a Int64
foreign import java unsafe getShort :: (a <: ByteBuffer) => Java a Short
foreign import java unsafe "getShort" getShortInt :: (a <: ByteBuffer) => Int -> Java a Short
foreign import java unsafe "hasArray" hasArrayByteBuffer :: (a <: ByteBuffer) => Java a Bool
foreign import java unsafe hashCode :: (a <: ByteBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectByteBuffer :: (a <: ByteBuffer) => Java a Bool
foreign import java unsafe order :: (a <: ByteBuffer) => Java a ByteOrder
foreign import java unsafe "order" orderByte :: (a <: ByteBuffer) => ByteOrder -> Java a ByteBuffer
foreign import java unsafe put :: (a <: ByteBuffer) => Byte -> Java a ByteBuffer
foreign import java unsafe "put" putByte :: (a <: ByteBuffer) => JByteArray -> Java a ByteBuffer
foreign import java unsafe "put"
putByte2 :: (a <: ByteBuffer) => JByteArray -> Int -> Int -> Java a ByteBuffer
foreign import java unsafe "put" putByte3 :: (a <: ByteBuffer) => ByteBuffer -> Java a ByteBuffer
foreign import java unsafe "put" putByte4 :: (a <: ByteBuffer) => Int -> Byte -> Java a ByteBuffer
foreign import java unsafe putChar :: (a <: ByteBuffer) => JChar -> Java a ByteBuffer
foreign import java unsafe "putChar" putChar2 :: (a <: ByteBuffer) => Int -> JChar -> Java a ByteBuffer
foreign import java unsafe putDouble :: (a <: ByteBuffer) => Double -> Java a ByteBuffer
foreign import java unsafe "putDouble"
putDouble2 :: (a <: ByteBuffer) => Int -> Double -> Java a ByteBuffer
foreign import java unsafe putFloat :: (a <: ByteBuffer) => Float -> Java a ByteBuffer
foreign import java unsafe "putFloat"
putFloat2 :: (a <: ByteBuffer) => Int -> Float -> Java a ByteBuffer
foreign import java unsafe putInt :: (a <: ByteBuffer) => Int -> Java a ByteBuffer
foreign import java unsafe "putInt" putInt2 :: (a <: ByteBuffer) => Int -> Int -> Java a ByteBuffer
foreign import java unsafe putLong :: (a <: ByteBuffer) => Int64 -> Java a ByteBuffer
foreign import java unsafe "putLong"
putLong2 :: (a <: ByteBuffer) => Int -> Int64 -> Java a ByteBuffer
foreign import java unsafe putShort :: (a <: ByteBuffer) => Short -> Java a ByteBuffer
foreign import java unsafe "putShort"
putShort2 :: (a <: ByteBuffer) => Int -> Short -> Java a ByteBuffer
foreign import java unsafe slice :: (a <: ByteBuffer) => Java a ByteBuffer
foreign import java unsafe toString :: (a <: ByteBuffer) => Java a String
-- End java.nio.ByteBuffer
-- Start java.nio.ByteOrder
data {-# CLASS "java.nio.ByteOrder" #-} ByteOrder = ByteOrder (Object# ByteOrder)
deriving Class
foreign import java unsafe "toString" toStringByteOrder :: (a <: ByteOrder) => Java a String
-- End java.nio.ByteOrder
-- Start java.nio.CharBuffer
data {-# CLASS "java.nio.CharBuffer" #-} CharBuffer = CharBuffer (Object# CharBuffer)
deriving Class
foreign import java unsafe append :: (a <: CharBuffer) => JChar -> Java a CharBuffer
foreign import java unsafe "append" append2 :: (a <: CharBuffer) => CharSequence -> Java a CharBuffer
foreign import java unsafe "append"
append3 :: (a <: CharBuffer) => CharSequence -> Int -> Int -> Java a CharBuffer
foreign import java unsafe "array" arrayCharBuffer :: (a <: CharBuffer) => Java a JCharArray
foreign import java unsafe "arrayOffset"
arrayOffsetCharBuffer :: (a <: CharBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferCharBuffer:: (a <: CharBuffer) => Java a CharBuffer
foreign import java unsafe charAt :: (a <: CharBuffer) => Int -> Java a JChar
foreign import java unsafe "compact" compactCharBuffer :: (a <: CharBuffer) => Java a CharBuffer
foreign import java unsafe "compareTo"
compareToCharBuffer :: (a <: CharBuffer) => CharBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateCharBuffer :: (a <: CharBuffer) => Java a CharBuffer
foreign import java unsafe "equals" equalsCharBuffer :: (a <: CharBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getCharBuffer :: (a <: CharBuffer) => Java a JChar
foreign import java unsafe "get" getCharBuffer2 :: (a <: CharBuffer) => JCharArray -> Java a CharBuffer
foreign import java unsafe "get"
getCharBuffer3 :: (a <: CharBuffer) => JCharArray -> Int -> Int -> Java a CharBuffer
foreign import java unsafe "get" getCharBuffer4 :: (a <: CharBuffer) => Int -> Java a JChar
foreign import java unsafe "hasArray" hasArrayCharBuffer :: (a <: CharBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeCharBuffer :: (a <: CharBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectCharBuffer :: (a <: CharBuffer) => Java a Bool
foreign import java unsafe length :: (a <: CharBuffer) => Java a Int
foreign import java unsafe "order" orderCharBuffer :: (a <: CharBuffer) => Java a ByteOrder
foreign import java unsafe "put" putCharBuffer :: (a <: CharBuffer) => JChar -> Java a CharBuffer
foreign import java unsafe "put" putCharBuffer2 :: (a <: CharBuffer) => JCharArray -> Java a CharBuffer
foreign import java unsafe "put"
putCharBuffer3 :: (a <: CharBuffer) => JCharArray -> Int -> Int -> Java a CharBuffer
foreign import java unsafe "put" putCharBuffer4 :: (a <: CharBuffer) => CharBuffer -> Java a CharBuffer
foreign import java unsafe "put" putCharBuffer5 :: (a <: CharBuffer) => Int -> JChar -> Java a CharBuffer
foreign import java unsafe "put" putCharBuffer6 :: (a <: CharBuffer) => String -> Java a CharBuffer
foreign import java unsafe "put"
putCharBuffer7 :: (a <: CharBuffer) => String -> Int -> Int -> Java a CharBuffer
foreign import java unsafe "read" readCharBuffer :: (a <: CharBuffer) => CharBuffer -> Java a Int
foreign import java unsafe "slice" sliceCharBuffer :: (a <: CharBuffer) => Java a CharBuffer
foreign import java unsafe subSequence :: (a <: CharBuffer) => Int -> Int -> Java a CharBuffer
foreign import java unsafe "toString" toStringCharBuffer :: (a <: CharBuffer) => Java a String
-- End java.nio.CharBuffer
-- Start java.nio.DoubleBuffer
data {-# CLASS "java.nio.DoubleBuffer" #-} DoubleBuffer = DoubleBuffer (Object# DoubleBuffer)
deriving Class
foreign import java unsafe "array" arrayDoubleBuffer :: (a <: DoubleBuffer) => Java a JDoubleArray
foreign import java unsafe "arrayOffset"
arrayOffsetDoubleBuffer :: (a <: DoubleBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferDoubleBuffer :: (a <: DoubleBuffer) => Java a DoubleBuffer
foreign import java unsafe "compact" compactDoubleBuffer :: (a <: DoubleBuffer) => Java a DoubleBuffer
foreign import java unsafe "compareTo"
compareToDoubleBuffer :: (a <: DoubleBuffer) => DoubleBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateDoubleBuffer :: (a <: DoubleBuffer) => Java a DoubleBuffer
foreign import java unsafe "equals" equalsDoubleBuffer :: (a <: DoubleBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getDoubleBuffer :: (a <: DoubleBuffer) => Java a Double
foreign import java unsafe "get"
getDoubleBuffer2 :: (a <: DoubleBuffer) => JDoubleArray -> Java a DoubleBuffer
foreign import java unsafe "get"
getDoubleBuffer3 :: (a <: DoubleBuffer) => JDoubleArray -> Int -> Int -> Java a DoubleBuffer
foreign import java unsafe "get" getDoubleBuffer4 :: (a <: DoubleBuffer) => Int -> Java a Double
foreign import java unsafe "hasArray" hasArrayDoubleBuffer :: (a <: DoubleBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeDoubleBuffer :: (a <: DoubleBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectDoubleBuffer :: (a <: DoubleBuffer) => Java a Bool
foreign import java unsafe "order" orderDoubleBuffer :: (a <: DoubleBuffer) => Java a ByteOrder
foreign import java unsafe "put"
putDoubleBuffer :: (a <: DoubleBuffer) => Double -> Java a DoubleBuffer
foreign import java unsafe "put"
putDoubleBuffer2 :: (a <: DoubleBuffer) => JDoubleArray -> Java a DoubleBuffer
foreign import java unsafe "put"
putDoubleBuffer3 :: (a <: DoubleBuffer) => JDoubleArray -> Int -> Int -> Java a DoubleBuffer
foreign import java unsafe "put"
putDoubleBuffer4 :: (a <: DoubleBuffer) => DoubleBuffer -> Java a DoubleBuffer
foreign import java unsafe "put"
putDoubleBuffer5 :: (a <: DoubleBuffer) => Int -> Double -> Java a DoubleBuffer
foreign import java unsafe "slice" sliceDoubleBuffer :: (a <: DoubleBuffer) => Java a DoubleBuffer
foreign import java unsafe "toString" toStringDoubleBuffer :: (a <: DoubleBuffer) => Java a String
-- End java.nio.DoubleBuffer
-- Start java.nio.FloatBuffer
data {-# CLASS "java.nio.FloatBuffer" #-} FloatBuffer = FloatBuffer (Object# FloatBuffer)
deriving Class
foreign import java unsafe "array" arrayFloatBuffer :: (a <: FloatBuffer) => Java a JFloatArray
foreign import java unsafe "arrayOffset"
arrayOffsetFloatBuffer :: (a <: FloatBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferFloatBuffer :: (a <: FloatBuffer) => Java a FloatBuffer
foreign import java unsafe "compact" compactFloatBuffer :: (a <: FloatBuffer) => Java a FloatBuffer
foreign import java unsafe "compareTo"
compareToFloatBuffer :: (a <: FloatBuffer) => FloatBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateFloatBuffer :: (a <: FloatBuffer) => Java a FloatBuffer
foreign import java unsafe "equals" equalsFloatBuffer :: (a <: FloatBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getFloatBuffer :: (a <: FloatBuffer) => Java a Float
foreign import java unsafe "get"
getFloatBuffer2 :: (a <: FloatBuffer) => JFloatArray -> Java a FloatBuffer
foreign import java unsafe "get"
getFloatBuffer3 :: (a <: FloatBuffer) => JFloatArray -> Int -> Int -> Java a FloatBuffer
foreign import java unsafe "get" getFloatBuffer4 :: (a <: FloatBuffer) => Int -> Java a Float
foreign import java unsafe "hasArray" hasArrayFloatBuffer :: (a <: FloatBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeFloatBuffer :: (a <: FloatBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectFloatBuffer :: (a <: FloatBuffer) => Java a Bool
foreign import java unsafe "order" orderFloatBuffer :: (a <: FloatBuffer) => Java a ByteOrder
foreign import java unsafe "put"
putFloatBuffer :: (a <: FloatBuffer) => Float -> Java a FloatBuffer
foreign import java unsafe "put"
putFloatBuffer2 :: (a <: FloatBuffer) => JFloatArray -> Java a FloatBuffer
foreign import java unsafe "put"
putFloatBuffer3 :: (a <: FloatBuffer) => JFloatArray -> Int -> Int -> Java a FloatBuffer
foreign import java unsafe "put"
putFloatBuffer4 :: (a <: FloatBuffer) => FloatBuffer -> Java a FloatBuffer
foreign import java unsafe "put"
putFloatBuffer5 :: (a <: FloatBuffer) => Int -> Float -> Java a FloatBuffer
foreign import java unsafe "slice" sliceFloatBuffer :: (a <: FloatBuffer) => Java a FloatBuffer
foreign import java unsafe "toString" toStringFloatBuffer :: (a <: FloatBuffer) => Java a String
-- End java.nio.FloatBuffer
-- Start java.nio.IntBuffer
data {-# CLASS "java.nio.IntBuffer" #-} IntBuffer = IntBuffer (Object# IntBuffer)
deriving Class
foreign import java unsafe "array" arrayIntBuffer :: (a <: IntBuffer) => Java a JIntArray
foreign import java unsafe "arrayOffset"
arrayOffsetIntBuffer :: (a <: IntBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferIntBuffer :: (a <: IntBuffer) => Java a IntBuffer
foreign import java unsafe "compact" compactIntBuffer :: (a <: IntBuffer) => Java a IntBuffer
foreign import java unsafe "compareTo"
compareToIntBuffer :: (a <: IntBuffer) => IntBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateIntBuffer :: (a <: IntBuffer) => Java a IntBuffer
foreign import java unsafe "equals" equalsIntBuffer :: (a <: IntBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getIntBuffer :: (a <: IntBuffer) => Java a Int
foreign import java unsafe "get"
getIntBuffer2 :: (a <: IntBuffer) => JIntArray -> Java a IntBuffer
foreign import java unsafe "get"
getIntBuffer3 :: (a <: IntBuffer) => JIntArray -> Int -> Int -> Java a IntBuffer
foreign import java unsafe "get" getIntBuffer4 :: (a <: IntBuffer) => Int -> Java a Int
foreign import java unsafe "hasArray" hasArrayIntBuffer :: (a <: IntBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeIntBuffer :: (a <: IntBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectIntBuffer :: (a <: IntBuffer) => Java a Bool
foreign import java unsafe "order" orderIntBuffer :: (a <: IntBuffer) => Java a ByteOrder
foreign import java unsafe "put"
putIntBuffer :: (a <: IntBuffer) => Int -> Java a IntBuffer
foreign import java unsafe "put"
putIntBuffer2 :: (a <: IntBuffer) => JIntArray -> Java a IntBuffer
foreign import java unsafe "put"
putIntBuffer3 :: (a <: IntBuffer) => JIntArray -> Int -> Int -> Java a IntBuffer
foreign import java unsafe "put"
putIntBuffer4 :: (a <: IntBuffer) => IntBuffer -> Java a IntBuffer
foreign import java unsafe "put"
putIntBuffer5 :: (a <: IntBuffer) => Int -> Int -> Java a IntBuffer
foreign import java unsafe "slice" sliceIntBuffer :: (a <: IntBuffer) => Java a IntBuffer
foreign import java unsafe "toString" toStringIntBuffer :: (a <: IntBuffer) => Java a String
-- End java.nio.IntBuffer
-- Start java.nio.LongBuffer
data {-# CLASS "java.nio.LongBuffer" #-} LongBuffer = LongBuffer (Object# LongBuffer)
deriving Class
foreign import java unsafe "array" arrayLongBuffer :: (a <: LongBuffer) => Java a JLongArray
foreign import java unsafe "arrayOffset"
arrayOffsetLongBuffer :: (a <: LongBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferLongBuffer :: (a <: LongBuffer) => Java a LongBuffer
foreign import java unsafe "compact" compactLongBuffer :: (a <: LongBuffer) => Java a LongBuffer
foreign import java unsafe "compareTo"
compareToLongBuffer :: (a <: LongBuffer) => LongBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateLongBuffer :: (a <: LongBuffer) => Java a LongBuffer
foreign import java unsafe "equals" equalsLongBuffer :: (a <: LongBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getLongBuffer :: (a <: LongBuffer) => Java a Int64
foreign import java unsafe "get" getLongBuffer2 :: (a <: LongBuffer) => Int -> Java a Int64
foreign import java unsafe "get"
getLongBuffer3 :: (a <: LongBuffer) => JLongArray -> Java a LongBuffer
foreign import java unsafe "get"
getLongBuffer4 :: (a <: LongBuffer) => JLongArray -> Int -> Int -> Java a LongBuffer
foreign import java unsafe "hasArray" hasArrayLongBuffer :: (a <: LongBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeLongBuffer :: (a <: LongBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectLongBuffer :: (a <: LongBuffer) => Java a Bool
foreign import java unsafe "order" orderLongBuffer :: (a <: LongBuffer) => Java a ByteOrder
foreign import java unsafe "put"
putLongBuffer :: (a <: LongBuffer) => Int -> Java a LongBuffer
foreign import java unsafe "put"
putLongBuffer2 :: (a <: LongBuffer) => JLongArray -> Java a LongBuffer
foreign import java unsafe "put"
putLongBuffer3 :: (a <: LongBuffer) => JLongArray -> Int -> Int -> Java a LongBuffer
foreign import java unsafe "put"
putLongBuffer4 :: (a <: LongBuffer) => LongBuffer -> Java a LongBuffer
foreign import java unsafe "put"
putLongBuffer5 :: (a <: LongBuffer) => Int -> Int -> Java a LongBuffer
foreign import java unsafe "slice" sliceLongBuffer :: (a <: LongBuffer) => Java a LongBuffer
foreign import java unsafe "toString" toStringLongBuffer :: (a <: LongBuffer) => Java a String
-- End java.nio.LongBuffer
-- Start java.nio.ShortBuffer
data {-# CLASS "java.nio.ShortBuffer" #-} ShortBuffer = ShortBuffer (Object# ShortBuffer)
deriving Class
foreign import java unsafe "array" arrayShortBuffer :: (a <: ShortBuffer) => Java a JShortArray
foreign import java unsafe "arrayOffset"
arrayOffsetShortBuffer :: (a <: ShortBuffer) => Java a Int
foreign import java unsafe "asReadOnlyBuffer"
asReadOnlyBufferShortBuffer :: (a <: ShortBuffer) => Java a ShortBuffer
foreign import java unsafe "compact" compactShortBuffer :: (a <: ShortBuffer) => Java a ShortBuffer
foreign import java unsafe "compareTo"
compareToShortBuffer :: (a <: ShortBuffer) => ShortBuffer -> Java a Int
foreign import java unsafe "duplicate" duplicateShortBuffer :: (a <: ShortBuffer) => Java a ShortBuffer
foreign import java unsafe "equals" equalsShortBuffer :: (a <: ShortBuffer) => Object -> Java a Bool
foreign import java unsafe "get" getShortBuffer :: (a <: ShortBuffer) => Java a Int64
foreign import java unsafe "get" getShortBuffer2 :: (a <: ShortBuffer) => Int -> Java a Int64
foreign import java unsafe "get"
getShortBuffer3 :: (a <: ShortBuffer) => JShortArray -> Java a ShortBuffer
foreign import java unsafe "get"
getShortBuffer4 :: (a <: ShortBuffer) => JShortArray -> Int -> Int -> Java a ShortBuffer
foreign import java unsafe "hasArray" hasArrayShortBuffer :: (a <: ShortBuffer) => Java a Bool
foreign import java unsafe "hashCode" hashCodeShortBuffer :: (a <: ShortBuffer) => Java a Int
foreign import java unsafe "isDirect" isDirectShortBuffer :: (a <: ShortBuffer) => Java a Bool
foreign import java unsafe "order" orderShortBuffer :: (a <: ShortBuffer) => Java a ByteOrder
foreign import java unsafe "put"
putShortBuffer :: (a <: ShortBuffer) => Int -> Java a ShortBuffer
foreign import java unsafe "put"
putShortBuffer2 :: (a <: ShortBuffer) => JShortArray -> Java a ShortBuffer
foreign import java unsafe "put"
putShortBuffer3 :: (a <: ShortBuffer) => JShortArray -> Int -> Int -> Java a ShortBuffer
foreign import java unsafe "put"
putShortBuffer4 :: (a <: ShortBuffer) => ShortBuffer -> Java a ShortBuffer
foreign import java unsafe "put"
putShortBuffer5 :: (a <: ShortBuffer) => Int -> Int -> Java a ShortBuffer
foreign import java unsafe "slice" sliceShortBuffer :: (a <: ShortBuffer) => Java a ShortBuffer
foreign import java unsafe "toString" toStringShortBuffer :: (a <: ShortBuffer) => Java a String
-- End java.nio.ShortBuffer
-- Start java.nio.MappedByteBuffer
data {-# CLASS "java.nio.MappedByteBuffer" #-} MappedByteBuffer = MappedByteBuffer (Object# MappedByteBuffer)
deriving Class
foreign import java unsafe force :: (a <: MappedByteBuffer) => Java a MappedByteBuffer
foreign import java unsafe isLoaded :: (a <: MappedByteBuffer) => Java a Bool
foreign import java unsafe load :: (a <: MappedByteBuffer) => Java a MappedByteBuffer
-- End java.nio.MappedByteBuffer
-- Start java.nio.Charset
data {-# CLASS "java.nio.Charset" #-} Charset = Charset (Object# Charset)
deriving Class
-- End java.nio.Charset
-- Start java.nio.file.Path
data {-# CLASS "java.nio.file.Path" #-} Path = Path (Object# Path)
deriving Class
type instance Inherits Path = '[Iterable Path, Comparable Path]
foreign import java unsafe "@interface"
endsWith :: (a <: Path) => Path -> Java a Bool
foreign import java unsafe "@interface"
endsWithString :: (a <: Path) => String -> Java a Bool
foreign import java unsafe "@interface"
getFileName :: (a <: Path) => Java a Path
foreign import java unsafe "@interface"
getFileSystem :: (a <: Path) => Java a FileSystem
foreign import java unsafe "@interface"
getName :: (a <: Path) => Int -> Java a Path
foreign import java unsafe "@interface"
getNameCount :: (a <: Path) => Java a Int
foreign import java unsafe "@interface"
getParent :: (a <: Path) => Java a Path
foreign import java unsafe "@interface"
getRoot :: (a <: Path) => Java a Path
foreign import java unsafe "@interface"
normalize :: (a <: Path) => Java a Path
foreign import java unsafe "@interface"
relativize :: (a <: Path) => Path -> Java a Path
foreign import java unsafe "@interface"
resolve :: (a <: Path) => Path -> Java a Path
foreign import java unsafe "@interface"
resolveString :: (a <: Path) => String -> Java a Path
foreign import java unsafe "@interface"
resolveSibling :: (a <: Path) => Path -> Java a Path
foreign import java unsafe "@interface"
resolveSiblingString :: (a <: Path) => String -> Java a Path
foreign import java unsafe "@interface"
startsWith :: (a <: Path) => Path -> Java a Bool
foreign import java unsafe "@interface"
startsWithString :: (a <: Path) => String -> Java a Bool
-- End java.nio.file.Path
-- Start java.nio.file.FileSystem
data {-# CLASS "java.nio.file.FileSystem" #-} FileSystem = FileSystem (Object# FileSystem)
deriving Class
-- End java.nio.file.FileSystem
|
pparkkin/eta
|
libraries/base/Java/NIO.hs
|
bsd-3-clause
| 25,045
| 224
| 9
| 4,279
| 7,868
| 4,170
| 3,698
| -1
| -1
|
module Board.Object.Object where
data Object = Object deriving (Show, Eq)
|
charleso/intellij-haskforce
|
tests/gold/codeInsight/TotalProject/Board/Object/Object.hs
|
apache-2.0
| 74
| 0
| 6
| 10
| 25
| 15
| 10
| 2
| 0
|
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS -Wall #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | Model-view-controller app types.
module Snap.App.Types
(Controller(..)
,Model(..)
,ControllerState(..)
,ModelState(..)
,AppConfig(..)
,AppLiftModel(..))
where
import Control.Applicative (Alternative)
import Control.Monad (MonadPlus)
import Control.Monad.Catch (MonadCatchIO)
import Control.Monad.Reader (ReaderT,MonadReader)
import Control.Monad.Trans (MonadIO)
import Database.PostgreSQL.Simple (Connection)
import Snap.Core (Snap,MonadSnap)
-- | The state accessible to the controller (DB/session stuff).
data ControllerState config state = ControllerState {
controllerStateConfig :: config
, controllerStateConn :: Connection
, controllerState :: state
}
-- | The controller monad.
newtype Controller config state a = Controller {
runController :: ReaderT (ControllerState config state) Snap a
} deriving (Monad
,Functor
,Applicative
,Alternative
,MonadReader (ControllerState config state)
,MonadSnap
,MonadIO
,MonadPlus
,MonadCatchIO)
-- | The state accessible to the model (just DB connection).
data ModelState config state = ModelState {
modelStateConn :: Connection
, modelStateAnns :: state
, modelStateConfig :: config
}
-- | The model monad (limited access to IO, only DB access).
newtype Model config state a = Model {
runModel :: ReaderT (ModelState config state) IO a
} deriving (Monad,Functor,Applicative,MonadReader (ModelState config state),MonadIO)
-- -- | Pagination data.
-- data Pagination = Pagination {
-- pnPage :: Integer
-- , pnLimit :: Integer
-- , pnURI :: URI
-- , pnResults :: Integer
-- , pnTotal :: Integer
-- } deriving Show
class AppConfig config where
getConfigDomain :: config -> String
class AppLiftModel c s where
liftModel :: Model c s a -> Controller c s a
|
lwm/haskellnews
|
upstream/snap-app/src/Snap/App/Types.hs
|
bsd-3-clause
| 2,156
| 0
| 9
| 523
| 403
| 247
| 156
| 45
| 0
|
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details
module SPARC.Stack (
spRel,
fpRel,
spillSlotToOffset,
maxSpillSlots
)
where
import SPARC.AddrMode
import SPARC.Regs
import SPARC.Base
import SPARC.Imm
import DynFlags
import Outputable
-- | Get an AddrMode relative to the address in sp.
-- This gives us a stack relative addressing mode for volatile
-- temporaries and for excess call arguments.
--
spRel :: Int -- ^ stack offset in words, positive or negative
-> AddrMode
spRel n = AddrRegImm sp (ImmInt (n * wordLength))
-- | Get an address relative to the frame pointer.
-- This doesn't work work for offsets greater than 13 bits; we just hope for the best
--
fpRel :: Int -> AddrMode
fpRel n
= AddrRegImm fp (ImmInt (n * wordLength))
-- | Convert a spill slot number to a *byte* offset, with no sign.
--
spillSlotToOffset :: DynFlags -> Int -> Int
spillSlotToOffset dflags slot
| slot >= 0 && slot < maxSpillSlots dflags
= 64 + spillSlotSize * slot
| otherwise
= pprPanic "spillSlotToOffset:"
( text "invalid spill location: " <> int slot
$$ text "maxSpillSlots: " <> int (maxSpillSlots dflags))
-- | The maximum number of spill slots available on the C stack.
-- If we use up all of the slots, then we're screwed.
--
-- Why do we reserve 64 bytes, instead of using the whole thing??
-- -- BL 2009/02/15
--
maxSpillSlots :: DynFlags -> Int
maxSpillSlots dflags
= ((spillAreaLength dflags - 64) `div` spillSlotSize) - 1
|
lukexi/ghc-7.8-arm64
|
compiler/nativeGen/SPARC/Stack.hs
|
bsd-3-clause
| 1,770
| 20
| 11
| 359
| 297
| 165
| 132
| 29
| 1
|
{-# LANGUAGE CPP #-}
module Util.ScreenSize where
import Debug.Trace
#ifndef CURSES
getScreenWidth :: IO Int
getScreenWidth = return 80
#else
import UI.HSCurses.Curses
getScreenWidth :: IO Int
getScreenWidth = do initScr
refresh
size <- scrSize
endWin
return (snd size)
#endif
|
andyarvanitis/Idris-dev
|
src/Util/ScreenSize.hs
|
bsd-3-clause
| 363
| 0
| 5
| 125
| 31
| 19
| 12
| 5
| 1
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="az-AZ">
<title>WebSockets | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm"/>
</maps>
<view>
<name>TOC</name>
<label>Contents</label>
<type>org.zaproxy.zap.extension.help.ZapTocView</type>
<data>toc.xml</data>
</view>
<view>
<name>Index</name>
<label>İndeks</label>
<type>javax.help.IndexView</type>
<data>index.xml</data>
</view>
<view>
<name>Search</name>
<label>Axtar</label>
<type>javax.help.SearchView</type>
<data engine="com.sun.java.help.search.DefaultSearchEngine">
JavaHelpSearch
</data>
</view>
<view>
<name>Favorites</name>
<label>Favorites</label>
<type>javax.help.FavoritesView</type>
</view>
</helpset>
|
thc202/zap-extensions
|
addOns/websocket/src/main/javahelp/org/zaproxy/zap/extension/websocket/resources/help_az_AZ/helpset_az_AZ.hs
|
apache-2.0
| 972
| 78
| 66
| 158
| 411
| 208
| 203
| -1
| -1
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="fil-PH">
<title>Pagsusuri sa Kontrol ng Pag-access | Ekstensyon ng ZAP</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm"/>
</maps>
<view>
<name>TOC</name>
<label>Mga Nilalaman</label>
<type>org.zaproxy.zap.extension.help.ZapTocView</type>
<data>toc.xml</data>
</view>
<view>
<name>Index</name>
<label>Indeks</label>
<type>javax.help.IndexView</type>
<data>index.xml</data>
</view>
<view>
<name>Favorites</name>
<label>Mga Paborito</label>
<type>javax.help.FavoritesView</type>
</view>
</helpset>
|
kingthorin/zap-extensions
|
addOns/accessControl/src/main/javahelp/org/zaproxy/zap/extension/accessControl/resources/help_fil_PH/helpset_fil_PH.hs
|
apache-2.0
| 802
| 63
| 54
| 125
| 354
| 177
| 177
| -1
| -1
|
Module Foo where
|
urbanslug/ghc
|
testsuite/tests/driver/bug1677/Foo.hs
|
bsd-3-clause
| 17
| 0
| 5
| 3
| 9
| 3
| 6
| -1
| -1
|
main = do putStrLn "Hello hell"
|
Bolt64/my_code
|
haskell/99_problems.hs
|
mit
| 32
| 0
| 7
| 6
| 12
| 5
| 7
| 1
| 1
|
{-# LANGUAGE ExistentialQuantification #-}
module Config.AppConfig
( AppConfig (..)
, ConfigException (..)
, getAppConfig
) where
import Config.Internal.Database (ConnectionPool, makePool)
import Config.Environment (Environment (..))
import Control.Exception (Exception, throwIO)
import Control.Monad (liftM)
import Data.Maybe (fromJust)
import Data.Text as T
import Data.Typeable (Typeable)
import Database.Types (DBAccess (..), db)
import LoadEnv
import Network.AMQP.Config (RabbitMQConfig (..))
import qualified Network.URL as URL
import qualified Network.Wai.Middleware.RequestLogger.LogEntries as LE
import System.Directory (getAppUserDataDirectory)
import qualified System.Environment as Env
import System.FilePath.Posix ((</>), (<.>))
import qualified Users.Api as UsersApi
type AppName = Text
data AppConfig = forall m. Monad m => AppConfig
{ getAppName :: AppName
, getAppBasePath :: Text
, getAppDataDirectory :: FilePath
, getPort :: Int
, getEnv :: Environment
, getLogEntriesConfig :: LE.Config
, getAuthUrl :: String
, getUsersApiConfig :: UsersApi.Config
, getDBConn :: ConnectionPool
, getDB :: DBAccess m
, getRabbitMQConfig :: RabbitMQConfig
}
data ConfigException = ConfigException Text
deriving (Show, Typeable)
instance Exception ConfigException
getAppConfig :: AppName -> Environment -> IO AppConfig
getAppConfig appName env = do
dataDirectory <- loadEnvVars appName env
port <- Env.lookupEnv "PORT"
basePath <- T.pack <$> Env.getEnv "BASEPATH"
leConfig <- logEntriesConfig
loginUrl <- loadLoginUrl
usersConfig <- usersApiConfig
dbPool <- makePool env
rabbitMQConfig <- readRabbitMQConfig
let webServerPort = maybe 8080 id (liftM read port)
return $ AppConfig
{ getAppName = appName
, getAppBasePath = basePath
, getAppDataDirectory = dataDirectory
, getPort = webServerPort
, getEnv = env
, getLogEntriesConfig = leConfig
, getAuthUrl = loginUrl
, getUsersApiConfig = usersConfig
, getDBConn = dbPool
, getDB = (db dbPool)
, getRabbitMQConfig = rabbitMQConfig
}
where
loadLoginUrl :: IO String
loadLoginUrl = do
envUrl <- authURL
case URL.importURL envUrl of
Nothing -> throwIO $ ConfigException "Unable to parse APP_AUTH_BASE_PATH"
(Just url) -> return $ URL.exportURL url
authURL :: IO String
authURL = Env.getEnv "APP_AUTH_BASE_PATH"
usersApiConfig :: IO UsersApi.Config
usersApiConfig = do
basePath <- T.pack <$> Env.getEnv "APP_USERS_API_BASE_PATH"
return $ UsersApi.Config basePath
-- The unsafe call to :fromJust is acceptable here
-- since we are bootstrapping the application.
-- If required configuration is not present and parsible,
-- then we should fail to start the app
logEntriesConfig :: IO LE.Config
logEntriesConfig = do
hostname <- Env.getEnv "APP_LOGENTRIES_DATA_DOMAIN"
port <- read <$> Env.getEnv "APP_LOGENTRIES_DATA_PORT"
token <- (fromJust . LE.fromString) <$> Env.getEnv "APP_LOGENTRIES_LOG_KEY"
return $ LE.Config hostname port token
readRabbitMQConfig :: IO RabbitMQConfig
readRabbitMQConfig =
RabbitMQConfig
<$> getEnvAsText "FC_RABBITMQ_HOST"
<*> getEnvAsText "FC_RABBITMQ_PATH"
<*> getEnvAsText "FC_RABBITMQ_USER"
<*> getEnvAsText "FC_RABBITMQ_PASS"
<*> getEnvAsText "FC_RABBITMQ_EXCHANGE_NAME"
getEnvAsText :: String -> IO Text
getEnvAsText varName = T.pack <$> (Env.getEnv varName)
-- laodEnvVars will look for configuration files matching the lowercase
-- environment name in the user's data directory
-- Ex. if the app name is 'cool-app' and the environment is Production,
-- the env vars will be loaded from ~/.cool-app/production.env
-- loadEnvVars will NOT raise an exception if the environment file is not found
loadEnvVars :: AppName -> Environment -> IO FilePath
loadEnvVars appName env = dataDirectory appName >>= \dataDir ->
let filePath = dataDir </> envName env <.> "env"
in loadEnvFrom filePath >> return dataDir
where
envName :: Environment -> FilePath
envName = T.unpack . toLower . T.pack . show
dataDirectory :: AppName -> IO FilePath
dataDirectory = getAppUserDataDirectory . T.unpack
|
gust/feature-creature
|
feature-creature/backend/src/Config/AppConfig.hs
|
mit
| 4,400
| 0
| 14
| 960
| 971
| 532
| 439
| 96
| 2
|
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
import Control.Monad.IO.Class (liftIO)
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString.Lazy as L
import System.Environment (getArgs)
import qualified Data.Text as T
import qualified Data.Enumerator as E
import qualified Data.Enumerator.Binary as EB
import qualified Data.Enumerator.List as EL
import Data.XML.Types
import Text.XML.Expat.Tree
import Text.XML.Expat.Proc
import Text.XML.Expat.Enumerator
enumXML :: FilePath -> E.Enumerator Event IO b
enumXML path =
E.joinE (EB.enumFile path) $ parseBytesIO Nothing
parseRes :: (Num b, Monad m) => b -> E.Iteratee Event m b
parseRes count = do
x <- EL.head
case x of
Just (EventContent c) -> case c of
ContentText t -> do
-- liftIO $ print t
parseRes (1+count)
_ -> parseRes count
Nothing -> return count
_ -> parseRes count
main = do
f:_ <- getArgs
test f
test :: FilePath -> IO ()
test path = do
res <- E.run_ (enumXML path E.$$ parseRes 0)
print res
|
f-me/xlsx-parser
|
temp/expat-enum.hs
|
mit
| 1,297
| 0
| 17
| 406
| 361
| 198
| 163
| 35
| 4
|
-- Floating-point Approximation (II)
-- https://www.codewars.com/kata/581ee0db1bbdd04e010002fd
module Codewars.G964.Approxinter where
interp :: (Double -> Double) -> Double -> Double -> Int -> [Double]
interp f l u n = map ((/100) . fromInteger . floor . (*100) . (/100000) . fromInteger . round . (* 100000) . f) . take n $ [l,l+((u - l) / fromIntegral n)..]
|
gafiatulin/codewars
|
src/6 kyu/Approxinter.hs
|
mit
| 362
| 0
| 17
| 59
| 146
| 82
| 64
| 3
| 1
|
module Main where
import Control.Monad (unless)
import Data.IORef
import Graphics.Rendering.OpenGL
import Graphics.GLUtil
import Graphics.UI.GLUT hiding (exit)
import Foreign.Marshal.Array (withArray)
import Foreign.Storable (sizeOf)
import System.Exit (exitFailure)
import Hogldev.Math3D (scaleMatrix)
main :: IO ()
main = do
getArgsAndInitialize
initialDisplayMode $= [DoubleBuffered, RGBAMode]
initialWindowSize $= Size 1024 768
initialWindowPosition $= Position 100 100
createWindow "Tutorial 08"
vbo <- createVertexBuffer
gWorldLocation <- compileShaders
gScale <- newIORef 0.0
initializeGlutCallbacks vbo gWorldLocation gScale
clearColor $= Color4 0 0 0 0
mainLoop
initializeGlutCallbacks :: BufferObject
-> UniformLocation
-> IORef GLfloat
-> IO ()
initializeGlutCallbacks vbo gWorldLocation gScale = do
displayCallback $= renderSceneCB vbo gWorldLocation gScale
idleCallback $= Just (idleCB gScale)
idleCB :: IORef GLfloat -> IdleCallback
idleCB gScale = do
gScale $~! (+ 0.001)
postRedisplay Nothing
createVertexBuffer :: IO BufferObject
createVertexBuffer = do
vbo <- genObjectName
bindBuffer ArrayBuffer $= Just vbo
withArray vertices $ \ptr ->
bufferData ArrayBuffer $= (size, ptr, StaticDraw)
return vbo
where
vertices :: [Vertex3 GLfloat]
vertices = [ Vertex3 (-1) (-1) 0
, Vertex3 1 (-1) 0
, Vertex3 0 1 0 ]
numVertices = length vertices
vertexSize = sizeOf (head vertices)
size = fromIntegral (numVertices * vertexSize)
compileShaders :: IO UniformLocation
compileShaders = do
shaderProgram <- createProgram
addShader shaderProgram "tutorial08/shader.vs" VertexShader
addShader shaderProgram "tutorial08/shader.fs" FragmentShader
linkProgram shaderProgram
linkStatus shaderProgram >>= \ status -> unless status $ do
errorLog <- programInfoLog shaderProgram
putStrLn $ "Error linking shader program: '" ++ errorLog ++ "'"
exitFailure
validateProgram shaderProgram
validateStatus shaderProgram >>= \ status -> unless status $ do
errorLog <- programInfoLog shaderProgram
putStrLn $ "Invalid shader program: '" ++ errorLog ++ "'"
exitFailure
currentProgram $= Just shaderProgram
uniformLocation shaderProgram "gWorld"
addShader :: Program -> FilePath -> ShaderType -> IO ()
addShader shaderProgram shaderFile shaderType = do
shaderText <- readFile shaderFile
shaderObj <- createShader shaderType
shaderSourceBS shaderObj $= packUtf8 shaderText
compileShader shaderObj
compileStatus shaderObj >>= \ status -> unless status $ do
errorLog <- shaderInfoLog shaderObj
putStrLn ("Error compiling shader type " ++ show shaderType
++ ": '" ++ errorLog ++ "'")
exitFailure
attachShader shaderProgram shaderObj
renderSceneCB :: BufferObject
-> UniformLocation
-> IORef GLfloat
-> DisplayCallback
renderSceneCB vbo gWorldLocation gScale = do
clear [ColorBuffer]
gScaleVal <- readIORef gScale
uniformMat gWorldLocation $=
scaleMatrix (Vector3 (sin gScaleVal) (cos gScaleVal) (sin gScaleVal))
vertexAttribArray vPosition $= Enabled
bindBuffer ArrayBuffer $= Just vbo
vertexAttribPointer vPosition $=
(ToFloat, VertexArrayDescriptor 3 Float 0 offset0)
drawArrays Triangles 0 3
vertexAttribArray vPosition $= Disabled
swapBuffers
where
vPosition = AttribLocation 0
|
triplepointfive/hogldev
|
tutorial08/Tutorial08.hs
|
mit
| 3,743
| 0
| 18
| 976
| 958
| 451
| 507
| 94
| 1
|
-- | Handler for the 'tick' command.
module Commands.Tick.Handler
( handleTickCommand
) where
import Types
import Util
import Parsing
import TodoLenses
import Commands.What.Handler
import Commands.Common
import Text.Read (readMaybe)
import Data.Char (ord)
import Control.Monad (unless)
import Control.Exception (throwIO)
handleTickCommand :: Command -> IO ()
handleTickCommand (Tick category) = do
todoList <- parseWith parseTodoList <$> readFile "todo/list.txt"
case todoList of
Right oldList -> loop oldList category
Left err -> throwIO (ParseException err)
where loop list cat = do
printGroups list [cat]
input <- prompt "\nTask or item to be ticked: "
unless (input == "") $ do
let newList = case input of
[taskIxS] -> do
let taskIxM = readMaybe [taskIxS] :: Maybe Int
case taskIxM of
Just taskIx -> tickTask list category (taskIx - 1)
Nothing -> list
[taskIxS, itemIxC] -> do
let taskIxM = readMaybe [taskIxS] :: Maybe Int
itemIx = ord itemIxC - ord 'a'
case taskIxM of
Just taskIx -> tickItem list category (taskIx - 1) itemIx
Nothing -> list
_ -> list
updateTodoList newList
loop newList cat
|
DimaSamoz/thodo
|
src/Commands/Tick/Handler.hs
|
mit
| 1,565
| 0
| 25
| 636
| 395
| 197
| 198
| 37
| 6
|
{-# LANGUAGE OverloadedStrings #-}
-- Generate a palindrom JSON machine from a provided alphabet.
module Main where
import System.Environment
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as B (readFile)
import qualified Data.Text.Lazy as T (Text)
import Text.Printf (printf)
import Turing
import qualified Data.Map.Strict as Map
type Symbol = String
type TState = String
type Alphabet = [Symbol]
buildReadFirstCharSt :: Alphabet -> Int -> Transition -> [Transition]
buildReadFirstCharSt [] _ _ = []
buildReadFirstCharSt a:as skSymLen skelTrans =
let Transition _ toSt iniSym act = skelTrans
aGoLastSt = (a : drop skSymLen toSt) in
Transition a aGoLastSt iniSym act :
buildReadFirstCharSt as iniSym skelTrans
buildXGoLastSt :: Alphabet -> (Symbol, Symbol, Int) -> (Transition, Transition) -> [Transition]
buildXGoLastSt [] (sym, endSym, blank, skSymLen) (_, chkLastSkTr) =
let Transition _ toSt _ act = chkLastSkTr in
[Transition endSym (sym : drop skSymLen toSt) blank act]
buildXGoLastSt a:as syms@(sym, _, _, skSymLen) skTrans@(goLastSkTr, _) =
let Transition _ toSt _ act = goLastSkTr in
Transition endSym (sym : drop skSymLen toSt) blank act :
buildXGoLastSt as syms skTrans
buildXCheckLastSt :: Alphabet -> Symbol -> (Transition, Transition) -> [Transition]
buildXCheckLastSt [] xSym (_, Transition _ toGoFirst endSym act) =
[Transition xSym toGoFirst endSym act]
buildXCheckLastSt a:as xSym trans@(skelBadReadTr, _) = if a == xSym
then nextOne
else Transition a toWrNSt a act : nextOne
where
Transition _ toWrNSt _ act = skelBadReadTr
nextOne = buildXCheckLastSt as xSym trans
buildGoFirstSt :: Alphabet -> (Transition, Transition) -> [Transition]
buildGoFirstSt [] (_, fromStartTr) =
let Transition startSym toChkEnd0St _ act = fromXTr in
[Transition startSym toChkEnd0St startSym act]
buildGoFirstSt a:as trans@(fromXTr, _) =
let Transition _ toGoFirstSt _ act = fromXTr in
Transition a toGoFirstSt a act :
buildGoFirstSt as trans
-- builds check_end0 and check_end1 transition sets.
buildCheckEndYSt :: Alphabet -> (Transition, Transition) -> [Transition]
buildCheckEndYSt [] (_, atEndTr) = [atEndTr]
buildCheckEndYSt a:as trans@(fromXTr, _) =
let Transition _ toXStateSt _ act = fromXTr in
Transition a toXStateSt a act :
buildCheckEndYSt as trans
buildGoFirstOkSt :: Alphabet -> (Transition, Transition) -> [Transition]
buildGoFirstOkSt [] (_, atStartTr) = atStartTr:[]
buildGoFirstOkSt a:as trans@(fromXTr, _) =
let Transition _ toGoFirstSt _ act = fromXTr in
Transition a toGoFirstSt a act :
buildGoFirstOkSt as trans
-- build write_y and write_n transition sets.
buildWriteYesNoTr :: Alphabet -> (Transition, [Transition]) -> [Transition]
buildWriteYesNoTr [] (_, constantBundle) = constantBundle
buildWriteYesNoTr a:as trans@(fromXTr, _) =
let Transition _ toWrNSt _ act = fromXTr in
Transition a toWrNSt a act :
buildWriteYesNoTr as trans
buildTrans _ _ [] = []
buildTrans blank e@(i,f) a:as = : buildTrans blank e as
where
state_seek_end = a ++ "_seek_end"
state_find_last = a ++ "_find_last"
seek_end_trans = Transition f state_find_last f "LEFT" :
states =
buildMachine :: Alphabet -> Machine -> Machine
buildMachine alpha skel = Machine nameM nuAlpha (blank skel) FUBAR initalM finalsM transitionsM
where
nameM = "generated_palindrome"
skelSym = head $ alphabet skel
nuAlpha = alpha ++ tail (alphabet skel)
statesM = drop 2 $ states skel
skelStates = (drop (length skelSym)) <$> (take 2 $ states skel)
initialM = "init"
finalsM = ["HALT"]
nuStatesM = (++) <$> alpha <*> fmap head (replicate (length alpha) skelStates)
skelTrans = transitions skel
transitionsM = M.fromList $
usage = do
p <- getProgName
fail $ printf "Usage: %s <Separator> <Alphabet>\n" p
readSkeleton :: IO Machine
readSkeleton = do
dump <- B.readFile "generators/palindrome_skel.json"
let parsed = Aeson.eitherDecode dump :: Either String Machine
failure = (fail $ head $ lefts parsed) >> undefined
in either failure (return (head $ rights parsed))
main = do
skelMachine <- readSkeleton
[blank, rawAlpha] <- getArgs >>= \as -> case length as of
2 -> return (T.pack <$> as)
_ -> usage >> undefined
let alphabet = T.unpack <$> T.splitOn blank rawAlpha
buildMachine (T.unpack blank) alphabet skelMachine
-- WIP
|
range12/there-is-no-B-side
|
tools/generators/Palindrome/GenPalindromeMachine.hs
|
mit
| 4,536
| 67
| 14
| 931
| 833
| 578
| 255
| -1
| -1
|
-- First Variation on Caesar Cipher
-- http://www.codewars.com/kata/5508249a98b3234f420000fb/
module Codewars.Kata.CaesarCipher (demovingShift, movingShift) where
import Data.Char (chr, ord)
import Data.List.Split (chunksOf)
demovingShift :: [String] -> Int -> String
demovingShift xs shift = zipWith (curry f) (concat xs) (map negate [shift, shift+1 ..])
movingShift :: String -> Int -> [String]
movingShift s shift = if length strs == 4 then strs ++ [""] else strs
where strs = chunksOf (ceiling . (/5) . fromIntegral . length $ s) . zipWith (curry f) s $ [shift, shift+1 ..]
f (c, s) | c `elem` ['a'..'z'] = shift c 'a' s
| c `elem` ['A'..'Z'] = shift c 'A' s
| otherwise = c
where shift c a s = chr . (ord a +) . (`mod` 26) $ (ord c - ord a + s)
|
gafiatulin/codewars
|
src/5 kyu/CaesarCipher.hs
|
mit
| 794
| 0
| 15
| 176
| 346
| 189
| 157
| 12
| 2
|
module Database.Toy.Internal.Util.FixedSizeSerialize where
import Data.Serialize (Serialize)
import Database.Toy.Internal.Prelude
import Foreign.Storable (sizeOf)
-- | Typeclass that guarantees that size of serialized
-- object would be the same for any instance of object
class Serialize a => FixedSizeSerialize a where
-- | Return size of serialized instance in bytes. Function
-- argument is unused.
serializedSize :: a -> Int
instance FixedSizeSerialize Word8 where
serializedSize = sizeOf
instance FixedSizeSerialize Word16 where
serializedSize = sizeOf
instance FixedSizeSerialize Word32 where
serializedSize = sizeOf
|
dancingrobot84/toydb
|
src/Database/Toy/Internal/Util/FixedSizeSerialize.hs
|
mit
| 654
| 0
| 7
| 108
| 104
| 61
| 43
| 12
| 0
|
module Y2018.M06.D15.Solution where
{--
More dater today, but with a dater-fix, too!
The tab-separated file (tsv) in this directory is a report of all duplicates-
by-article_id in our article database. Your job is to find all the 'older'
ids (not article_id) of the articles and create a SQL DELETE statement to
purge the database of these pesky duplicates!
(play Mission: Improbably theme-song)
--}
import Control.Arrow ((&&&))
import Data.Function (on)
import Data.List (sort, groupBy)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Monoid
import Data.Time (Day)
-- below import available via 1HaskellADay git repostiory
import Control.List (weave)
import Control.Scan.CSV (rend) -- hint: maybe use this function
exDir, tsvFile :: FilePath
exDir = "Y2018/M06/D15/"
tsvFile = "duplicates.tsv"
-- the daters are:
type ArticleId = String
type Idx = Integer
data Article =
Art { idx :: Idx, uuid :: ArticleId, title :: String,
published, updated :: Maybe Day }
deriving (Eq, Show)
readArticleDuplicates :: FilePath -> IO [Article]
readArticleDuplicates =
fmap (map (line2Art . rend '\t') . tail . lines) . readFile
line2Art :: [String] -> Article
line2Art [idx,artId,pub,upd,titl] =
Art (read idx) artId titl (s2d pub) (s2d upd)
line2Art x = error ("Couldn't read line '" ++ show x ++ "'")
-- converts a string to a date
s2d :: String -> Maybe Day
s2d "" = Nothing
s2d d@(_:_) = Just (read d)
{--
>>> arts <- readArticleDuplicates (exDir ++ tsvFile)
>>> length arts
4723
>>> take 2 arts
[Art {idx = 275322, uuid = "08cf5409-52c9-59e7-a9ba-a46f6506ffb6",
title = "Live scoreboard: High school playoffs",
published = Just 2018-06-08, updated = Just 2018-06-08},
Art {idx = 275116, uuid = "46a8198e-1653-5bb8-b992-8bb4dd5c67c1",
title = "Hurricanes come, but the residents of Hatteras Island wouldn't dream of leaving.",
published = Just 2018-06-05, updated = Just 2018-06-06}]
Given the following ordering-precedence:
uuid
published
updateed
idx
define the Ord instance of Article
Note:
>>> Just 5 > Just 3
True
>>> Just 5 > Nothing
True
is the behavior I want
--}
instance Ord Article where
compare (Art i1 a1 _ p1 u1) (Art i2 a2 _ p2 u2) =
compare a1 a2 <> compare p1 p2 <> compare u1 u2 <> compare i1 i2
-- I need a compare-but-if-it-is-equal-then-do-the-subcompare-function ...
-- good thing Ordering has a Monoid instance
-- now that you have the Ord instance, sort the articles in order by article_id
sortedArticles :: [Article] -> Map ArticleId [Article]
sortedArticles =
Map.fromList . map (uuid . head &&& id) . groupBy ((==) `on` uuid) . sort
-- Some helper functions for showing results
st :: Show a => a -> String
st = take 10 . show
-- 'st' for 'show 10'
mb2s :: Show a => Maybe a -> String
mb2s = maybe "" st
-- 'mb2s' for 'maybe to string'
nt :: Article -> String
nt (Art i a t p u) =
"Art " ++ weave [show i, take 20 a, take 20 t, mb2s p, mb2s u]
-- 'nt' for something I don't remember.
-- I'M PROGRAMMING IN FORTH AGAIN!
{--
>>> mapM_ putStrLn . take 5 . concat . Map.elems $ Map.map (map nt) (sortedArticles arts)
Art 220829,0057e006-ec63-58fb-a,Seriously, who needs,2008-04-28,
Art 220837,0057e006-ec63-58fb-a,Seriously, who needs,2008-04-28,
Art 214131,00d45ed5-8c1d-53d8-8,Virginia Beach man d,2008-07-10,
Art 216001,00d45ed5-8c1d-53d8-8,Virginia Beach man d,2008-07-10,
Art 214908,00d70c0a-6143-5923-a,Fire damages Newport,2008-06-24,2015-11-06
>>> mapM_ (putStrLn . nt) $ take 5 arts
Art 275322,08cf5409-52c9-59e7-a,Live scoreboard: Hig,2018-06-08,2018-06-08
Art 275116,46a8198e-1653-5bb8-b,Hurricanes come, but,2018-06-05,2018-06-06
Art 274844,e5decfb4-1cc5-52f8-a,Is your startup read,2018-05-30,2018-05-31
Art 274502,fe997d65-9969-5b4a-8,Rankings | Top 10 ba,2018-05-21,
Art 274497,fa8c30e6-b8e4-5009-b,Final rankings: Top ,2018-05-21,2018-05-21
So, the sorting worked. Are there any elements of the map that have 1 or less
articles?
>>> Map.filter ((< 2) . length) (sortedArticles arts)
fromList []
Nope. So we're good there. Let's finish up.
--}
-- and from that sorting, write the following SQL DELETE statement that deletes
-- duplicates of article_id that are 'older' that the most recent-one
deleteStmt :: [Idx] -> String
deleteStmt ids = "DELETE FROM article WHERE id IN (" ++ listOut ids ++ ")"
listOut :: Show a => [a] -> String
listOut = weave . map show
duplicateIds :: [Article] -> [Idx]
duplicateIds = map idx . tail . reverse
{--
>>> take 75 . deleteStmt . concat . Map.elems . Map.map duplicateIds
$ sortedArticles arts
"DELETE FROM article WHERE id IN (220829,214131,214908,214684,214799,213243,"
--}
|
geophf/1HaskellADay
|
exercises/HAD/Y2018/M06/D15/Solution.hs
|
mit
| 4,682
| 0
| 13
| 825
| 747
| 413
| 334
| -1
| -1
|
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE PatternSynonyms #-}
module U.Codebase.Reference where
import Data.Text (Text)
import Data.Word (Word64)
import qualified U.Util.Hash as Hash
import U.Util.Hash (Hash)
import U.Util.Hashable (Hashable (..))
import qualified U.Util.Hashable as Hashable
import Control.Lens (lens, Lens, Bifunctor(..), Traversal)
import Data.Bitraversable (Bitraversable(..))
import Data.Bifoldable (Bifoldable(..))
-- |This is the canonical representation of Reference
type Reference = Reference' Text Hash
type Id = Id' Hash
data Reference' t h
= ReferenceBuiltin t
| ReferenceDerived (Id' h)
deriving (Eq, Ord, Show)
pattern Derived :: h -> Pos -> Reference' t h
pattern Derived h i = ReferenceDerived (Id h i)
{-# COMPLETE ReferenceBuiltin, Derived #-}
type Pos = Word64
data Id' h = Id h Pos
deriving (Eq, Ord, Show, Functor, Foldable, Traversable)
t :: Traversal (Reference' t h) (Reference' t' h) t t'
t f = \case
ReferenceBuiltin t -> ReferenceBuiltin <$> f t
ReferenceDerived id -> pure (ReferenceDerived id)
h :: Traversal (Reference' t h) (Reference' t h') h h'
h f = \case
ReferenceBuiltin t -> pure (ReferenceBuiltin t)
Derived h i -> Derived <$> f h <*> pure i
idH :: Lens (Id' h) (Id' h') h h'
idH = lens (\(Id h _w) -> h) (\(Id _h w) h -> Id h w)
instance Bifunctor Reference' where
bimap f _ (ReferenceBuiltin t) = ReferenceBuiltin (f t)
bimap _ g (ReferenceDerived id) = ReferenceDerived (g <$> id)
instance Bifoldable Reference' where
bifoldMap f _ (ReferenceBuiltin t) = f t
bifoldMap _ g (ReferenceDerived id) = foldMap g id
instance Bitraversable Reference' where
bitraverse f _ (ReferenceBuiltin t) = ReferenceBuiltin <$> f t
bitraverse _ g (ReferenceDerived id) = ReferenceDerived <$> traverse g id
instance Hashable Reference where
tokens (ReferenceBuiltin txt) =
[Hashable.Tag 0, Hashable.Text txt]
tokens (ReferenceDerived (Id h i)) =
[Hashable.Tag 1, Hashable.Bytes (Hash.toBytes h), Hashable.Nat i]
instance Hashable (Reference' Text (Maybe Hash)) where
tokens (ReferenceBuiltin txt) =
[Hashable.Tag 0, Hashable.Text txt]
tokens (ReferenceDerived (Id h i)) =
[Hashable.Tag 1, Hashable.accumulateToken h, Hashable.Nat i]
|
unisonweb/platform
|
codebase2/codebase/U/Codebase/Reference.hs
|
mit
| 2,376
| 0
| 10
| 411
| 873
| 460
| 413
| 57
| 2
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Graphics.Urho3D.Math.Matrix4(
Matrix4(..)
, HasRow1(..)
, HasRow2(..)
, HasRow3(..)
, HasRow4(..)
, matrix4Context
, loadMatrix4
) where
import qualified Language.C.Inline as C
import qualified Language.C.Inline.Cpp as C
import Graphics.Urho3D.Creatable
import Graphics.Urho3D.Math.Internal.Matrix4
import Graphics.Urho3D.Math.Vector4
import Graphics.Urho3D.Monad
import Data.Monoid
import Foreign
import Text.RawString.QQ
import Control.DeepSeq
C.context (C.cppCtx <> matrix4Cntx)
C.include "<Urho3D/Math/Matrix4.h>"
C.using "namespace Urho3D"
matrix4Context :: C.Context
matrix4Context = matrix4Cntx
C.verbatim [r|
template <class T>
class Traits
{
public:
struct AlignmentFinder
{
char a;
T b;
};
enum {AlignmentOf = sizeof(AlignmentFinder) - sizeof(T)};
};
|]
instance Storable Matrix4 where
sizeOf _ = fromIntegral $ [C.pure| int { (int)sizeof(Matrix4) } |]
alignment _ = fromIntegral $ [C.pure| int { (int)Traits<Matrix4>::AlignmentOf } |]
peek ptr = do
m00 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m00_ } |]
m01 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m01_ } |]
m02 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m02_ } |]
m03 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m03_ } |]
m10 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m10_ } |]
m11 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m11_ } |]
m12 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m12_ } |]
m13 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m13_ } |]
m20 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m20_ } |]
m21 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m21_ } |]
m22 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m22_ } |]
m23 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m23_ } |]
m30 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m30_ } |]
m31 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m31_ } |]
m32 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m32_ } |]
m33 <- realToFrac <$> [C.exp| float { $(Matrix4* ptr)->m33_ } |]
return $ Matrix4 (Vector4 m00 m01 m02 m03) (Vector4 m10 m11 m12 m13) (Vector4 m20 m21 m22 m23) (Vector4 m30 m31 m32 m33)
poke ptr (Matrix4 (Vector4 m00 m01 m02 m03) (Vector4 m10 m11 m12 m13) (Vector4 m20 m21 m22 m23) (Vector4 m30 m31 m32 m33)) = [C.block| void {
$(Matrix4* ptr)->m00_ = $(float m00');
$(Matrix4* ptr)->m01_ = $(float m01');
$(Matrix4* ptr)->m02_ = $(float m02');
$(Matrix4* ptr)->m03_ = $(float m03');
$(Matrix4* ptr)->m10_ = $(float m10');
$(Matrix4* ptr)->m11_ = $(float m11');
$(Matrix4* ptr)->m12_ = $(float m12');
$(Matrix4* ptr)->m13_ = $(float m13');
$(Matrix4* ptr)->m20_ = $(float m20');
$(Matrix4* ptr)->m21_ = $(float m21');
$(Matrix4* ptr)->m22_ = $(float m22');
$(Matrix4* ptr)->m23_ = $(float m23');
$(Matrix4* ptr)->m30_ = $(float m30');
$(Matrix4* ptr)->m31_ = $(float m31');
$(Matrix4* ptr)->m32_ = $(float m32');
$(Matrix4* ptr)->m33_ = $(float m33');
} |]
where
m00' = realToFrac m00
m01' = realToFrac m01
m02' = realToFrac m02
m03' = realToFrac m03
m10' = realToFrac m10
m11' = realToFrac m11
m12' = realToFrac m12
m13' = realToFrac m13
m20' = realToFrac m20
m21' = realToFrac m21
m22' = realToFrac m22
m23' = realToFrac m23
m30' = realToFrac m30
m31' = realToFrac m31
m32' = realToFrac m32
m33' = realToFrac m33
-- | Helper that frees memory after loading
loadMatrix4 :: IO (Ptr Matrix4) -> IO Matrix4
loadMatrix4 io = do
qp <- io
q <- peek qp
q `deepseq` [C.exp| void { delete $(Matrix4* qp) } |]
return q
instance Creatable (Ptr Matrix4) where
type CreationOptions (Ptr Matrix4) = Matrix4
newObject = liftIO . new
deleteObject = liftIO . free
|
Teaspot-Studio/Urho3D-Haskell
|
src/Graphics/Urho3D/Math/Matrix4.hs
|
mit
| 3,948
| 0
| 11
| 870
| 883
| 496
| 387
| -1
| -1
|
module MoleculeToAtoms where
import Text.ParserCombinators.Parsec
import qualified Data.Map as M
data AST = Ele String
| Count AST Int
| Str [AST]
deriving (Show)
parseMol :: Parser AST
parseMol = do
e <- parseCount
es <- many parseCount
return $ if null es then e else Str (e:es)
parseCount :: Parser AST
parseCount = do
e <- parseTerm
try (parseInt >>= \i -> return (Count e i)) <|> return e
where
parseInt = read <$> many1 digit
parseTerm :: Parser AST
parseTerm = parseEle
<|> char '(' *> parseMol <* char ')'
<|> char '[' *> parseMol <* char ']'
<|> char '{' *> parseMol <* char '}'
parseEle :: Parser AST
parseEle = do
a <- upper
try (lower >>= \b -> return (Ele (a:b:""))) <|> return (Ele (a:""))
eval :: AST -> [(String, Int)]
eval ast = M.assocs $ f ast empty
where
empty = M.empty :: M.Map String Int
f :: AST -> M.Map String Int -> M.Map String Int
f (Ele s) m = M.insertWith (+) s 1 m
f (Count e i) m = M.unionWith (+) (M.map (* i) (f e empty)) m
f (Str es) m = M.unionsWith (+) $ map (\e -> f e empty) es
parseMolecule :: String -> Either String [(String, Int)]
parseMolecule s = case parse parseMol "" s of
Left _ -> Left "Not a valid molecule"
Right ast -> Right $ eval ast
|
delta4d/codewars
|
kata/molecule-to-atoms/MoleculeToAtoms.hs
|
mit
| 1,361
| 0
| 17
| 407
| 600
| 305
| 295
| 37
| 3
|
-- | Athena.Utils.Monads utilities.
-- Adapted from https://github.com/asr/apia.
{-# LANGUAGE UnicodeSyntax #-}
module Athena.Utils.Monad
( die
, failureMsg
, stdout2file
) where
------------------------------------------------------------------------------
import Athena.Utils.PrettyPrint ( Doc, prettyShow )
import System.Environment ( getProgName )
import System.Exit ( exitFailure )
import GHC.IO.Handle ( hDuplicateTo )
import System.IO
( hPutStrLn
, stderr
, IOMode(WriteMode)
, stdout
, openFile
)
------------------------------------------------------------------------------
-- | Failure message.
failureMsg ∷ Doc → IO ()
failureMsg err =
getProgName >>= \prg → hPutStrLn stderr $ prg ++ ": " ++ prettyShow err
-- | Exit with an error message.
die ∷ Doc → IO a
die err = failureMsg err >> exitFailure
-- | Redirect all stdout output into a file or do nothing (in case of
-- 'Nothing')
stdout2file ∷ Maybe FilePath → IO ()
stdout2file Nothing = return ()
stdout2file (Just o) = openFile o WriteMode >>= flip hDuplicateTo stdout
|
jonaprieto/athena
|
src/Athena/Utils/Monad.hs
|
mit
| 1,096
| 0
| 10
| 191
| 232
| 130
| 102
| 23
| 1
|
import Test.Hspec (Spec, it, shouldBe)
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
import SecretHandshake (handshake)
main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs
specs :: Spec
specs = do
it "wink for 1" $
handshake (1 :: Int) `shouldBe` ["wink"]
it "double blink for 10" $
handshake (2 :: Int) `shouldBe` ["double blink"]
it "close your eyes for 100" $
handshake (4 :: Int) `shouldBe` ["close your eyes"]
it "jump for 1000" $
handshake (8 :: Int) `shouldBe` ["jump"]
it "combine two actions" $
handshake (3 :: Int) `shouldBe` ["wink", "double blink"]
it "reverse two actions" $
handshake (19 :: Int) `shouldBe` ["double blink", "wink"]
it "reversing one action gives the same action" $
handshake (24 :: Int) `shouldBe` ["jump"]
it "reversing no actions still gives no actions" $
handshake (16 :: Int) `shouldBe` []
it "all possible actions" $
handshake (15 :: Int) `shouldBe` ["wink", "double blink", "close your eyes", "jump"]
it "reverse all possible actions" $
handshake (31 :: Int) `shouldBe` ["jump", "close your eyes", "double blink", "wink"]
it "do nothing for zero" $
handshake (0 :: Int) `shouldBe` []
it "do nothing if lower 5 bits not set" $
handshake (32 :: Int) `shouldBe` []
|
c19/Exercism-Haskell
|
secret-handshake/test/Tests.hs
|
mit
| 1,386
| 0
| 10
| 342
| 437
| 240
| 197
| 31
| 1
|
-- | `MonadTimed` related helper functions.
module Control.TimeWarp.Timed.Misc
( repeatForever
, sleepForever
) where
import Control.Concurrent.STM.TVar (newTVarIO, readTVarIO, writeTVar)
import Control.Exception.Base (SomeException)
import Control.Monad (forever)
import Control.Monad.Catch (MonadCatch, catch)
import Control.Monad.STM (atomically)
import Control.Monad.Trans (MonadIO, liftIO)
import Control.TimeWarp.Timed.MonadTimed (Microsecond, MonadTimed, for, fork_,
minute, ms, startTimer, wait)
-- | Repeats an action periodically.
-- If it fails, handler is invoked, determining delay before retrying.
-- Can be interrupted with asynchronous exception.
repeatForever
:: (MonadTimed m, MonadIO m, MonadCatch m)
=> Microsecond -- ^ Period between action launches
-> (SomeException -> m Microsecond) -- ^ What to do on exception,
-- returns delay before retrying
-> m () -- ^ Action
-> m ()
repeatForever period handler action = do
timer <- startTimer
nextDelay <- liftIO $ newTVarIO Nothing
fork_ $
let setNextDelay = liftIO . atomically . writeTVar nextDelay . Just
action' =
action >> timer >>= \passed -> setNextDelay (period - passed)
handler' e = handler e >>= setNextDelay
in action' `catch` handler'
waitForRes nextDelay
where
continue = repeatForever period handler action
waitForRes nextDelay = do
wait $ for 10 ms
res <- liftIO $ readTVarIO nextDelay
case res of
Nothing -> waitForRes nextDelay
Just t -> wait (for t) >> continue
-- | Sleep forever.
-- TODO: would be better to use `MVar` to block thread
sleepForever :: MonadTimed m => m ()
sleepForever = forever $ wait (for 100500 minute)
|
serokell/time-warp
|
src/Control/TimeWarp/Timed/Misc.hs
|
mit
| 2,086
| 0
| 16
| 708
| 439
| 237
| 202
| 36
| 2
|
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Builder (string8)
import Control.Concurrent (forkIO, threadDelay)
import Control.Concurrent.Chan
import Control.Monad
import Data.Time.Clock.POSIX (getPOSIXTime)
import Network.HTTP.Types (status200)
import Network.Wai (Application, Middleware, pathInfo, responseFile)
import Network.Wai.EventSource (ServerEvent(..), eventSourceAppChan, eventSourceAppIO)
import Network.Wai.Handler.Warp (run)
import Network.Wai.Middleware.AddHeaders (addHeaders)
import Network.Wai.Middleware.Gzip (gzip, def)
app :: Chan ServerEvent -> Application
app chan req respond =
case pathInfo req of
[] -> respond $ responseFile status200 [("Content-Type", "text/html")] "example/index.html" Nothing
["esold"] -> eventSourceAppChan chan req respond
["eschan"] -> eventSourceAppChan chan req respond
["esio"] -> eventSourceAppIO eventIO req respond
_ -> error "unexpected pathInfo"
eventChan :: Chan ServerEvent -> IO ()
eventChan chan = forever $ do
threadDelay 1000000
time <- getPOSIXTime
writeChan chan (ServerEvent Nothing Nothing [string8 . show $ time])
eventIO :: IO ServerEvent
eventIO = do
threadDelay 1000000
time <- getPOSIXTime
return $ ServerEvent (Just $ string8 "io")
Nothing
[string8 . show $ time]
main :: IO ()
main = do
chan <- newChan
_ <- forkIO . eventChan $ chan
run 8080 (gzip def $ headers $ app chan)
where
-- headers required for SSE to work through nginx
-- not required if using warp directly
headers :: Middleware
headers = addHeaders [ ("X-Accel-Buffering", "no")
, ("Cache-Control", "no-cache")
]
|
creichert/wai
|
wai-extra/example/Main.hs
|
mit
| 1,808
| 0
| 13
| 427
| 489
| 265
| 224
| 41
| 5
|
{-# htermination (notElemChar :: Char -> (List Char) -> MyBool) #-}
import qualified Prelude
data MyBool = MyTrue | MyFalse
data List a = Cons a (List a) | Nil
data Char = Char MyInt ;
data MyInt = Pos Nat | Neg Nat ;
data Nat = Succ Nat | Zero ;
asAs :: MyBool -> MyBool -> MyBool;
asAs MyFalse x = MyFalse;
asAs MyTrue x = x;
foldr :: (a -> b -> b) -> b -> (List a) -> b;
foldr f z Nil = z;
foldr f z (Cons x xs) = f x (foldr f z xs);
and :: (List MyBool) -> MyBool;
and = foldr asAs MyTrue;
map :: (a -> b) -> (List a) -> (List b);
map f Nil = Nil;
map f (Cons x xs) = Cons (f x) (map f xs);
pt :: (a -> c) -> (b -> a) -> b -> c;
pt f g x = f (g x);
all :: (a -> MyBool) -> (List a) -> MyBool;
all p = pt and (map p);
primEqNat :: Nat -> Nat -> MyBool;
primEqNat Zero Zero = MyTrue;
primEqNat Zero (Succ y) = MyFalse;
primEqNat (Succ x) Zero = MyFalse;
primEqNat (Succ x) (Succ y) = primEqNat x y;
primEqInt :: MyInt -> MyInt -> MyBool;
primEqInt (Pos (Succ x)) (Pos (Succ y)) = primEqNat x y;
primEqInt (Neg (Succ x)) (Neg (Succ y)) = primEqNat x y;
primEqInt (Pos Zero) (Neg Zero) = MyTrue;
primEqInt (Neg Zero) (Pos Zero) = MyTrue;
primEqInt (Neg Zero) (Neg Zero) = MyTrue;
primEqInt (Pos Zero) (Pos Zero) = MyTrue;
primEqInt vv vw = MyFalse;
primEqChar :: Char -> Char -> MyBool;
primEqChar (Char x) (Char y) = primEqInt x y;
esEsChar :: Char -> Char -> MyBool
esEsChar = primEqChar;
not :: MyBool -> MyBool;
not MyTrue = MyFalse;
not MyFalse = MyTrue;
fsEsChar :: Char -> Char -> MyBool
fsEsChar x y = not (esEsChar x y);
notElemChar :: Char -> (List Char) -> MyBool
notElemChar = pt all fsEsChar;
|
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/notElem_3.hs
|
mit
| 1,696
| 0
| 9
| 432
| 843
| 452
| 391
| 45
| 1
|
module Textures where
import Graphics.Gloss.Rendering
import Graphics.Gloss.Data.Color
import Graphics.Gloss.Data.Picture
import Graphics.Gloss.Juicy
import qualified Data.Map as M
import Control.Monad
import Control.Applicative
import Data.Maybe (fromJust)
type Texture = Picture
-- | A general map to access all textures whenever necessary.
type TextureMap = M.Map String Texture
textureMap :: IO TextureMap
textureMap = createTextureMap
[ ("desert", "assets/desert.png")
, ("grass", "assets/grass.png")
, ("hill", "assets/hill.png")
, ("plains", "assets/plains.png")
, ("tundra", "assets/tundra.png")
, ("settler", "assets/settler.png")
, ("worker", "assets/worker.png")
, ("city1", "assets/city1.png")
]
-- | Create texture map from texture names and PNG file paths.
-- We don't really care if there are errors at this point.
-- We might choose to avoid partial functions in the future.
createTextureMap :: [(String, FilePath)] -> IO TextureMap
createTextureMap xs =
M.fromList <$> mapM (\(x,p) -> (,) x <$> (fromJust <$> loadJuicyPNG p)) xs
from :: String -> TextureMap -> Texture
from = flip (M.!)
|
joom/civ
|
src/Textures.hs
|
mit
| 1,160
| 0
| 12
| 201
| 268
| 164
| 104
| 26
| 1
|
-- Project Euler Problem 11 - Largest product in a grid
--
-- Greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) grid
--
grid = [
[08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08],
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 04, 56, 62, 00],
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 03, 49, 13, 36, 65],
[52, 70, 95, 23, 04, 60, 11, 42, 69, 24, 68, 56, 01, 32, 56, 71, 37, 02, 36, 91],
[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],
[24, 47, 32, 60, 99, 03, 45, 02, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],
[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],
[67, 26, 20, 68, 02, 62, 12, 20, 95, 63, 94, 39, 63, 08, 40, 91, 66, 49, 94, 21],
[24, 55, 58, 05, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],
[21, 36, 23, 09, 75, 00, 76, 44, 20, 45, 35, 14, 00, 61, 33, 97, 34, 31, 33, 95],
[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 03, 80, 04, 62, 16, 14, 09, 53, 56, 92],
[16, 39, 05, 42, 96, 35, 31, 47, 55, 58, 88, 24, 00, 17, 54, 24, 36, 29, 85, 57],
[86, 56, 00, 48, 35, 71, 89, 07, 05, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],
[19, 80, 81, 68, 05, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 04, 89, 55, 40],
[04, 52, 08, 83, 97, 35, 99, 16, 07, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],
[88, 36, 68, 87, 57, 62, 20, 72, 03, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],
[04, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 08, 46, 29, 32, 40, 62, 76, 36],
[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 04, 36, 16],
[20, 73, 35, 29, 78, 31, 90, 01, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 05, 54],
[01, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 01, 89, 19, 67, 48]]
n = 20
list_down mat i = [ x!!i | x <- mat]
list_diag_down_top_row mat i = [ mat!!j!!(i+j) | j <- [0..n], i+j<n]
list_diag_down_left_col mat i = [ mat!!(i+j)!!j | j <- [0..n], i+j<n]
list_diag_up_top_row mat i = [ mat!!j!!(i-j) | j <- [0..n], i-j>=0]
list_diag_up_left_col mat i = [ mat!!(i-j)!!j | j <- [0..n], i-j>=0]
diags_concat = concat [ [list_diag_down_top_row grid i , list_diag_down_left_col grid i, list_diag_up_top_row grid i, list_diag_up_left_col grid i] | i <- [0..n-1] ]
all_concat = grid ++ [ list_down grid i | i<-[0..n-1]] ++ diags_concat
prod4 list = if list==[] then [] else (product (take 4 list)):(prod4 (tail list))
main = do
print (maximum (concat [ prod4 x | x <- all_concat ]))
|
yunwilliamyu/programming-exercises
|
project_euler/p011_grid_product.hs
|
cc0-1.0
| 2,556
| 43
| 14
| 583
| 1,746
| 1,093
| 653
| 32
| 2
|
module Main where
concatenador :: String -> String -> String
concatenador x y = x ++ " " ++ y
main :: IO()
main = do
print(concatenador "aoi" "uu9")
|
llscm0202/BIGDATA2017
|
ATIVIDADE1/exerciciosBasicos/ex11.hs
|
gpl-3.0
| 154
| 0
| 9
| 34
| 64
| 33
| 31
| 6
| 1
|
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE LambdaCase #-}
module Main where
import Control.Lens
import Control.Monad.State.Strict
import qualified Data.Map as M
import FreeGame
import Shakugan.Types
import Shakugan.Util
import Shakugan.Load
import Shakugan.CharacterControl
main ∷ IO ()
main = void $ runGame Windowed b $ do
let tf = 60
setFPS tf
setTitle "shakugan-no-haskell"
clearColor $ Color 0 0 0 0
r ← loadResources
let field' = Field { _player = Player
{ _keysHeld = M.empty
, _position = V2 100 500
, _facing = RightD
, _falling = False
, _jumping = False
}
}
evalStateT mainloop GameFrame { _resources = r
, _field = field'
, _quit = False
, _targetFramerate = tf
}
where
mainloop ∷ GameLoop ()
mainloop = do
bd ← use (resources.backdrop)
let (w, h) = bitmapSize bd & both %~ ((/ 2) . fromIntegral)
_cs = animate 2 charSprites
translate (V2 w h) $ bitmap bd
pos ← use (field.player.position)
con ← pressedKeys >>= characterControl
translate pos $ bitmap con
-- drawSeries True (resources.charSprites.charJumpingRight)
whenM (keyPress KeyEscape) $ quit .= True
whenM (keyPress KeyO) $ field.player.position .= V2 100 500
q ← use quit
tick
unless q mainloop
b ∷ BoundingBox2
b = Box (V2 0 0) (V2 800 600)
|
Fuuzetsu/shakugan-no-haskell
|
src/Main.hs
|
gpl-3.0
| 1,744
| 0
| 15
| 689
| 456
| 234
| 222
| -1
| -1
|
module TestServer where
import Test.HUnit
import PupEventsPQueue
import Events
import qualified PupEventsClient as Client
import qualified Server as Server
import Control.Concurrent.STM
import Control.Concurrent
import Control.Exception.Base
import Data.List
import System.Environment
import System.Random
import qualified Distribution.TestSuite as Cabal
import qualified Distribution.TestSuite.HUnit as CabalHUnit
tests = map (\(x,y) -> CabalHUnit.test x y)
[ ("Login tests", loginTests)
]
-- Start server
startServer port =
do stuff <- withArgs ["localhost", "3"] (Server.mainTest port)
return stuff
-- Make connection
connect port =
do (q1, q2, disconnect) <- Client.client Nothing 3 port lookupPriority lookupUnHandler parsers
return (q1, q2, disconnect)
-- Bracketing
bracketed = bracket
(
do putStrLn "\n----------------------"
port <- randomRIO (1024, 65535) :: IO Int
let port' = show port
(g, u, pI, r) <- startServer port'
putStr $ "Starting Server on port: " ++ port' ++ "... "
tId <- forkIO r
threadDelay 1000
putStr "Connecting... "
(q1, q2, dc) <- connect port'
let reconnect = connect port'
putStrLn "Entered bracket"
putStrLn "======================"
return (g, u, pI, q1, q2, dc, tId, reconnect, port')
)
(\(_,_,_,_,_,dc, tId, _, _) ->
do putStrLn "======================"
threadDelay 1000
putStr "Disconnecting... "
dc
threadDelay 1000
putStr "Killing server..."
killThread tId
threadDelay 1000
putStrLn "Exited bracket"
putStrLn "-----------------------"
)
--(startServer >>= (\(g, u, pI, r) -> forkIO r >>= (\tId -> threadDelay 100 >> connect >>= (\(q1, q2, dc) -> return (g, u, pI, q1, q2, dc, tId)))))
--(\(_,_,_,_,_,dc,tId) -> dc >> killThread tId)
-- Just for convenience
getEvent q = atomically $
do e <- getThing q
case e of
Nothing -> retry
Just event -> return event
-- Custom assertions
-- |assertion to test if something is found in a list with a custom predicate
assertFound msg p xs =
case find p xs of
Nothing -> assertFailure msg
Just _ -> return ()
-- |assertion to test if something is not found in a list with a custom predicate
assertNotFound msg p xs =
case find p xs of
Nothing -> return ()
Just _ -> assertFailure msg
-- |assertion to test if a list is empty
assertEmpty msg xs
| not (null xs) = assertFailure msg
| otherwise = return ()
-- |assertion to test if a list is not empty
assertNotEmpty msg xs
| null xs = assertFailure msg
| otherwise = return ()
-- Login tests
loginTests = TestLabel "Login Tests" $
TestList
[ TestLabel "Login !Exist !Registered" (TestCase loginNoExistNoRegister)
, TestLabel "Login !Exist Registered" (TestCase loginNoExistRegister)
, TestLabel "Login Exist !Registered" (TestCase loginExistNoRegister)
, TestLabel "Login Exist Registered" (TestCase loginExistRegister)
]
-- |User doesn't exist and we haven't logged in yet.
loginNoExistNoRegister = bracketed $ \(g, u, pI, iQ, oQ, _, _, _, port) ->
do putStrLn $ "loginNoExistNoRegister on port: " ++ port
let user = Username "user1"
let event = Login user
-- get initial values
users <- readTVarIO u
players <- readTVarIO pI
let usersLen = length users
let playersLen = length players
-- before login
assertEmpty "Initial usernames not empty!" users
assertEmpty "Initial playerInfos not empty!" players
assertNotFound "User already exists!" ((==) user) users
assertNotFound "Player already exists!" (\(_, x, _) -> x == user) players
-- send event and get response
atomically $ writeThing iQ (lookupPriority event) event
event' <- getEvent oQ
-- get updated values
users' <- readTVarIO u
players' <- readTVarIO pI
let usersLen' = length users'
let playersLen' = length players'
--after login
assertEqual "Usernames not increased by 1" (usersLen + 1) (usersLen')
assertEqual "PlayerInfos not increased by 1" (playersLen + 1) (playersLen')
assertFound "User not found!" ((==) user) users'
assertFound "Player not found!" (\(_, x, _) -> x == user) players'
-- check that we have the expected event
assertEqual "Not Login event!" event event'
-- |User doesn't exist and we've logged in already
loginNoExistRegister = bracketed $ \(g, u, pI, iQ, oQ, _, _, _, port) ->
do putStrLn $ "loginNoExistRegister on port: " ++ port
let user = Username "user1"
let login = Login user
atomically $ writeThing iQ (lookupPriority login) login
login' <- getEvent oQ
-- make sure we're actually Logged In
assertEqual "User Exists" login login'
-- initial data before we do the actual test
users <- readTVarIO u
players <- readTVarIO pI
let user2 = Username "user2"
let login2 = Login user2
-- the following must be true for the initial data to be correct
assertNotEmpty "Initial users is empty!" users
assertNotEmpty "Initial playerInfos is empty!" players
assertNotFound "User already exists!" ((==) user2) users
assertNotFound "Player already exists!" (\(_, x, _) -> x == user2) players
atomically $ writeThing iQ (lookupPriority login2) login2
login2' <- getEvent oQ
users' <- readTVarIO u
players' <- readTVarIO pI
assertEqual "Users have changed!" users users'
assertEqual "Players have changed!" players players'
assertEqual "Did not receive proper event!" (Error AlreadyRegistered) login2'
-- |User exists, and we've not logged in already
loginExistNoRegister = bracketed $ \(g, u, pI, iQ, oQ, _, _, reconnect, port) ->
do putStrLn $ "loginExistNoRegister on port: " ++ port
let user = Username "user1"
let login = Login user
atomically $ writeThing iQ (lookupPriority login) login
login' <- getEvent oQ
-- are we actually logged in?
assertEqual "User Exists" login login'
users <- readTVarIO u
players <- readTVarIO pI
-- make sure initial data is correct
assertNotEmpty "Initial users is empty!" users
assertNotEmpty "Initial playerInfos is empty!" players
assertFound "User doesn't exist!" ((==) user) users
assertFound "Player doesn't exist!" (\(_, x, _) -> x == user) players
-- actual test, connect with new client and try logging in
putStrLn "Trying new connection..."
(iQ', oQ', dc) <- reconnect
atomically $ writeThing iQ' (lookupPriority login) login
login2' <- getEvent oQ'
users' <- readTVarIO u
players' <- readTVarIO pI
assertEqual "Users have changed!" users users'
assertEqual "Players have changed!" players players'
assertEqual "Did not receive proper event!" (Error UserExists) login2'
dc
-- |User exists, and we've already logged in
loginExistRegister = bracketed $ \(g, u, pI, iQ, oQ, _, _, _, port) ->
do putStrLn $ "loginExistRegister on port: " ++ port
let user = Username "user1"
let login = Login user
atomically $ writeThing iQ (lookupPriority login) login
login' <- getEvent oQ
-- make sure we're actually Logged In
assertEqual "User Exists" login login'
-- initial data before we do the actual test
users <- readTVarIO u
players <- readTVarIO pI
-- the following must be true for the initial data to be correct
assertNotEmpty "Initial users is empty!" users
assertNotEmpty "Initial playerInfos is empty!" players
assertFound "User doesn't exist!" ((==) user) users
assertFound "Player doesn't exist!" (\(_, x, _) -> x == user) players
atomically $ writeThing iQ (lookupPriority login) login
login2' <- getEvent oQ
users' <- readTVarIO u
players' <- readTVarIO pI
assertEqual "Users have changed!" users users'
assertEqual "Players have changed!" players players'
assertFound "Did not receive proper event!" ((==) login2') [Error AlreadyRegistered, Error UserExists]
|
RocketPuppy/PupCollide
|
Test/TestServer.hs
|
gpl-3.0
| 8,522
| 0
| 12
| 2,341
| 2,087
| 1,020
| 1,067
| 161
| 2
|
module Tests.ADTUntypedNamed where
import QFeldspar.MyPrelude
import QFeldspar.Expression.ADTUntypedNamed
import qualified QFeldspar.Expression.ADTValue as V
import QFeldspar.Conversion
import QFeldspar.Expression.Conversions.Evaluation.ADTUntypedNamed ()
import qualified Language.Haskell.TH.Syntax as TH
import QFeldspar.Expression.Utils.TemplateHaskell
import Tests.TemplateHaskell(add)
type Var = TH.Name
x0 :: Var
x0 = TH.mkName "x0"
x1 :: Var
x1 = TH.mkName "x1"
x2 :: Var
x2 = TH.mkName "x2"
dbl :: Exp Var
dbl = Abs (x0 , Prm (stripNameSpace 'add) [Var x0 , Var x0])
compose :: Exp Var
compose = Abs (x2 , (Abs (x1 , (Abs (x0 , (App (Var x2) (App (Var x1) (Var x0))))))))
four :: Exp Var
four = App (App (App compose dbl) dbl) (Int 1)
test :: Bool
test = (case runNamM (cnv (four , ([((stripNameSpace 'add)
, V.toExp ((+) :: Word32 -> Word32 -> Word32))]
,[] :: [(TH.Name,V.Exp)]))) of
Rgt (V.frmExp -> Rgt (4 :: Word32)) -> True
_ -> False)
|
shayan-najd/QFeldspar
|
Tests/ADTUntypedNamed.hs
|
gpl-3.0
| 1,053
| 0
| 18
| 245
| 415
| 236
| 179
| -1
| -1
|
{-# LANGUAGE RecordWildCards, StandaloneDeriving, OverloadedStrings #-}
{-|
An 'Account' has a name, a list of subaccounts, an optional parent
account, and subaccounting-excluding and -including balances.
-}
module Hledger.Data.Account
where
import Data.List
import Data.Maybe
import Data.Ord
import qualified Data.Map as M
import Data.Text (pack,unpack)
import Safe (headMay, lookupJustDef)
import Test.HUnit
import Text.Printf
import Hledger.Data.AccountName
import Hledger.Data.Amount
import Hledger.Data.Posting()
import Hledger.Data.Types
import Hledger.Utils
-- deriving instance Show Account
instance Show Account where
show Account{..} = printf "Account %s (boring:%s, postings:%d, ebalance:%s, ibalance:%s)"
(pack $ regexReplace ":" "_" $ unpack aname) -- hide : so pretty-show doesn't break line
(if aboring then "y" else "n" :: String)
anumpostings
(showMixedAmount aebalance)
(showMixedAmount aibalance)
instance Eq Account where
(==) a b = aname a == aname b -- quick equality test for speed
-- and
-- [ aname a == aname b
-- -- , aparent a == aparent b -- avoid infinite recursion
-- , asubs a == asubs b
-- , aebalance a == aebalance b
-- , aibalance a == aibalance b
-- ]
nullacct = Account
{ aname = ""
, aparent = Nothing
, asubs = []
, anumpostings = 0
, aebalance = nullmixedamt
, aibalance = nullmixedamt
, aboring = False
}
-- | Derive 1. an account tree and 2. each account's total exclusive
-- and inclusive changes from a list of postings.
-- This is the core of the balance command (and of *ledger).
-- The accounts are returned as a list in flattened tree order,
-- and also reference each other as a tree.
-- (The first account is the root of the tree.)
accountsFromPostings :: [Posting] -> [Account]
accountsFromPostings ps =
let
acctamts = [(paccount p,pamount p) | p <- ps]
grouped = groupBy (\a b -> fst a == fst b) $ sort $ acctamts
counted = [(a, length acctamts) | acctamts@((a,_):_) <- grouped]
summed = map (\as@((aname,_):_) -> (aname, sumStrict $ map snd as)) grouped -- always non-empty
nametree = treeFromPaths $ map (expandAccountName . fst) summed
acctswithnames = nameTreeToAccount "root" nametree
acctswithnumps = mapAccounts setnumps acctswithnames where setnumps a = a{anumpostings=fromMaybe 0 $ lookup (aname a) counted}
acctswithebals = mapAccounts setebalance acctswithnumps where setebalance a = a{aebalance=lookupJustDef nullmixedamt (aname a) summed}
acctswithibals = sumAccounts acctswithebals
acctswithparents = tieAccountParents acctswithibals
acctsflattened = flattenAccounts acctswithparents
in
acctsflattened
-- | Convert an AccountName tree to an Account tree
nameTreeToAccount :: AccountName -> FastTree AccountName -> Account
nameTreeToAccount rootname (T m) =
nullacct{ aname=rootname, asubs=map (uncurry nameTreeToAccount) $ M.assocs m }
-- | Tie the knot so all subaccounts' parents are set correctly.
tieAccountParents :: Account -> Account
tieAccountParents = tie Nothing
where
tie parent a@Account{..} = a'
where
a' = a{aparent=parent, asubs=map (tie (Just a')) asubs}
-- | Get this account's parent accounts, from the nearest up to the root.
parentAccounts :: Account -> [Account]
parentAccounts Account{aparent=Nothing} = []
parentAccounts Account{aparent=Just a} = a:parentAccounts a
-- | List the accounts at each level of the account tree.
accountsLevels :: Account -> [[Account]]
accountsLevels = takeWhile (not . null) . iterate (concatMap asubs) . (:[])
-- | Map a (non-tree-structure-modifying) function over this and sub accounts.
mapAccounts :: (Account -> Account) -> Account -> Account
mapAccounts f a = f a{asubs = map (mapAccounts f) $ asubs a}
-- | Is the predicate true on any of this account or its subaccounts ?
anyAccounts :: (Account -> Bool) -> Account -> Bool
anyAccounts p a
| p a = True
| otherwise = any (anyAccounts p) $ asubs a
-- | Add subaccount-inclusive balances to an account tree.
sumAccounts :: Account -> Account
sumAccounts a
| null $ asubs a = a{aibalance=aebalance a}
| otherwise = a{aibalance=ibal, asubs=subs}
where
subs = map sumAccounts $ asubs a
ibal = sum $ aebalance a : map aibalance subs
-- | Remove all subaccounts below a certain depth.
clipAccounts :: Int -> Account -> Account
clipAccounts 0 a = a{asubs=[]}
clipAccounts d a = a{asubs=subs}
where
subs = map (clipAccounts (d-1)) $ asubs a
-- | Remove subaccounts below the specified depth, aggregating their balance at the depth limit
-- (accounts at the depth limit will have any sub-balances merged into their exclusive balance).
clipAccountsAndAggregate :: Int -> [Account] -> [Account]
clipAccountsAndAggregate d as = combined
where
clipped = [a{aname=clipOrEllipsifyAccountName d $ aname a} | a <- as]
combined = [a{aebalance=sum (map aebalance same)}
| same@(a:_) <- groupBy (\a1 a2 -> aname a1 == aname a2) clipped]
{-
test cases, assuming d=1:
assets:cash 1 1
assets:checking 1 1
->
as: [assets:cash 1 1, assets:checking 1 1]
clipped: [assets 1 1, assets 1 1]
combined: [assets 2 2]
assets 0 2
assets:cash 1 1
assets:checking 1 1
->
as: [assets 0 2, assets:cash 1 1, assets:checking 1 1]
clipped: [assets 0 2, assets 1 1, assets 1 1]
combined: [assets 2 2]
assets 0 2
assets:bank 1 2
assets:bank:checking 1 1
->
as: [assets 0 2, assets:bank 1 2, assets:bank:checking 1 1]
clipped: [assets 0 2, assets 1 2, assets 1 1]
combined: [assets 2 2]
-}
-- | Remove all leaf accounts and subtrees matching a predicate.
pruneAccounts :: (Account -> Bool) -> Account -> Maybe Account
pruneAccounts p = headMay . prune
where
prune a
| null prunedsubs = if p a then [] else [a']
| otherwise = [a']
where
prunedsubs = concatMap prune $ asubs a
a' = a{asubs=prunedsubs}
-- | Flatten an account tree into a list, which is sometimes
-- convenient. Note since accounts link to their parents/subs, the
-- tree's structure remains intact and can still be used. It's a tree/list!
flattenAccounts :: Account -> [Account]
flattenAccounts a = squish a []
where squish a as = a : Prelude.foldr squish as (asubs a)
-- | Filter an account tree (to a list).
filterAccounts :: (Account -> Bool) -> Account -> [Account]
filterAccounts p a
| p a = a : concatMap (filterAccounts p) (asubs a)
| otherwise = concatMap (filterAccounts p) (asubs a)
-- | Sort each level of an account tree by inclusive amount,
-- so that the accounts with largest normal balances are listed first.
-- The provided normal balance sign determines whether normal balances
-- are negative or positive.
sortAccountTreeByAmount :: NormalBalance -> Account -> Account
sortAccountTreeByAmount normalsign a
| null $ asubs a = a
| otherwise = a{asubs=
sortBy (maybeflip $ comparing aibalance) $
map (sortAccountTreeByAmount normalsign) $ asubs a}
where
maybeflip | normalsign==NormalNegative = id
| otherwise = flip
-- | Search an account list by name.
lookupAccount :: AccountName -> [Account] -> Maybe Account
lookupAccount a = find ((==a).aname)
-- debug helpers
printAccounts :: Account -> IO ()
printAccounts = putStrLn . showAccounts
showAccounts = unlines . map showAccountDebug . flattenAccounts
showAccountsBoringFlag = unlines . map (show . aboring) . flattenAccounts
showAccountDebug a = printf "%-25s %4s %4s %s"
(aname a)
(showMixedAmount $ aebalance a)
(showMixedAmount $ aibalance a)
(if aboring a then "b" else " " :: String)
tests_Hledger_Data_Account = TestList [
]
|
ony/hledger
|
hledger-lib/Hledger/Data/Account.hs
|
gpl-3.0
| 7,988
| 0
| 16
| 1,850
| 1,857
| 994
| 863
| 114
| 2
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.Gmail.Users.Settings.SendAs.Get
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the specified send-as alias. Fails with an HTTP 404 error if the
-- specified address is not a member of the collection.
--
-- /See:/ <https://developers.google.com/gmail/api/ Gmail API Reference> for @gmail.users.settings.sendAs.get@.
module Network.Google.Resource.Gmail.Users.Settings.SendAs.Get
(
-- * REST Resource
UsersSettingsSendAsGetResource
-- * Creating a Request
, usersSettingsSendAsGet
, UsersSettingsSendAsGet
-- * Request Lenses
, ussagXgafv
, ussagUploadProtocol
, ussagAccessToken
, ussagUploadType
, ussagUserId
, ussagSendAsEmail
, ussagCallback
) where
import Network.Google.Gmail.Types
import Network.Google.Prelude
-- | A resource alias for @gmail.users.settings.sendAs.get@ method which the
-- 'UsersSettingsSendAsGet' request conforms to.
type UsersSettingsSendAsGetResource =
"gmail" :>
"v1" :>
"users" :>
Capture "userId" Text :>
"settings" :>
"sendAs" :>
Capture "sendAsEmail" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] SendAs
-- | Gets the specified send-as alias. Fails with an HTTP 404 error if the
-- specified address is not a member of the collection.
--
-- /See:/ 'usersSettingsSendAsGet' smart constructor.
data UsersSettingsSendAsGet =
UsersSettingsSendAsGet'
{ _ussagXgafv :: !(Maybe Xgafv)
, _ussagUploadProtocol :: !(Maybe Text)
, _ussagAccessToken :: !(Maybe Text)
, _ussagUploadType :: !(Maybe Text)
, _ussagUserId :: !Text
, _ussagSendAsEmail :: !Text
, _ussagCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'UsersSettingsSendAsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ussagXgafv'
--
-- * 'ussagUploadProtocol'
--
-- * 'ussagAccessToken'
--
-- * 'ussagUploadType'
--
-- * 'ussagUserId'
--
-- * 'ussagSendAsEmail'
--
-- * 'ussagCallback'
usersSettingsSendAsGet
:: Text -- ^ 'ussagSendAsEmail'
-> UsersSettingsSendAsGet
usersSettingsSendAsGet pUssagSendAsEmail_ =
UsersSettingsSendAsGet'
{ _ussagXgafv = Nothing
, _ussagUploadProtocol = Nothing
, _ussagAccessToken = Nothing
, _ussagUploadType = Nothing
, _ussagUserId = "me"
, _ussagSendAsEmail = pUssagSendAsEmail_
, _ussagCallback = Nothing
}
-- | V1 error format.
ussagXgafv :: Lens' UsersSettingsSendAsGet (Maybe Xgafv)
ussagXgafv
= lens _ussagXgafv (\ s a -> s{_ussagXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ussagUploadProtocol :: Lens' UsersSettingsSendAsGet (Maybe Text)
ussagUploadProtocol
= lens _ussagUploadProtocol
(\ s a -> s{_ussagUploadProtocol = a})
-- | OAuth access token.
ussagAccessToken :: Lens' UsersSettingsSendAsGet (Maybe Text)
ussagAccessToken
= lens _ussagAccessToken
(\ s a -> s{_ussagAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
ussagUploadType :: Lens' UsersSettingsSendAsGet (Maybe Text)
ussagUploadType
= lens _ussagUploadType
(\ s a -> s{_ussagUploadType = a})
-- | User\'s email address. The special value \"me\" can be used to indicate
-- the authenticated user.
ussagUserId :: Lens' UsersSettingsSendAsGet Text
ussagUserId
= lens _ussagUserId (\ s a -> s{_ussagUserId = a})
-- | The send-as alias to be retrieved.
ussagSendAsEmail :: Lens' UsersSettingsSendAsGet Text
ussagSendAsEmail
= lens _ussagSendAsEmail
(\ s a -> s{_ussagSendAsEmail = a})
-- | JSONP
ussagCallback :: Lens' UsersSettingsSendAsGet (Maybe Text)
ussagCallback
= lens _ussagCallback
(\ s a -> s{_ussagCallback = a})
instance GoogleRequest UsersSettingsSendAsGet where
type Rs UsersSettingsSendAsGet = SendAs
type Scopes UsersSettingsSendAsGet =
'["https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.settings.basic"]
requestClient UsersSettingsSendAsGet'{..}
= go _ussagUserId _ussagSendAsEmail _ussagXgafv
_ussagUploadProtocol
_ussagAccessToken
_ussagUploadType
_ussagCallback
(Just AltJSON)
gmailService
where go
= buildClient
(Proxy :: Proxy UsersSettingsSendAsGetResource)
mempty
|
brendanhay/gogol
|
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/SendAs/Get.hs
|
mpl-2.0
| 5,638
| 0
| 20
| 1,336
| 792
| 463
| 329
| 121
| 1
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.AdExchangeBuyer2.Bidders.FilterSets.BidResponsesWithoutBids.List
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List all reasons for which bid responses were considered to have no
-- applicable bids, with the number of bid responses affected for each
-- reason.
--
-- /See:/ <https://developers.google.com/authorized-buyers/apis/reference/rest/ Ad Exchange Buyer API II Reference> for @adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list@.
module Network.Google.Resource.AdExchangeBuyer2.Bidders.FilterSets.BidResponsesWithoutBids.List
(
-- * REST Resource
BiddersFilterSetsBidResponsesWithoutBidsListResource
-- * Creating a Request
, biddersFilterSetsBidResponsesWithoutBidsList
, BiddersFilterSetsBidResponsesWithoutBidsList
-- * Request Lenses
, bfsbrwblXgafv
, bfsbrwblUploadProtocol
, bfsbrwblFilterSetName
, bfsbrwblAccessToken
, bfsbrwblUploadType
, bfsbrwblPageToken
, bfsbrwblPageSize
, bfsbrwblCallback
) where
import Network.Google.AdExchangeBuyer2.Types
import Network.Google.Prelude
-- | A resource alias for @adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list@ method which the
-- 'BiddersFilterSetsBidResponsesWithoutBidsList' request conforms to.
type BiddersFilterSetsBidResponsesWithoutBidsListResource
=
"v2beta1" :>
Capture "filterSetName" Text :>
"bidResponsesWithoutBids" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "pageToken" Text :>
QueryParam "pageSize" (Textual Int32) :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] ListBidResponsesWithoutBidsResponse
-- | List all reasons for which bid responses were considered to have no
-- applicable bids, with the number of bid responses affected for each
-- reason.
--
-- /See:/ 'biddersFilterSetsBidResponsesWithoutBidsList' smart constructor.
data BiddersFilterSetsBidResponsesWithoutBidsList =
BiddersFilterSetsBidResponsesWithoutBidsList'
{ _bfsbrwblXgafv :: !(Maybe Xgafv)
, _bfsbrwblUploadProtocol :: !(Maybe Text)
, _bfsbrwblFilterSetName :: !Text
, _bfsbrwblAccessToken :: !(Maybe Text)
, _bfsbrwblUploadType :: !(Maybe Text)
, _bfsbrwblPageToken :: !(Maybe Text)
, _bfsbrwblPageSize :: !(Maybe (Textual Int32))
, _bfsbrwblCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'BiddersFilterSetsBidResponsesWithoutBidsList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bfsbrwblXgafv'
--
-- * 'bfsbrwblUploadProtocol'
--
-- * 'bfsbrwblFilterSetName'
--
-- * 'bfsbrwblAccessToken'
--
-- * 'bfsbrwblUploadType'
--
-- * 'bfsbrwblPageToken'
--
-- * 'bfsbrwblPageSize'
--
-- * 'bfsbrwblCallback'
biddersFilterSetsBidResponsesWithoutBidsList
:: Text -- ^ 'bfsbrwblFilterSetName'
-> BiddersFilterSetsBidResponsesWithoutBidsList
biddersFilterSetsBidResponsesWithoutBidsList pBfsbrwblFilterSetName_ =
BiddersFilterSetsBidResponsesWithoutBidsList'
{ _bfsbrwblXgafv = Nothing
, _bfsbrwblUploadProtocol = Nothing
, _bfsbrwblFilterSetName = pBfsbrwblFilterSetName_
, _bfsbrwblAccessToken = Nothing
, _bfsbrwblUploadType = Nothing
, _bfsbrwblPageToken = Nothing
, _bfsbrwblPageSize = Nothing
, _bfsbrwblCallback = Nothing
}
-- | V1 error format.
bfsbrwblXgafv :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Xgafv)
bfsbrwblXgafv
= lens _bfsbrwblXgafv
(\ s a -> s{_bfsbrwblXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
bfsbrwblUploadProtocol :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Text)
bfsbrwblUploadProtocol
= lens _bfsbrwblUploadProtocol
(\ s a -> s{_bfsbrwblUploadProtocol = a})
-- | Name of the filter set that should be applied to the requested metrics.
-- For example: - For a bidder-level filter set for bidder 123:
-- \`bidders\/123\/filterSets\/abc\` - For an account-level filter set for
-- the buyer account representing bidder 123:
-- \`bidders\/123\/accounts\/123\/filterSets\/abc\` - For an account-level
-- filter set for the child seat buyer account 456 whose bidder is 123:
-- \`bidders\/123\/accounts\/456\/filterSets\/abc\`
bfsbrwblFilterSetName :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList Text
bfsbrwblFilterSetName
= lens _bfsbrwblFilterSetName
(\ s a -> s{_bfsbrwblFilterSetName = a})
-- | OAuth access token.
bfsbrwblAccessToken :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Text)
bfsbrwblAccessToken
= lens _bfsbrwblAccessToken
(\ s a -> s{_bfsbrwblAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
bfsbrwblUploadType :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Text)
bfsbrwblUploadType
= lens _bfsbrwblUploadType
(\ s a -> s{_bfsbrwblUploadType = a})
-- | A token identifying a page of results the server should return.
-- Typically, this is the value of
-- ListBidResponsesWithoutBidsResponse.nextPageToken returned from the
-- previous call to the bidResponsesWithoutBids.list method.
bfsbrwblPageToken :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Text)
bfsbrwblPageToken
= lens _bfsbrwblPageToken
(\ s a -> s{_bfsbrwblPageToken = a})
-- | Requested page size. The server may return fewer results than requested.
-- If unspecified, the server will pick an appropriate default.
bfsbrwblPageSize :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Int32)
bfsbrwblPageSize
= lens _bfsbrwblPageSize
(\ s a -> s{_bfsbrwblPageSize = a})
. mapping _Coerce
-- | JSONP
bfsbrwblCallback :: Lens' BiddersFilterSetsBidResponsesWithoutBidsList (Maybe Text)
bfsbrwblCallback
= lens _bfsbrwblCallback
(\ s a -> s{_bfsbrwblCallback = a})
instance GoogleRequest
BiddersFilterSetsBidResponsesWithoutBidsList
where
type Rs BiddersFilterSetsBidResponsesWithoutBidsList
= ListBidResponsesWithoutBidsResponse
type Scopes
BiddersFilterSetsBidResponsesWithoutBidsList
=
'["https://www.googleapis.com/auth/adexchange.buyer"]
requestClient
BiddersFilterSetsBidResponsesWithoutBidsList'{..}
= go _bfsbrwblFilterSetName _bfsbrwblXgafv
_bfsbrwblUploadProtocol
_bfsbrwblAccessToken
_bfsbrwblUploadType
_bfsbrwblPageToken
_bfsbrwblPageSize
_bfsbrwblCallback
(Just AltJSON)
adExchangeBuyer2Service
where go
= buildClient
(Proxy ::
Proxy
BiddersFilterSetsBidResponsesWithoutBidsListResource)
mempty
|
brendanhay/gogol
|
gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Bidders/FilterSets/BidResponsesWithoutBids/List.hs
|
mpl-2.0
| 7,803
| 0
| 18
| 1,595
| 893
| 522
| 371
| 137
| 1
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.FireStore.Projects.Databases.Documents.Delete
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a document.
--
-- /See:/ <https://cloud.google.com/firestore Cloud Firestore API Reference> for @firestore.projects.databases.documents.delete@.
module Network.Google.Resource.FireStore.Projects.Databases.Documents.Delete
(
-- * REST Resource
ProjectsDatabasesDocumentsDeleteResource
-- * Creating a Request
, projectsDatabasesDocumentsDelete
, ProjectsDatabasesDocumentsDelete
-- * Request Lenses
, pdddXgafv
, pdddUploadProtocol
, pdddCurrentDocumentExists
, pdddAccessToken
, pdddUploadType
, pdddCurrentDocumentUpdateTime
, pdddName
, pdddCallback
) where
import Network.Google.FireStore.Types
import Network.Google.Prelude
-- | A resource alias for @firestore.projects.databases.documents.delete@ method which the
-- 'ProjectsDatabasesDocumentsDelete' request conforms to.
type ProjectsDatabasesDocumentsDeleteResource =
"v1" :>
Capture "name" Text :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "currentDocument.exists" Bool :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "currentDocument.updateTime" DateTime' :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :> Delete '[JSON] Empty
-- | Deletes a document.
--
-- /See:/ 'projectsDatabasesDocumentsDelete' smart constructor.
data ProjectsDatabasesDocumentsDelete =
ProjectsDatabasesDocumentsDelete'
{ _pdddXgafv :: !(Maybe Xgafv)
, _pdddUploadProtocol :: !(Maybe Text)
, _pdddCurrentDocumentExists :: !(Maybe Bool)
, _pdddAccessToken :: !(Maybe Text)
, _pdddUploadType :: !(Maybe Text)
, _pdddCurrentDocumentUpdateTime :: !(Maybe DateTime')
, _pdddName :: !Text
, _pdddCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ProjectsDatabasesDocumentsDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pdddXgafv'
--
-- * 'pdddUploadProtocol'
--
-- * 'pdddCurrentDocumentExists'
--
-- * 'pdddAccessToken'
--
-- * 'pdddUploadType'
--
-- * 'pdddCurrentDocumentUpdateTime'
--
-- * 'pdddName'
--
-- * 'pdddCallback'
projectsDatabasesDocumentsDelete
:: Text -- ^ 'pdddName'
-> ProjectsDatabasesDocumentsDelete
projectsDatabasesDocumentsDelete pPdddName_ =
ProjectsDatabasesDocumentsDelete'
{ _pdddXgafv = Nothing
, _pdddUploadProtocol = Nothing
, _pdddCurrentDocumentExists = Nothing
, _pdddAccessToken = Nothing
, _pdddUploadType = Nothing
, _pdddCurrentDocumentUpdateTime = Nothing
, _pdddName = pPdddName_
, _pdddCallback = Nothing
}
-- | V1 error format.
pdddXgafv :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Xgafv)
pdddXgafv
= lens _pdddXgafv (\ s a -> s{_pdddXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pdddUploadProtocol :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddUploadProtocol
= lens _pdddUploadProtocol
(\ s a -> s{_pdddUploadProtocol = a})
-- | When set to \`true\`, the target document must exist. When set to
-- \`false\`, the target document must not exist.
pdddCurrentDocumentExists :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Bool)
pdddCurrentDocumentExists
= lens _pdddCurrentDocumentExists
(\ s a -> s{_pdddCurrentDocumentExists = a})
-- | OAuth access token.
pdddAccessToken :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddAccessToken
= lens _pdddAccessToken
(\ s a -> s{_pdddAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pdddUploadType :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddUploadType
= lens _pdddUploadType
(\ s a -> s{_pdddUploadType = a})
-- | When set, the target document must exist and have been last updated at
-- that time.
pdddCurrentDocumentUpdateTime :: Lens' ProjectsDatabasesDocumentsDelete (Maybe UTCTime)
pdddCurrentDocumentUpdateTime
= lens _pdddCurrentDocumentUpdateTime
(\ s a -> s{_pdddCurrentDocumentUpdateTime = a})
. mapping _DateTime
-- | Required. The resource name of the Document to delete. In the format:
-- \`projects\/{project_id}\/databases\/{database_id}\/documents\/{document_path}\`.
pdddName :: Lens' ProjectsDatabasesDocumentsDelete Text
pdddName = lens _pdddName (\ s a -> s{_pdddName = a})
-- | JSONP
pdddCallback :: Lens' ProjectsDatabasesDocumentsDelete (Maybe Text)
pdddCallback
= lens _pdddCallback (\ s a -> s{_pdddCallback = a})
instance GoogleRequest
ProjectsDatabasesDocumentsDelete
where
type Rs ProjectsDatabasesDocumentsDelete = Empty
type Scopes ProjectsDatabasesDocumentsDelete =
'["https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/datastore"]
requestClient ProjectsDatabasesDocumentsDelete'{..}
= go _pdddName _pdddXgafv _pdddUploadProtocol
_pdddCurrentDocumentExists
_pdddAccessToken
_pdddUploadType
_pdddCurrentDocumentUpdateTime
_pdddCallback
(Just AltJSON)
fireStoreService
where go
= buildClient
(Proxy ::
Proxy ProjectsDatabasesDocumentsDeleteResource)
mempty
|
brendanhay/gogol
|
gogol-firestore/gen/Network/Google/Resource/FireStore/Projects/Databases/Documents/Delete.hs
|
mpl-2.0
| 6,299
| 0
| 17
| 1,326
| 869
| 505
| 364
| 127
| 1
|
module MedicalAdvice.Lib where
import System.Random (randomRIO)
pickRandom :: [a] -> IO a
pickRandom l = do
idx <- randomRIO (0,length l - 1)
return $ l !! idx
|
ToJans/learninghaskell
|
0004AmISick/MedicalAdvice/Lib.hs
|
unlicense
| 176
| 0
| 11
| 44
| 73
| 38
| 35
| 6
| 1
|
module Parser (parse) where
import qualified AST as AST
import qualified Tokenizer as T
parseScope :: [T.Token] -> ([AST.AST], [T.Token])
parseScope [] = error "parser: end of stream"
parseScope (T.ScopeEnd : ts) = ([], ts)
parseScope ts = (ast : asts, tsss)
where (ast, tss) = parseAST ts
(asts, tsss) = parseScope tss
parseAST :: [T.Token] -> (AST.AST, [T.Token])
parseAST (T.Number x : ts) = (AST.Num x, ts)
parseAST (T.Identifier name : ts) = (AST.Identifier name, ts)
parseAST (T.Equals : T.Identifier id : ts) = (AST.Var id ast, tss)
where (ast, tss) = parseAST ts
parseAST (T.ScopeBegin : ts) = (AST.Scope asts, tss)
where (asts, tss) = parseScope ts
parseAST (T.Lambda : ts) = (AST.Lambda (map (\(T.Identifier n) -> n) ids) ast [], tsss)
where (ids, _:tss) = break T.isLambda ts
(ast, tsss) = parseAST tss
parseAST [] = error "parser: end of stream"
parseAST _ = error "parser: syntax error"
parseAll :: [T.Token] -> [AST.AST]
parseAll [] = []
parseAll ts = ast : parseAll tss
where (ast, tss) = parseAST ts
parse :: [T.Token] -> AST.AST
parse = AST.Scope . parseAll
|
shockkolate/shockklang2
|
Parser.hs
|
apache-2.0
| 1,107
| 0
| 13
| 215
| 541
| 293
| 248
| 27
| 1
|
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-}
module Network.Riak.Protocol.PingRequest (PingRequest(..)) where
import Prelude ((+), (/))
import qualified Prelude as Prelude'
import qualified Data.Typeable as Prelude'
import qualified Data.Data as Prelude'
import qualified Text.ProtocolBuffers.Header as P'
data PingRequest = PingRequest{}
deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data)
instance P'.Mergeable PingRequest where
mergeAppend PingRequest PingRequest = PingRequest
instance P'.Default PingRequest where
defaultValue = PingRequest
instance P'.Wire PingRequest where
wireSize ft' self'@(PingRequest)
= case ft' of
10 -> calc'Size
11 -> P'.prependMessageSize calc'Size
_ -> P'.wireSizeErr ft' self'
where
calc'Size = 0
wirePut ft' self'@(PingRequest)
= case ft' of
10 -> put'Fields
11 -> do
P'.putSize (P'.wireSize 10 self')
put'Fields
_ -> P'.wirePutErr ft' self'
where
put'Fields
= do
Prelude'.return ()
wireGet ft'
= case ft' of
10 -> P'.getBareMessageWith update'Self
11 -> P'.getMessageWith update'Self
_ -> P'.wireGetErr ft'
where
update'Self wire'Tag old'Self
= case wire'Tag of
_ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self
instance P'.MessageAPI msg' (msg' -> PingRequest) PingRequest where
getVal m' f' = f' m'
instance P'.GPB PingRequest
instance P'.ReflectDescriptor PingRequest where
getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [])
reflectDescriptorInfo _
= Prelude'.read
"DescriptorInfo {descName = ProtoName {protobufName = FIName \".Protocol.PingRequest\", haskellPrefix = [MName \"Network\",MName \"Riak\"], parentModule = [MName \"Protocol\"], baseName = MName \"PingRequest\"}, descFilePath = [\"Network\",\"Riak\",\"Protocol\",\"PingRequest.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False}"
|
bumptech/riak-haskell-client
|
protobuf/src/Network/Riak/Protocol/PingRequest.hs
|
apache-2.0
| 2,294
| 1
| 16
| 478
| 493
| 260
| 233
| 47
| 0
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | Implementation of a transition map build on top of the "M.Map" container.
module Data.DAWG.Trans.Map
( Trans (unTrans)
) where
import Prelude hiding (lookup)
import Data.Binary (Binary)
import qualified Data.Map as M
import Data.DAWG.Types
import qualified Data.DAWG.Trans as C
-- | A vector of distinct key/value pairs strictly ascending with respect
-- to key values.
newtype Trans = Trans { unTrans :: M.Map Sym ID }
deriving (Show, Eq, Ord, Binary)
instance C.Trans Trans where
empty = Trans M.empty
{-# INLINE empty #-}
lookup x = M.lookup x . unTrans
{-# INLINE lookup #-}
index x = M.lookupIndex x . unTrans
{-# INLINE index #-}
byIndex i (Trans m) =
let n = M.size m
in if i >= 0 && i < n
then Just (M.elemAt i m)
else Nothing
{-# INLINE byIndex #-}
insert x y (Trans m) = Trans (M.insert x y m)
{-# INLINE insert #-}
fromList = Trans . M.fromList
{-# INLINE fromList #-}
toList = M.toList . unTrans
{-# INLINE toList #-}
|
kawu/dawg
|
src/Data/DAWG/Trans/Map.hs
|
bsd-2-clause
| 1,093
| 2
| 12
| 287
| 285
| 161
| 124
| 32
| 0
|
{- |
Module : Data.Graph.Analysis.Algorithms
Description : Graph analysis algorithms
Copyright : (c) Ivan Lazar Miljenovic 2009
License : 2-Clause BSD
Maintainer : Ivan.Miljenovic@gmail.com
This module exports all the algorithms found in the
@Data.Graph.Analysis.Algorithms.*@ modules.
-}
module Data.Graph.Analysis.Algorithms
( -- * Graph Algorithms
-- $algorithms
module Data.Graph.Analysis.Algorithms.Common,
module Data.Graph.Analysis.Algorithms.Directed,
module Data.Graph.Analysis.Algorithms.Clustering
) where
-- For haddock purposes.
import Data.Graph.Inductive.Graph(Node)
import Data.Graph.Analysis.Algorithms.Common
import Data.Graph.Analysis.Algorithms.Directed
import Data.Graph.Analysis.Algorithms.Clustering
{- $algorithms
For algorithms that return a group of nodes, there are typically
two different forms: the standard form (e.g. 'cliquesIn') will
return a list of @LNode@s, whilst the primed version
(e.g. `cliquesIn'') will return a list of 'Node's.
-}
|
ivan-m/Graphalyze
|
Data/Graph/Analysis/Algorithms.hs
|
bsd-2-clause
| 1,056
| 0
| 5
| 188
| 78
| 59
| 19
| 9
| 0
|
-- |
-- Module : Text.Megaparsec.Prim
-- Copyright : © 2015 Megaparsec contributors
-- © 2007 Paolo Martini
-- © 1999–2001 Daan Leijen
-- License : BSD3
--
-- Maintainer : Mark Karpov <markkarpov@opmbx.org>
-- Stability : experimental
-- Portability : portable
--
-- The primitive parser combinators.
{-# OPTIONS_HADDOCK not-home #-}
module Text.Megaparsec.Prim
( -- * Used data-types
State (..)
, Stream (..)
, Consumed (..)
, Reply (..)
, Parsec
, ParsecT
-- * Running parser
, runParser
, runParserT
, parse
, parse'
, parseTest
-- * Primitive combinators
, unexpected
, (<?>)
, label
, hidden
, try
, lookAhead
, notFollowedBy
, eof
, token
, tokens
-- * Parser state combinators
, getPosition
, setPosition
, getInput
, setInput
, getParserState
, setParserState
, updateParserState
-- * User state combinators
, getState
, setState
, modifyState )
where
import Data.Bool (bool)
import Data.Monoid
import Control.Monad
import Control.Monad.Cont.Class
import Control.Monad.Error.Class
import Control.Monad.Identity
import Control.Monad.Reader.Class
import Control.Monad.State.Class hiding (state)
import Control.Monad.Trans
import qualified Control.Applicative as A
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as BL
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import Text.Megaparsec.Error
import Text.Megaparsec.Pos
import Text.Megaparsec.ShowToken
-- | This is Megaparsec state, this is parametrized over stream type @s@, and
-- user state @u@.
data State s u = State
{ stateInput :: s
, statePos :: !SourcePos
, stateUser :: !u }
deriving (Show, Eq)
-- | An instance of @Stream s m t@ has stream type @s@, underlying monad @m@
-- and token type @t@ determined by the stream.
--
-- Some rough guidelines for a “correct” instance of Stream:
--
-- * @unfoldM uncons@ gives the @[t]@ corresponding to the stream.
-- * A @Stream@ instance is responsible for maintaining the “position
-- within the stream” in the stream state @s@. This is trivial unless
-- you are using the monad in a non-trivial way.
class (Monad m, ShowToken t) => Stream s m t | s -> t where
uncons :: s -> m (Maybe (t, s))
instance (Monad m, ShowToken t) => Stream [t] m t where
uncons [] = return Nothing
uncons (t:ts) = return $ Just (t, ts)
{-# INLINE uncons #-}
instance Monad m => Stream B.ByteString m Char where
uncons = return . B.uncons
instance Monad m => Stream BL.ByteString m Char where
uncons = return . BL.uncons
instance Monad m => Stream T.Text m Char where
uncons = return . T.uncons
{-# INLINE uncons #-}
instance Monad m => Stream TL.Text m Char where
uncons = return . TL.uncons
{-# INLINE uncons #-}
-- | This data structure represents an aspect of result of parser's
-- work. The two constructors have the following meaning:
--
-- * @Cosumed@ is a wrapper for result when some part of input stream
-- was consumed.
-- * @Empty@ is a wrapper for result when input stream is empty.
--
-- See also: 'Reply'.
data Consumed a
= Consumed a
| Empty !a
-- | This data structure represents an aspect of result of parser's
-- work. The two constructors have the following meaning:
--
-- * @Ok@ for successfully run parser.
-- * @Error@ for failed parser.
--
-- See also 'Consumed'.
data Reply s u a
= Ok a !(State s u)
| Error ParseError
-- | 'Hints' represent collection of strings to be included into 'ParserError'
-- as “expected” messages when a parser fails without consuming input right
-- after successful parser that produced the hints.
--
-- For example, without hints you could get:
--
-- >>> parseTest (many (char 'r') <* eof) "ra"
-- parse error at line 1, column 2:
-- unexpected 'a'
-- expecting end of input
--
-- we're getting better error messages with help of hints:
--
-- >>> parseTest (many (char 'r') <* eof) "ra"
-- parse error at line 1, column 2:
-- unexpected 'a'
-- expecting 'r' or end of input
newtype Hints = Hints [[String]] deriving Monoid
-- | Convert 'ParseError' record into 'Hints'.
toHints :: ParseError -> Hints
toHints err = Hints hints
where hints = if null msgs then [] else [messageString <$> msgs]
msgs = filter ((== 1) . fromEnum) $ errorMessages err
-- | @withHints hs c@ makes “error” continuation @c@ use given hints @hs@.
withHints :: Hints -> (ParseError -> m b) -> ParseError -> m b
withHints (Hints xs) c = c . addHints
where addHints err = foldr addErrorMessage err (Expected <$> concat xs)
-- | @accHints hs c@ results in “OK” continuation that will add given hints
-- @hs@ to third argument of original continuation @c@.
accHints :: Hints -> (a -> State s u -> Hints -> m b) ->
a -> State s u -> Hints -> m b
accHints hs1 c x s hs2 = c x s (hs1 <> hs2)
-- | Replace most recent group of hints (if any) with given string. Used in
-- 'label' combinator.
refreshLastHint :: Hints -> String -> Hints
refreshLastHint (Hints []) _ = Hints []
refreshLastHint (Hints (_:xs)) "" = Hints xs
refreshLastHint (Hints (_:xs)) l = Hints ([l]:xs)
-- If you're reading this, you may be interested in how Megaparsec works on
-- lower level. That's quite simple. 'ParsecT' is a wrapper around function
-- that takes five arguments:
--
-- * State. It includes input stream, position in input stream and
-- user's backtracking state.
--
-- * “Consumed-OK” continuation (cok). This is just a function that
-- takes three arguments: result of parsing, state after parsing, and
-- hints (see their description above). This continuation is called when
-- something has been consumed during parsing and result is OK (no error
-- occurred).
--
-- * “Consumed-error” continuation (cerr). This function is called when
-- some part of input stream has been consumed and parsing resulted in
-- an error. When error happens, parsing stops and we're only interested
-- in error message, so this continuation takes 'ParseError' as its only
-- argument.
--
-- * “Empty-OK” continuation (eok). The function takes the same
-- arguments as “consumed-OK” continuation. “Empty-OK” is called when no
-- input has been consumed and no error occurred.
--
-- * “Empty-error” continuation (eerr). The function is called when no
-- input has been consumed, but nonetheless parsing resulted in an
-- error. Just like “consumed-error”, the continuation take single
-- argument — 'ParseError' record.
--
-- You call specific continuation when you want to proceed in that specific
-- branch of control flow.
-- | @Parsec@ is non-transformer variant of more general @ParsecT@
-- monad-transformer.
type Parsec s u = ParsecT s u Identity
-- | @ParsecT s u m a@ is a parser with stream type @s@, user state type @u@,
-- underlying monad @m@ and return type @a@. Parsec is strict in the user
-- state. If this is undesirable, simply use a data type like @data Box a =
-- Box a@ and the state type @Box YourStateType@ to add a level of
-- indirection.
newtype ParsecT s u m a = ParsecT
{ unParser :: forall b . State s u
-> (a -> State s u -> Hints -> m b) -- consumed-OK
-> (ParseError -> m b) -- consumed-error
-> (a -> State s u -> Hints -> m b) -- empty-OK
-> (ParseError -> m b) -- empty-error
-> m b }
instance Functor (ParsecT s u m) where
fmap = parsecMap
parsecMap :: (a -> b) -> ParsecT s u m a -> ParsecT s u m b
parsecMap f p = ParsecT $ \s cok cerr eok eerr ->
unParser p s (cok . f) cerr (eok . f) eerr
instance A.Applicative (ParsecT s u m) where
pure = return
(<*>) = ap
(*>) = (>>)
p1 <* p2 = do { x1 <- p1 ; void p2 ; return x1 }
instance A.Alternative (ParsecT s u m) where
empty = mzero
(<|>) = mplus
many p = reverse <$> manyAcc p
manyAcc :: ParsecT s u m a -> ParsecT s u m [a]
manyAcc p = ParsecT $ \s cok cerr eok _ ->
let errToHints c err = c (toHints err)
walk xs x s' _ =
unParser p s'
(seq xs $ walk $ x:xs) -- consumed-OK
cerr -- consumed-error
manyErr -- empty-OK
(errToHints $ cok (x:xs) s') -- empty-error
in unParser p s (walk []) cerr manyErr (errToHints $ eok [] s)
manyErr :: a
manyErr = error
"Text.Megaparsec.Prim.many: combinator 'many' is applied to a parser \
\that accepts an empty string."
instance Monad (ParsecT s u m) where
return = parserReturn
(>>=) = parserBind
fail = parserFail
parserReturn :: a -> ParsecT s u m a
parserReturn x = ParsecT $ \s _ _ eok _ -> eok x s mempty
parserBind :: ParsecT s u m a -> (a -> ParsecT s u m b) -> ParsecT s u m b
{-# INLINE parserBind #-}
parserBind m k = ParsecT $ \s cok cerr eok eerr ->
let mcok x s' hs = unParser (k x) s' cok cerr
(accHints hs cok) (withHints hs cerr)
meok x s' hs = unParser (k x) s' cok cerr
(accHints hs eok) (withHints hs eerr)
in unParser m s mcok cerr meok eerr
parserFail :: String -> ParsecT s u m a
parserFail msg = ParsecT $ \s _ _ _ eerr ->
eerr $ newErrorMessage (Message msg) (statePos s)
-- | Low-level unpacking of the ParsecT type. To actually run parser see
-- 'runParserT' and 'runParser'.
runParsecT :: Monad m =>
ParsecT s u m a -> State s u -> m (Consumed (m (Reply s u a)))
runParsecT p s = unParser p s cok cerr eok eerr
where cok a s' _ = return . Consumed . return $ Ok a s'
cerr err = return . Consumed . return $ Error err
eok a s' _ = return . Empty . return $ Ok a s'
eerr err = return . Empty . return $ Error err
-- | Low-level creation of the ParsecT type. You really shouldn't have to do
-- this.
mkPT :: Monad m =>
(State s u -> m (Consumed (m (Reply s u a)))) -> ParsecT s u m a
mkPT k = ParsecT $ \s cok cerr eok eerr -> do
cons <- k s
case cons of
Consumed mrep -> do
rep <- mrep
case rep of
Ok x s' -> cok x s' mempty
Error err -> cerr err
Empty mrep -> do
rep <- mrep
case rep of
Ok x s' -> eok x s' mempty
Error err -> eerr err
instance MonadIO m => MonadIO (ParsecT s u m) where
liftIO = lift . liftIO
instance MonadReader r m => MonadReader r (ParsecT s u m) where
ask = lift ask
local f p = mkPT $ \s -> local f (runParsecT p s)
instance MonadState s m => MonadState s (ParsecT s' u m) where
get = lift get
put = lift . put
instance MonadCont m => MonadCont (ParsecT s u m) where
callCC f = mkPT $ \s ->
callCC $ \c ->
runParsecT (f (\a -> mkPT $ \s' -> c (pack s' a))) s
where pack s a = Empty $ return (Ok a s)
instance MonadError e m => MonadError e (ParsecT s u m) where
throwError = lift . throwError
p `catchError` h = mkPT $ \s ->
runParsecT p s `catchError` \e ->
runParsecT (h e) s
instance MonadPlus (ParsecT s u m) where
mzero = parserZero
mplus = parserPlus
parserZero :: ParsecT s u m a
parserZero = ParsecT $ \(State _ pos _) _ _ _ eerr ->
eerr $ newErrorUnknown pos
parserPlus :: ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
{-# INLINE parserPlus #-}
parserPlus m n = ParsecT $ \s cok cerr eok eerr ->
let meerr err =
let ncerr err' = cerr (mergeError err' err)
neok x s' hs = eok x s' (toHints err <> hs)
neerr err' = eerr (mergeError err' err)
in unParser n s cok ncerr neok neerr
in unParser m s cok cerr eok meerr
instance MonadTrans (ParsecT s u) where
lift amb = ParsecT $ \s _ _ eok _ -> amb >>= \a -> eok a s mempty
-- Running a parser
-- | The most general way to run a parser over the identity monad.
-- @runParser p state filePath input@ runs parser @p@ on the input list of
-- tokens @input@, obtained from source @filePath@ with the initial user
-- state @st@. The @filePath@ is only used in error messages and may be the
-- empty string. Returns either a 'ParseError' ('Left') or a value of type
-- @a@ ('Right').
--
-- > parseFromFile p fname = runParser p () fname <$> readFile fname
runParser :: Stream s Identity t =>
Parsec s u a -> u -> SourceName -> s -> Either ParseError a
runParser p u name s = runIdentity $ runParserT p u name s
-- | The most general way to run a parser. @runParserT p state filePath
-- input@ runs parser @p@ on the input list of tokens @input@, obtained from
-- source @filePath@ with the initial user state @st@. The @filePath@ is
-- only used in error messages and may be the empty string. Returns a
-- computation in the underlying monad @m@ that return either a 'ParseError'
-- ('Left') or a value of type @a@ ('Right').
runParserT :: Stream s m t =>
ParsecT s u m a -> u -> SourceName -> s -> m (Either ParseError a)
runParserT p u name s = do
res <- runParsecT p (State s (initialPos name) u)
r <- parserReply res
case r of
Ok x _ -> return $ Right x
Error err -> return $ Left err
where parserReply res =
case res of
Consumed r -> r
Empty r -> r
-- | @parse p filePath input@ runs a parser @p@ over identity without user
-- state. The @filePath@ is only used in error messages and may be the empty
-- string. Returns either a 'ParseError' ('Left') or a value of type @a@
-- ('Right').
--
-- > main = case (parse numbers "" "11, 2, 43") of
-- > Left err -> print err
-- > Right xs -> print (sum xs)
-- >
-- > numbers = commaSep integer
parse :: Stream s Identity t =>
Parsec s () a -> SourceName -> s -> Either ParseError a
parse p = runParser p ()
-- | @parse' p input@ runs parser @p@ on @input@ and returns result
-- inside 'Just' on success and 'Nothing' on failure. This function also
-- parses 'eof', so all input should be consumed by the parser @p@.
--
-- The function is supposed to be useful for lightweight parsing, where
-- error messages (and thus file name) are not important and entire input
-- should be parsed. For example it can be used when parsing of single
-- number according to specification of its format is desired.
parse' :: Stream s Identity t => Parsec s () a -> s -> Maybe a
parse' p s =
case parse (p <* eof) "" s of
Left _ -> Nothing
Right x -> Just x
-- | The expression @parseTest p input@ applies a parser @p@ against
-- input @input@ and prints the result to stdout. Used for testing.
parseTest :: (Stream s Identity t, Show a) => Parsec s () a -> s -> IO ()
parseTest p input =
case parse p "" input of
Left err -> putStr "parse error at " >> print err
Right x -> print x
-- Primitive combinators
-- | The parser @unexpected msg@ always fails with an unexpected error
-- message @msg@ without consuming any input.
--
-- The parsers 'fail', ('<?>') and @unexpected@ are the three parsers used
-- to generate error messages. Of these, only ('<?>') is commonly used.
unexpected :: Stream s m t => String -> ParsecT s u m a
unexpected msg = ParsecT $ \(State _ pos _) _ _ _ eerr ->
eerr $ newErrorMessage (Unexpected msg) pos
infix 0 <?>
-- | The parser @p \<?> msg@ behaves as parser @p@, but whenever the
-- parser @p@ fails /without consuming any input/, it replaces expect error
-- messages with the expect error message @msg@.
--
-- This is normally used at the end of a set alternatives where we want to
-- return an error message in terms of a higher level construct rather than
-- returning all possible characters. For example, if the @expr@ parser from
-- the “try” example would fail, the error message is: “…: expecting
-- expression”. Without the @(\<?>)@ combinator, the message would be like
-- “…: expecting \"let\" or letter”, which is less friendly.
(<?>) :: ParsecT s u m a -> String -> ParsecT s u m a
(<?>) = flip label
-- | A synonym for @(\<?>)@, but as a function instead of an operator.
label :: String -> ParsecT s u m a -> ParsecT s u m a
label l p = ParsecT $ \s cok cerr eok eerr ->
let cok' x s' hs = cok x s' $ refreshLastHint hs l
eok' x s' hs = eok x s' $ refreshLastHint hs l
eerr' err = eerr $ setErrorMessage (Expected l) err
in unParser p s cok' cerr eok' eerr'
-- | @hidden p@ behaves just like parser @p@, but it doesn't show any “expected”
-- tokens in error message when @p@ fails.
hidden :: ParsecT s u m a -> ParsecT s u m a
hidden = label ""
-- | The parser @try p@ behaves like parser @p@, except that it
-- pretends that it hasn't consumed any input when an error occurs.
--
-- This combinator is used whenever arbitrary look ahead is needed. Since it
-- pretends that it hasn't consumed any input when @p@ fails, the ('A.<|>')
-- combinator will try its second alternative even when the first parser
-- failed while consuming input.
--
-- For example, here is a parser that will /try/ (sorry for the pun) to
-- parse word “let” or “lexical”:
--
-- >>> parseTest (string "let" <|> string "lexical") "lexical"
-- parse error at line 1, column 1:
-- unexpected "lex"
-- expecting "let"
--
-- First parser consumed “le” and failed, @string "lexical"@ couldn't
-- succeed with “xical” as its input! Things get much better with help of
-- @try@:
--
-- >>> parseTest (try (string "let") <|> string "lexical") "lexical"
-- "lexical"
--
-- @try@ also improves error messages in case of overlapping alternatives,
-- because Megaparsec's hint system can be used:
--
-- >>> parseTest (try (string "let") <|> string "lexical") "le"
-- parse error at line 1, column 1:
-- unexpected "le"
-- expecting "let" or "lexical"
try :: ParsecT s u m a -> ParsecT s u m a
try p = ParsecT $ \s cok _ eok eerr -> unParser p s cok eerr eok eerr
-- | @lookAhead p@ parses @p@ without consuming any input.
--
-- If @p@ fails and consumes some input, so does @lookAhead@. Combine with
-- 'try' if this is undesirable.
lookAhead :: Stream s m t => ParsecT s u m a -> ParsecT s u m a
lookAhead p = ParsecT $ \s _ cerr eok eerr ->
let eok' a _ _ = eok a s mempty
in unParser p s eok' cerr eok' eerr
-- | @notFollowedBy p@ only succeeds when parser @p@ fails. This parser
-- does not consume any input and can be used to implement the “longest
-- match” rule.
notFollowedBy :: Stream s m t => ParsecT s u m a -> ParsecT s u m ()
notFollowedBy p = ParsecT $ \s@(State input pos _) _ _ eok eerr -> do
l <- maybe eoi (showToken . fst) <$> uncons input
let cok' _ _ _ = eerr $ unexpectedErr l pos
cerr' _ = eok () s mempty
eok' _ _ _ = eerr $ unexpectedErr l pos
eerr' _ = eok () s mempty
unParser p s cok' cerr' eok' eerr'
-- | This parser only succeeds at the end of the input.
eof :: Stream s m t => ParsecT s u m ()
eof = eof' <?> eoi
eof' :: Stream s m t => ParsecT s u m ()
eof' = ParsecT $ \s@(State input pos _) _ _ eok eerr -> do
r <- uncons input
case r of
Nothing -> eok () s mempty
Just (x,_) -> eerr $ unexpectedErr (showToken x) pos
-- | The parser @token nextPos testTok@ accepts a token @t@ with result
-- @x@ when the function @testTok t@ returns @'Just' x@. The position of the
-- /next/ token should be returned when @nextPos@ is called with the current
-- source position @pos@, the current token @t@ and the rest of the tokens
-- @toks@, @nextPos pos t toks@.
--
-- This is the most primitive combinator for accepting tokens. For example,
-- the 'Text.Megaparsec.Char.char' parser could be implemented as:
--
-- > char c = token nextPos testChar
-- > where testChar x = if x == c then Just x else Nothing
-- > nextPos pos x xs = updatePosChar pos x
token :: Stream s m t =>
(SourcePos -> t -> s -> SourcePos) -- ^ Next position calculating function.
-> (t -> Either [Message] a) -- ^ Matching function for the token to parse.
-> ParsecT s u m a
{-# INLINE token #-}
token nextpos test = ParsecT $ \(State input pos u) cok _ _ eerr -> do
r <- uncons input
case r of
Nothing -> eerr $ unexpectedErr eoi pos
Just (c,cs) ->
case test c of
Left ms -> eerr $ foldr addErrorMessage (newErrorUnknown pos) ms
Right x -> let newpos = nextpos pos c cs
newstate = State cs newpos u
in seq newpos $ seq newstate $ cok x newstate mempty
-- | The parser @tokens posFromTok test@ parses list of tokens and returns
-- it. The resulting parser will use 'showToken' to pretty-print the
-- collection of tokens. Supplied predicate @test@ is used to check equality
-- of given and parsed tokens.
--
-- This can be used to example to write 'Text.Megaparsec.Char.string':
--
-- > string = tokens updatePosString (==)
tokens :: (Stream s m t, Eq t, ShowToken [t]) =>
(SourcePos -> [t] -> SourcePos) -- ^ Computes position of tokens.
-> (t -> t -> Bool) -- ^ Predicate to check equality of tokens.
-> [t] -- ^ List of tokens to parse
-> ParsecT s u m [t]
{-# INLINE tokens #-}
tokens _ _ [] = ParsecT $ \s _ _ eok _ -> eok [] s mempty
tokens nextpos test tts = ParsecT $ \(State input pos u) cok cerr _ eerr ->
let errExpect x = setErrorMessage (Expected $ showToken tts)
(newErrorMessage (Unexpected x) pos)
walk [] _ rs = let pos' = nextpos pos tts
s' = State rs pos' u
in cok tts s' mempty
walk (t:ts) is rs = do
sr <- uncons rs
let errorCont = if null is then eerr else cerr
what = bool (showToken $ reverse is) "end of input" (null is)
case sr of
Nothing -> errorCont . errExpect $ what
Just (x,xs)
| test t x -> walk ts (x:is) xs
| otherwise -> errorCont . errExpect . showToken $ reverse (x:is)
in walk tts [] input
unexpectedErr :: String -> SourcePos -> ParseError
unexpectedErr msg = newErrorMessage (Unexpected msg)
eoi :: String
eoi = "end of input"
-- Parser state combinators
-- | Returns the current source position. See also 'SourcePos'.
getPosition :: Monad m => ParsecT s u m SourcePos
getPosition = statePos <$> getParserState
-- | @setPosition pos@ sets the current source position to @pos@.
setPosition :: Monad m => SourcePos -> ParsecT s u m ()
setPosition pos = updateParserState (\(State s _ u) -> State s pos u)
-- | Returns the current input.
getInput :: Monad m => ParsecT s u m s
getInput = stateInput <$> getParserState
-- | @setInput input@ continues parsing with @input@. The 'getInput' and
-- @setInput@ functions can for example be used to deal with #include files.
setInput :: Monad m => s -> ParsecT s u m ()
setInput s = updateParserState (\(State _ pos u) -> State s pos u)
-- | Returns the full parser state as a 'State' record.
getParserState :: Monad m => ParsecT s u m (State s u)
getParserState = ParsecT $ \s _ _ eok _ -> eok s s mempty
-- | @setParserState st@ set the full parser state to @st@.
setParserState :: Monad m => State s u -> ParsecT s u m ()
setParserState st = updateParserState (const st)
-- | @updateParserState f@ applies function @f@ to the parser state.
updateParserState :: (State s u -> State s u) -> ParsecT s u m ()
updateParserState f = ParsecT $ \s _ _ eok _ -> eok () (f s) mempty
-- User state combinators
-- | Returns the current user state.
getState :: Monad m => ParsecT s u m u
getState = stateUser <$> getParserState
-- | @setState st@ set the user state to @st@.
setState :: Monad m => u -> ParsecT s u m ()
setState u = updateParserState (\s -> s { stateUser = u })
-- | @modifyState f@ applies function @f@ to the user state. Suppose
-- that we want to count identifiers in a source, we could use the user
-- state as:
--
-- > expr = Id <$> identifier <* modifyState (+1)
modifyState :: Monad m => (u -> u) -> ParsecT s u m ()
modifyState f = updateParserState (\s -> s { stateUser = f (stateUser s)})
|
omefire/megaparsec
|
Text/Megaparsec/Prim.hs
|
bsd-2-clause
| 24,033
| 0
| 20
| 5,901
| 5,730
| 3,018
| 2,712
| -1
| -1
|
{-# LANGUAGE DeriveGeneric #-}
module Dalvik.Instruction
( decodeInstructions
, insnUnitCount
, Reg(..)
, ConstArg(..)
, MoveType(..)
, Move1Type(..)
, AccessType(..)
, AccessOp(..)
, InvokeKind(..)
, CType(..)
, CmpOp(..)
, IfOp(..)
, Unop(..)
, Binop(..)
, Instruction(..)
, DecodeError
) where
import GHC.Generics ( Generic )
import Control.Applicative ()
import qualified Control.Monad.Catch as E
import Control.Monad
import Data.Bits
import Data.Function
import Data.Int
import qualified Data.Serialize as S
import Data.Vector ( Vector, (!) )
import qualified Data.Vector as V
import Data.Word
import Dalvik.Types
data Reg
= R4 Reg4
| R8 Reg8
| R16 Reg16
deriving (Eq, Ord, Show)
data ConstArg
= Const4 Int32
| Const16 Int32
| Const32 Int32
| ConstHigh16 Int32
| ConstWide16 Int64
| ConstWide32 Int64
| ConstWide Int64
| ConstWideHigh16 Int64
| ConstString StringId
| ConstStringJumbo StringId
| ConstClass TypeId
deriving (Eq, Ord, Show)
-- TODO: what's the best encoding for move instructions?
data MoveType
= MNormal
| MWide
| MObject
deriving (Eq, Ord, Show)
data Move1Type
= MResult
| MResultWide
| MResultObject
| MException
deriving (Eq, Ord, Show)
data AccessType
= AWide
| AObject
| ABoolean
| AByte
| AChar
| AShort
deriving (Eq, Ord, Show)
data AccessOp
= Get (Maybe AccessType)
| Put (Maybe AccessType)
deriving (Eq, Ord, Show)
data InvokeKind
= Virtual
| Super
| Direct
| Static
| Interface
deriving (Eq, Ord, Show)
data CType
= Byte
| Char
| Short
| Int
| Long
| Float
| Double
deriving (Eq, Ord, Show, Generic)
instance S.Serialize CType
data CmpOp
= CLFloat
| CGFloat
| CLDouble
| CGDouble
| CLong
deriving (Eq, Ord, Show, Generic)
instance S.Serialize CmpOp
data IfOp
= Eq
| Ne
| Lt
| Ge
| Gt
| Le
deriving (Eq, Ord, Show, Generic)
instance S.Serialize IfOp
data Unop
= NegInt
| NotInt
| NegLong
| NotLong
| NegFloat
| NegDouble
| Convert CType CType
deriving (Eq, Ord, Show, Generic)
instance S.Serialize Unop
data Binop
= Add
| Sub
| Mul
| Div
| Rem
| And
| Or
| Xor
| Shl
| Shr
| UShr
| RSub
deriving (Eq, Ord, Show, Generic)
instance S.Serialize Binop
data Instruction
= Nop
| Move MoveType Reg Reg
| Move1 Move1Type Reg
| ReturnVoid
| Return MoveType Reg
| LoadConst Reg ConstArg
| MonitorEnter Reg8
| MonitorExit Reg8
| CheckCast Reg8 TypeId
| InstanceOf Reg4 Reg4 TypeId
| ArrayLength Reg4 Reg4
| NewInstance Reg8 TypeId
| NewArray Reg4 Reg4 TypeId
-- TODO: is this a good encoding for array instructions?
| FilledNewArray TypeId [Reg4]
| FilledNewArrayRange TypeId [Reg16]
| FillArrayData Reg8 Word32 -- [Word8]
| Throw Reg8
| Goto Int8
| Goto16 Int16
| Goto32 Int32
| PackedSwitch Reg8 Word32
| SparseSwitch Reg8 Word32
| Cmp CmpOp Reg8 Reg8 Reg8
| If IfOp Reg4 Reg4 Int16
| IfZero IfOp Reg8 Int16
| ArrayOp AccessOp Reg8 Reg8 Reg8
| InstanceFieldOp AccessOp Reg4 Reg4 FieldId
| StaticFieldOp AccessOp Reg8 FieldId
-- TODO: how best to encode invoke instructions?
| Invoke InvokeKind Bool MethodId [Reg16]
| Unop Unop Reg4 Reg4
| IBinop Binop Bool Reg8 Reg8 Reg8
| FBinop Binop Bool Reg8 Reg8 Reg8
| IBinopAssign Binop Bool Reg4 Reg4
| FBinopAssign Binop Bool Reg4 Reg4
| BinopLit16 Binop Reg4 Reg4 Int16
| BinopLit8 Binop Reg8 Reg8 Int8
| PackedSwitchData Int32 [Int32]
| SparseSwitchData [Int32] [Int32]
| ArrayData Word16 Word32 [Int64]
deriving (Eq, Ord, Show)
insnUnitCount :: Instruction -> Int
insnUnitCount i =
case i of
Nop -> 1
Move _ (R4 _) _ -> 1
Move _ (R8 _) _ -> 2
Move _ (R16 _) _ -> 3
Move1 {} -> 1
ReturnVoid -> 1
Return {} -> 1
LoadConst _ (Const4 _) -> 1
LoadConst _ (Const16 _) -> 2
LoadConst _ (ConstHigh16 _) -> 2
LoadConst _ (ConstWide16 _) -> 2
LoadConst _ (Const32 _) -> 3
LoadConst _ (ConstWide32 _) -> 3
LoadConst _ (ConstWide _) -> 5
LoadConst _ (ConstWideHigh16 _) -> 2
LoadConst _ (ConstString _) -> 2
LoadConst _ (ConstStringJumbo _) -> 3
LoadConst _ (ConstClass _) -> 2
MonitorEnter {} -> 1
MonitorExit {} -> 1
CheckCast {} -> 2
InstanceOf {} -> 2
ArrayLength {} -> 1
NewInstance {} -> 2
NewArray {} -> 2
FilledNewArray {} -> 3
FilledNewArrayRange {} -> 3
FillArrayData {} -> 3
Throw {} -> 1
Goto {} -> 1
Goto16 {} -> 2
Goto32 {} -> 3
PackedSwitch {} -> 3
SparseSwitch {} -> 3
Cmp {} -> 2
If {} -> 2
IfZero {} -> 2
ArrayOp {} -> 2
InstanceFieldOp {} -> 2
StaticFieldOp {} -> 2
Invoke {} -> 3
Unop {} -> 1
IBinop {} -> 2
FBinop {} -> 2
IBinopAssign {} -> 1
FBinopAssign {} -> 1
BinopLit16 {} -> 2
BinopLit8 {} -> 2
PackedSwitchData _ ts -> (length ts * 2) + 4
SparseSwitchData vs ts -> (length ts + length vs) * 2 + 2
ArrayData wid elts _ ->
fromIntegral ((fromIntegral wid * elts + 1) `div` 2) + 4
splitWord8 :: Word8 -> (Word4, Word4)
splitWord8 w = (fromIntegral $ w `shiftR` 4, fromIntegral $ w .&. 0x0F)
splitWord16 :: Word16 -> (Word8, Word8)
splitWord16 w = (fromIntegral $ w `shiftR` 8, fromIntegral $ w .&. 0x00FF)
splitWord16' :: Word16 -> (Word4, Word4, Word4, Word4)
splitWord16' w = (fst4 b1, snd4 b1, fst4 b2, snd4 b2)
where (b1, b2) = splitWord16 w
prematureEnd :: (E.MonadThrow m) => Word8 -> Word16 -> m v
prematureEnd op ix = E.throwM $ PrematureEnd op ix
invalidOp :: (E.MonadThrow m) => Word8 -> m v
invalidOp op = E.throwM $ InvalidOpcode op
{- As named in the Dalvik VM Instruction Formats document. -}
data IFormatParser
= IF10x Instruction
| IF12x (Word4 -> Word4 -> Instruction)
| IF11n (Word4 -> Word4 -> Instruction)
| IF11x (Word8 -> Instruction)
| IF10t (Word8 -> Instruction)
| IF20t (Word16 -> Instruction)
| IF22x (Word8 -> Word16 -> Instruction)
| IF21t (Word8 -> Word16 -> Instruction)
| IF21s (Word8 -> Word16 -> Instruction)
| IF21h (Word8 -> Word16 -> Instruction)
| IF21c (Word8 -> Word16 -> Instruction)
| IF23x (Word8 -> Word8 -> Word8 -> Instruction)
| IF22b (Word8 -> Word8 -> Word8 -> Instruction)
| IF22t (Word4 -> Word4 -> Word16 -> Instruction)
| IF22s (Word4 -> Word4 -> Word16 -> Instruction)
| IF22c (Word4 -> Word4 -> Word16 -> Instruction)
| IF22cs (Word4 -> Word4 -> Word16 -> Instruction)
| IF30t (Word32 -> Instruction)
| IF32x (Word16 -> Word16 -> Instruction)
| IF31i (Word8 -> Word32 -> Instruction)
| IF31t (Word8 -> Word32 -> Instruction)
| IF31c (Word8 -> Word32 -> Instruction)
| IF35c (Word16 -> [Word4] -> Instruction)
| IF3rc (Word16 -> [Word16] -> Instruction)
| IF51l (Word8 -> Word64 -> Instruction)
| InvalidOp
iparseTable :: Vector IFormatParser
iparseTable = V.fromList $ map snd table -- array (0x00, 0xFF)
where
table :: [(Int, IFormatParser)]
table =
[ (0x00, IF10x Nop)
-- Move
, (0x01, IF12x (Move MNormal `on` R4))
, (0x02, IF22x $ \r1 r2 -> Move MNormal (R8 r1) (R16 r2))
, (0x03, IF32x (Move MNormal `on` R16))
, (0x04, IF12x (Move MWide `on` R4))
, (0x05, IF22x $ \r1 r2 -> Move MWide (R8 r1) (R16 r2))
, (0x06, IF32x (Move MWide `on` R16))
, (0x07, IF12x (Move MObject `on` R4))
, (0x08, IF22x $ \r1 r2 -> Move MObject (R8 r1) (R16 r2))
, (0x09, IF32x (Move MObject `on` R16))
, (0x0a, move1 MResult)
, (0x0b, move1 MResultWide)
, (0x0c, move1 MResultObject)
, (0x0d, move1 MException)
-- Return
, (0x0e, IF10x ReturnVoid)
, (0x0f, ret MNormal)
, (0x10, ret MWide)
, (0x11, ret MObject)
-- Constants
, (0x12, IF11n $ \r c -> LoadConst (R4 r) (const4 c))
, (0x13, IF21s $ \r c -> LoadConst (R8 r) (const16 c))
, (0x14, IF31i $ \r c -> LoadConst (R8 r) (const32 c))
, (0x15, IF21h $ \r c -> LoadConst (R8 r) (constHigh16 c))
, (0x16, IF21s $ \r c -> LoadConst (R8 r) (constWide16 c))
, (0x17, IF31i $ \r c -> LoadConst (R8 r) (constWide32 c))
, (0x18, IF51l $ \r c -> LoadConst (R8 r) (constWide c))
, (0x19, IF21h $ \r c -> LoadConst (R8 r) (constWideHigh16 c))
, (0x1a, IF21c $ \r i -> LoadConst (R8 r) (constString i))
, (0x1b, IF31c $ \r i -> LoadConst (R8 r) (ConstStringJumbo i))
, (0x1c, IF21c $ \r i -> LoadConst (R8 r) (ConstClass i))
-- Monitors
, (0x1d, IF11x MonitorEnter)
, (0x1e, IF11x MonitorExit)
-- Casting
, (0x1f, IF21c CheckCast)
, (0x20, IF22c InstanceOf)
-- Arrays
, (0x21, IF12x ArrayLength)
, (0x22, IF21c NewInstance)
, (0x23, IF22c NewArray)
, (0x24, IF35c FilledNewArray)
, (0x25, IF3rc FilledNewArrayRange)
, (0x26, IF31t FillArrayData)
-- Exceptions
, (0x27, IF11x Throw)
-- Unconditional branches
, (0x28, IF10t $ Goto . fromIntegral)
, (0x29, IF20t $ Goto16 . fromIntegral)
, (0x2a, IF30t $ Goto32 . fromIntegral)
-- Switch
, (0x2b, IF31t $ \r o -> PackedSwitch r o)
, (0x2c, IF31t $ \r o -> SparseSwitch r o)
-- Comparisons
, (0x2d, cmp CLFloat)
, (0x2e, cmp CGFloat)
, (0x2f, cmp CLDouble)
, (0x30, cmp CGDouble)
, (0x31, cmp CLong)
-- If comparisons
, (0x32, ifop Eq)
, (0x33, ifop Ne)
, (0x34, ifop Lt)
, (0x35, ifop Ge)
, (0x36, ifop Gt)
, (0x37, ifop Le)
-- If comparisons with zero
, (0x38, ifzop Eq)
, (0x39, ifzop Ne)
, (0x3a, ifzop Lt)
, (0x3b, ifzop Ge)
, (0x3c, ifzop Gt)
, (0x3d, ifzop Le)
-- Unused
, (0x3e, InvalidOp)
, (0x3f, InvalidOp)
, (0x40, InvalidOp)
, (0x41, InvalidOp)
, (0x42, InvalidOp)
, (0x43, InvalidOp)
-- Array operations
, (0x44, arrop (Get Nothing))
, (0x45, arrop (Get (Just AWide)))
, (0x46, arrop (Get (Just AObject)))
, (0x47, arrop (Get (Just ABoolean)))
, (0x48, arrop (Get (Just AByte)))
, (0x49, arrop (Get (Just AChar)))
, (0x4a, arrop (Get (Just AShort)))
, (0x4b, arrop (Put Nothing))
, (0x4c, arrop (Put (Just AWide)))
, (0x4d, arrop (Put (Just AObject)))
, (0x4e, arrop (Put (Just ABoolean)))
, (0x4f, arrop (Put (Just AByte)))
, (0x50, arrop (Put (Just AChar)))
, (0x51, arrop (Put (Just AShort)))
-- Instance field operations
, (0x52, instop (Get Nothing))
, (0x53, instop (Get (Just AWide)))
, (0x54, instop (Get (Just AObject)))
, (0x55, instop (Get (Just ABoolean)))
, (0x56, instop (Get (Just AByte)))
, (0x57, instop (Get (Just AChar)))
, (0x58, instop (Get (Just AShort)))
, (0x59, instop (Put Nothing))
, (0x5a, instop (Put (Just AWide)))
, (0x5b, instop (Put (Just AObject)))
, (0x5c, instop (Put (Just ABoolean)))
, (0x5d, instop (Put (Just AByte)))
, (0x5e, instop (Put (Just AChar)))
, (0x5f, instop (Put (Just AShort)))
-- Static field operations
, (0x60, statop (Get Nothing))
, (0x61, statop (Get (Just AWide)))
, (0x62, statop (Get (Just AObject)))
, (0x63, statop (Get (Just ABoolean)))
, (0x64, statop (Get (Just AByte)))
, (0x65, statop (Get (Just AChar)))
, (0x66, statop (Get (Just AShort)))
, (0x67, statop (Put Nothing))
, (0x68, statop (Put (Just AWide)))
, (0x69, statop (Put (Just AObject)))
, (0x6a, statop (Put (Just ABoolean)))
, (0x6b, statop (Put (Just AByte)))
, (0x6c, statop (Put (Just AChar)))
, (0x6d, statop (Put (Just AShort)))
-- Invoke with fixed argument counts
, (0x6e, invoke Virtual)
, (0x6f, invoke Super)
, (0x70, invoke Direct)
, (0x71, invoke Static)
, (0x72, invoke Interface)
-- Unused
, (0x73, InvalidOp)
-- Invoke with arbitrary argument counts
, (0x74, invokeRange Virtual)
, (0x75, invokeRange Super)
, (0x76, invokeRange Direct)
, (0x77, invokeRange Static)
, (0x78, invokeRange Interface)
-- Unused
, (0x79, InvalidOp)
, (0x7a, InvalidOp)
-- Unary operators
, (0x7b, unop NegInt)
, (0x7c, unop NotInt)
, (0x7d, unop NegLong)
, (0x7e, unop NotLong)
, (0x7f, unop NegFloat)
, (0x80, unop NegDouble)
, (0x81, unop (Convert Int Long))
, (0x82, unop (Convert Int Float))
, (0x83, unop (Convert Int Double))
, (0x84, unop (Convert Long Int))
, (0x85, unop (Convert Long Float))
, (0x86, unop (Convert Long Double))
, (0x87, unop (Convert Float Int))
, (0x88, unop (Convert Float Long))
, (0x89, unop (Convert Float Double))
, (0x8a, unop (Convert Double Int))
, (0x8b, unop (Convert Double Long))
, (0x8c, unop (Convert Double Float))
, (0x8d, unop (Convert Int Byte))
, (0x8e, unop (Convert Int Char))
, (0x8f, unop (Convert Int Short))
-- Binary operators
, (0x90, ibinop Add)
, (0x91, ibinop Sub)
, (0x92, ibinop Mul)
, (0x93, ibinop Div)
, (0x94, ibinop Rem)
, (0x95, ibinop And)
, (0x96, ibinop Or)
, (0x97, ibinop Xor)
, (0x98, ibinop Shl)
, (0x99, ibinop Shr)
, (0x9a, ibinop UShr)
, (0x9b, lbinop Add)
, (0x9c, lbinop Sub)
, (0x9d, lbinop Mul)
, (0x9e, lbinop Div)
, (0x9f, lbinop Rem)
, (0xa0, lbinop And)
, (0xa1, lbinop Or)
, (0xa2, lbinop Xor)
, (0xa3, lbinop Shl)
, (0xa4, lbinop Shr)
, (0xa5, lbinop UShr)
, (0xa6, fbinop Add)
, (0xa7, fbinop Sub)
, (0xa8, fbinop Mul)
, (0xa9, fbinop Div)
, (0xaa, fbinop Rem)
, (0xab, dbinop Add)
, (0xac, dbinop Sub)
, (0xad, dbinop Mul)
, (0xae, dbinop Div)
, (0xaf, dbinop Rem)
-- Binary assignment operators
, (0xb0, ibinopa Add)
, (0xb1, ibinopa Sub)
, (0xb2, ibinopa Mul)
, (0xb3, ibinopa Div)
, (0xb4, ibinopa Rem)
, (0xb5, ibinopa And)
, (0xb6, ibinopa Or)
, (0xb7, ibinopa Xor)
, (0xb8, ibinopa Shl)
, (0xb9, ibinopa Shr)
, (0xba, ibinopa UShr)
, (0xbb, lbinopa Add)
, (0xbc, lbinopa Sub)
, (0xbd, lbinopa Mul)
, (0xbe, lbinopa Div)
, (0xbf, lbinopa Rem)
, (0xc0, lbinopa And)
, (0xc1, lbinopa Or)
, (0xc2, lbinopa Xor)
, (0xc3, lbinopa Shl)
, (0xc4, lbinopa Shr)
, (0xc5, lbinopa UShr)
, (0xc6, fbinopa Add)
, (0xc7, fbinopa Sub)
, (0xc8, fbinopa Mul)
, (0xc9, fbinopa Div)
, (0xca, fbinopa Rem)
, (0xcb, dbinopa Add)
, (0xcc, dbinopa Sub)
, (0xcd, dbinopa Mul)
, (0xce, dbinopa Div)
, (0xcf, dbinopa Rem)
-- Binary operators with 16-bit literal arguments
, (0xd0, binopl16 Add)
, (0xd1, binopl16 RSub)
, (0xd2, binopl16 Mul)
, (0xd3, binopl16 Div)
, (0xd4, binopl16 Rem)
, (0xd5, binopl16 And)
, (0xd6, binopl16 Or)
, (0xd7, binopl16 Xor)
-- Binary operators with 8-bit literal arguments
, (0xd8, binopl8 Add)
, (0xd9, binopl8 RSub)
, (0xda, binopl8 Mul)
, (0xdb, binopl8 Div)
, (0xdc, binopl8 Rem)
, (0xdd, binopl8 And)
, (0xde, binopl8 Or)
, (0xdf, binopl8 Xor)
, (0xe0, binopl8 Shl)
, (0xe1, binopl8 Shr)
, (0xe2, binopl8 UShr)
-- Unused
, (0xe3, InvalidOp)
, (0xe4, InvalidOp)
, (0xe5, InvalidOp)
, (0xe6, InvalidOp)
, (0xe7, InvalidOp)
, (0xe8, InvalidOp)
, (0xe9, InvalidOp)
, (0xea, InvalidOp)
, (0xeb, InvalidOp)
, (0xec, InvalidOp)
, (0xed, InvalidOp)
, (0xee, InvalidOp)
, (0xef, InvalidOp)
, (0xf0, InvalidOp)
, (0xf1, InvalidOp)
, (0xf2, InvalidOp)
, (0xf3, InvalidOp)
, (0xf4, InvalidOp)
, (0xf5, InvalidOp)
, (0xf6, InvalidOp)
, (0xf7, InvalidOp)
, (0xf8, InvalidOp)
, (0xf9, InvalidOp)
, (0xfa, InvalidOp)
, (0xfb, InvalidOp)
, (0xfc, InvalidOp)
, (0xfd, InvalidOp)
, (0xfe, InvalidOp)
, (0xff, InvalidOp)
]
const4 = Const4 . fromIntegral . signExt4
const16 = Const16 . signExt16 . fromIntegral
const32 = Const32 . fromIntegral
constHigh16 = ConstHigh16 . (`shiftL` 16) . fromIntegral
constWide16 = ConstWide16 . fromIntegral . signExt16 . fromIntegral
constWide32 = ConstWide32 . signExt32 . fromIntegral
constWide = ConstWide . fromIntegral
constWideHigh16 = ConstWideHigh16 . (`shiftL` 48) . fromIntegral
constString = ConstString . fromIntegral
unop op = IF12x $ Unop op
binop c w op = IF23x $ c op w
binopa c w op = IF12x $ c op w
ibinop = binop IBinop False
lbinop = binop IBinop True
fbinop = binop FBinop False
dbinop = binop FBinop True
ibinopa = binopa IBinopAssign False
lbinopa = binopa IBinopAssign True
fbinopa = binopa FBinopAssign False
dbinopa = binopa FBinopAssign True
binopl16 op = IF22s $ \r1 r2 ->
BinopLit16 op r1 r2 . fromIntegral
binopl8 op = IF22b $ \r1 r2 ->
BinopLit8 op r1 r2 . fromIntegral
cmp op = IF23x $ Cmp op
ifop op = IF22t $ \r1 r2 -> If op r1 r2 . fromIntegral
ifzop op = IF21t $ \r -> IfZero op r . fromIntegral
arrop op = IF23x $ ArrayOp op
instop op = IF22c $ InstanceFieldOp op
statop op = IF21c $ StaticFieldOp op
invoke ty = IF35c $ \f -> Invoke ty False f . map fromIntegral
invokeRange ty = IF3rc $ Invoke ty True
ret ty = IF11x $ Return ty . R8
move1 ty = IF11x $ Move1 ty . R8
fst4, snd4 :: Word8 -> Word4
fst4 = fst . splitWord8
snd4 = snd . splitWord8
fst8, snd8 :: Word16 -> Word8
fst8 = fst . splitWord16
snd8 = snd . splitWord16
combine16 :: (Integral a, Num b, Bits b) => a -> a -> b
combine16 w1 w2 = (fromIntegral w1 `shiftL` 16) .|. fromIntegral w2
combine16' :: (Integral a, Num b, Bits b) => a -> a -> a -> a -> b
combine16' w1 w2 w3 w4 =
(fromIntegral w1 `shiftL` 48) .|.
(fromIntegral w2 `shiftL` 32) .|.
(fromIntegral w3 `shiftL` 16) .|.
fromIntegral w4
signExt4 :: Word8 -> Int8
signExt4 w = w' .|. (if w' .&. 0x8 /= 0 then 0xF0 else 0)
where w' = fromIntegral w
signExt16 :: Word32 -> Int32
signExt16 w = w' .|. (if w' .&. 0x8000 /= 0 then 0xFFFF0000 else 0)
where w' = fromIntegral w
signExt32 :: Int64 -> Int64
signExt32 w =
w' .|. (if w' .&. 0x80000000 /= 0 then 0xFFFFFFFF00000000 else 0)
where w' = fromIntegral w
iparser :: Word8 -> IFormatParser
iparser = (iparseTable!) . fromIntegral
dataToInt8List :: (E.MonadThrow m) => [Word16] -> m [Int8]
dataToInt8List ws = go ws
where
go [] = return []
go (w:rest) = do
r <- go rest
let (b1, b2) = splitWord16 w
return $ fromIntegral b1 : fromIntegral b2 : r
dataToInt32List :: (E.MonadThrow m) => [Word16] -> m [Int32]
dataToInt32List ws = go ws
where
go [] = return []
go (w1:w2:rest) = do
r <- go rest
return $ combine16 w2 w1 : r
go _ = E.throwM $ InvalidArrayDataList 2 ws
-- FIXME What is the right order here to correctly decode an int64?
dataToInt64List :: (E.MonadThrow m) => [Word16] -> m [Int64]
dataToInt64List ws = go ws
where
go [] = return []
go (w1:w2:w3:w4:rest) = do
r <- go rest
return $ combine16' w1 w2 w3 w4 : r
go _ = E.throwM $ InvalidArrayDataList 4 ws
decodeInstructions :: (E.MonadThrow m) => [Word16] -> m [Instruction]
decodeInstructions [] = return []
decodeInstructions (0x0100 : sz : k : k' : ws) = do
ts' <- dataToInt32List ts
liftM (PackedSwitchData key ts' :) $ decodeInstructions ws'
where key = combine16 k' k
(ts, ws') = splitAt (2 * fromIntegral sz) ws
decodeInstructions (0x0200 : sz : ws) = do
ks' <- dataToInt32List ks
ts' <- dataToInt32List ts
liftM (SparseSwitchData ks' ts' :) $ decodeInstructions ws''
where (ks, ws') = splitAt sz' ws
(ts, ws'') = splitAt sz' ws'
sz' = fromIntegral $ 2 * sz
decodeInstructions (0x0300 : esz : sz : sz' : ws) = do
vs' <- case esz of
-- In this case, we take the number of elements we need because we
-- are splitting uint16s. If there are supposed to be an odd
-- number of data elements, we will have an extra from the unused
-- byte in the last uint16.
1 -> liftM (take (fromIntegral size) . map fromIntegral) $ dataToInt8List vs
2 -> return $ map fromIntegral vs
4 -> liftM (map fromIntegral) $ dataToInt32List vs
8 -> dataToInt64List vs
_ -> E.throwM $ InvalidArrayDataElementSize esz
liftM (ArrayData esz size vs' :) $ decodeInstructions ws'
where size = combine16 sz' sz
count = ((size * fromIntegral esz) + 1) `div` 2
(vs, ws') = splitAt (fromIntegral count) ws
decodeInstructions (w : ws) = liftM2 (:) insn (decodeInstructions ws'')
where
(aa, op) = splitWord16 w
(b, a) = splitWord8 aa
(insn, ws'') =
case (iparser op, ws) of
(IF10x f, _) -> (return f, ws)
(IF12x f, _) -> (return $ f a b, ws)
(IF11n f, _) -> (return $ f a b, ws)
(IF11x f, _) -> (return $ f aa, ws)
(IF10t f, _) -> (return $ f aa, ws)
(IF20t f, w1 : ws') -> (return $ f w1, ws')
(IF22x f, w1 : ws') -> (return $ f aa w1, ws')
(IF21t f, w1 : ws') -> (return $ f aa w1, ws')
(IF21s f, w1 : ws') -> (return $ f aa w1, ws')
(IF21h f, w1 : ws') -> (return $ f aa w1, ws')
(IF21c f, w1 : ws') -> (return $ f aa w1, ws')
(IF23x f, w1 : ws') -> (return $ f aa (snd8 w1) (fst8 w1), ws')
(IF22b f, w1 : ws') -> (return $ f aa (snd8 w1) (fst8 w1), ws')
(IF22t f, w1 : ws') -> (return $ f a b w1, ws')
(IF22s f, w1 : ws') -> (return $ f a b w1, ws')
(IF22c f, w1 : ws') -> (return $ f a b w1, ws')
(IF22cs f, w1 : ws') -> (return $ f a b w1, ws')
(IF30t f, w1 : w2 : ws') -> (return $ f (combine16 w2 w1), ws')
(IF32x f, w1 : w2 : ws') -> (return $ f w1 w2, ws')
(IF31i f, w1 : w2 : ws') -> (return $ f aa (combine16 w2 w1), ws')
(IF31t f, w1 : w2 : ws') -> (return $ f aa (combine16 w2 w1), ws')
(IF31c f, w1 : w2 : ws') -> (return $ f aa (combine16 w2 w1), ws')
(IF35c fn, w1 : w2 : ws') ->
if b <= 5
then (return $ fn w1 (take (fromIntegral b) [d, e, f, g, a]), ws')
else (E.throwM $ InvalidBForIF35cEncoding b, ws')
where (g, f, e, d) = splitWord16' w2
(IF3rc fn, w1 : w2 : ws') ->
(return $ fn w1 [w2..((w2 + fromIntegral aa) - 1)], ws')
(IF51l fn, w1 : w2 : w3 : w4 : ws') ->
(return $ fn aa (combine16' w4 w3 w2 w1), ws')
(InvalidOp, _) -> (invalidOp op, ws)
_ -> (prematureEnd op w, ws)
{-
encodeInstructions :: [Instruction] -> [Word16]
encodeInstructions = undefined
-}
|
travitch/dalvik
|
src/Dalvik/Instruction.hs
|
bsd-3-clause
| 23,136
| 0
| 18
| 6,729
| 9,494
| 5,236
| 4,258
| 668
| 51
|
module StringUtilsSpec where
import SpecHelper
import System.Time
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "StringUtils" $ do
context "enlarge" $ do
it "enlarges a string by a given factor" $ do
enlarge 5 "fo" `shouldBe` "fo "
context "alignStrings" $ do
it "align many strings based on the longest one" $ do
let strs = ["hey", "hello", "i"]
alignStrings strs `shouldBe` ["hey ", "hello", "i "]
context "getMonthByName" $ do
it "returns month based on name" $ do
getMonthByName "aug" `shouldBe` August
it "returns January when not-existing name passed" $ do
getMonthByName "bla" `shouldBe` January
context "extractMonthAndYear" $ do
it "extracts month and year values" $ do
extractMonthAndYear "feb_2016_costs" `shouldBe` (February, 2016)
context "calTimeToLabel" $ do
it "shapes the label" $ do
let calTime = createCalTime (January, 2016)
calTimeToLabel calTime `shouldBe` "January_2016"
|
Sam-Serpoosh/WatchIt
|
test/StringUtilsSpec.hs
|
bsd-3-clause
| 1,050
| 0
| 20
| 278
| 285
| 137
| 148
| 27
| 1
|
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, ExistentialQuantification #-}
module Test.HyperDex.Shared (sharedTests)
where
import Test.HyperDex.Space
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.HUnit hiding (Test)
import Control.Monad
import Test.Framework.Providers.QuickCheck2
import Test.QuickCheck
import qualified Test.QuickCheck.Monadic as QC
import Test.HyperDex.Util
import Data.Text (Text)
import Data.Text.Encoding
import Data.ByteString.Char8 (ByteString)
import Database.HyperDex
import Database.HyperDex.Utf8
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Int
import Data.Monoid
testCanStoreLargeObject :: ClientConnection -> Test
testCanStoreLargeObject client = testCase "Can store a large object" $ do
let attrs :: [Attribute]
attrs =
[ mkAttributeUtf8 "first" ("" :: ByteString )
, mkAttributeUtf8 "last" ("" :: ByteString )
, mkAttributeUtf8 "score" (0.0 :: Double )
, mkAttributeUtf8 "profile_views" (0 :: Int64 )
, mkAttributeUtf8 "pending_requests" ([] :: [ByteString] )
, mkAttributeUtf8 "rankings" ([] :: [Double] )
, mkAttributeUtf8 "todolist" ([] :: [Int64] )
, mkAttributeUtf8 "hobbies" (Set.empty :: Set ByteString )
, mkAttributeUtf8 "imonafloat" (Set.empty :: Set Double )
, mkAttributeUtf8 "friendids" (Set.empty :: Set Int64 )
, mkAttributeUtf8 "unread_messages" (Map.empty :: Map ByteString ByteString )
, mkAttributeUtf8 "upvotes" (Map.empty :: Map ByteString Int64 )
, mkAttributeUtf8 "friendranks" (Map.empty :: Map ByteString Double )
, mkAttributeUtf8 "posts" (Map.empty :: Map Int64 ByteString )
, mkAttributeUtf8 "friendremapping" (Map.empty :: Map Int64 Int64 )
, mkAttributeUtf8 "intfloatmap" (Map.empty :: Map Int64 Double )
, mkAttributeUtf8 "still_looking" (Map.empty :: Map Double ByteString )
, mkAttributeUtf8 "for_a_reason" (Map.empty :: Map Double Int64 )
, mkAttributeUtf8 "for_float_keyed_map" (Map.empty :: Map Double Double )
]
result <- join $ put defaultSpace "large" attrs client
assertEqual "Could store large object: " (Right ()) result
getResult :: Text -> Either ClientReturnCode [Attribute] -> Either String Attribute
getResult _ (Left returnCode) = Left $ "Failure, returnCode: " <> show returnCode
getResult attribute (Right attrList) =
case (filter (\a -> attrName a == encodeUtf8 attribute) attrList) of
[x] -> Right x
[] -> Left $ "No valid attribute, attributes list: " <> show attrList
_ -> Left "More than one returned value"
putHyper :: ClientConnection -> ByteString -> ByteString -> Attribute -> QC.PropertyM IO (Either ClientReturnCode ())
putHyper client space key attribute = do
QC.run . join $ put space key [attribute] client
getHyper :: ClientConnection -> ByteString -> ByteString -> Text -> QC.PropertyM IO (Either String Attribute)
getHyper client space key attribute = do
eitherAttrList <- QC.run . join $ get space key client
let retValue = getResult attribute eitherAttrList
case retValue of
Left err -> QC.run $ do
putStrLn $ "getHyper encountered error: " <> show err
putStrLn $ "Attribute: "
putStrLn $ show . fmap (filter (\x -> decodeUtf8 (attrName x) == attribute)) $ eitherAttrList
_ -> return ()
return $ retValue
propCanStore :: HyperSerialize a => ClientConnection -> ByteString -> a
-> ByteString -> NonEmptyBS ByteString -> Property
propCanStore client _ input space (NonEmptyBS key) =
QC.monadicIO $ do
let attributeName = decodeUtf8 $ pickAttributeName input
attribute = mkAttributeUtf8 attributeName input
_ <- putHyper client space key attribute
eitherOutput <- getHyper client space key attributeName
case eitherOutput of
Right output -> do
case attribute == output of
True -> QC.assert True
False -> do
QC.run $ do
putStrLn $ "Failed to store value:"
putStrLn $ " space: " <> show space
putStrLn $ " key: " <> show key
putStrLn $ " attr: " <> show attribute
putStrLn $ " output: " <> show output
QC.assert False
Left reason -> do
QC.run $ do
putStrLn $ "Failed to retrieve value:"
putStrLn $ " space: " <> show space
putStrLn $ " key: " <> show key
putStrLn $ " attr: " <> show attribute
putStrLn $ " reason: " <> show reason
QC.assert False
testCanRoundtrip :: ClientConnection -> Test
testCanRoundtrip client =
testProperty
"roundtrip"
$ \(MkHyperSerializable value) -> propCanStore client "arbitrary" value defaultSpace
sharedTests :: Test
sharedTests = buildTest $ do
client <- clientConnect defaultConnectInfo
return $ testGroup "shared"
$ map
(\f -> f client)
[ testCanStoreLargeObject
, testCanRoundtrip
]
|
AaronFriel/hyhac
|
test/Test/HyperDex/Shared.hs
|
bsd-3-clause
| 5,575
| 0
| 23
| 1,696
| 1,444
| 734
| 710
| 109
| 3
|
import Control.Monad.Trans
import Data.List
import qualified Network.HTTP as HTTP
import Network.URI as URI
markup = <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>A poor-man's blog</title>
<meta name="keywords" content="turbinado, haskell, mvc, model, view, controller, ruby, rails" > </meta>
<meta name="description" content="This is a small Blog application written in Turbinado, which is a Model-View-Controller-ish web framework written in Haskell." > </meta>
<% styleSheet "default" "screen"%>
</head>
<body>
----start header --------------
<div id="header">
<div id="menu">
<ul>
<li class="current_page_item"><a href="/Posts/Index"><span class="numbertxt">01 </span>Homepage</a></li>
<li><a href="/Posts/About"><span class="numbertxt">02 </span>About</a></li>
<li class="last"> <a href="/Manage/Home"><span class="numbertxt">03 </span>Manage</a></li>
</ul>
</div>
</div>
<div id="logo">
<h1><a href="#"> A poor-man's</a></h1>
<h1> blog</h1>
</div>
--------end header-------------
--------star page--------------
<div id="page">
<div id="content">
<% insertDefaultView %>
</div>
--- end content --
-- start sidebar --
<div id="sidebar">
<ul>
<li id="search">
<h2>Search</h2>
<form method="post" action="/Posts/Search" >
<fieldset>
<input type="text" id="s" name="s" value=""> </input>
<input type="submit" value="Search" > </input>
</fieldset>
</form>
</li>
</ul>
</div>
-- end sidebar --
<div style="clear: both;"> </div>
</div>
--end page------
-- start footer --
<div id="footer">
<div id="footer-wrap">
<p id="legal">(c) 2009 A poor-man's blog. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>
</div>
-- end footer --
</body>
</html>
|
abuiles/turbinado-blog
|
App/Layouts/Default.hs
|
bsd-3-clause
| 2,337
| 147
| 82
| 790
| 804
| 399
| 405
| -1
| -1
|
{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[TcType]{Types used in the typechecker}
This module provides the Type interface for front-end parts of the
compiler. These parts
* treat "source types" as opaque:
newtypes, and predicates are meaningful.
* look through usage types
The "tc" prefix is for "TypeChecker", because the type checker
is the principal client.
-}
{-# LANGUAGE CPP, ScopedTypeVariables, MultiWayIf, FlexibleContexts #-}
{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
module TcType (
--------------------------------
-- Types
TcType, TcSigmaType, TcRhoType, TcTauType, TcPredType, TcThetaType,
TcTyVar, TcTyVarSet, TcDTyVarSet, TcTyCoVarSet, TcDTyCoVarSet,
TcKind, TcCoVar, TcTyCoVar, TcTyVarBinder, TcTyCon,
KnotTied,
ExpType(..), InferResult(..), ExpSigmaType, ExpRhoType, mkCheckExpType,
SyntaxOpType(..), synKnownType, mkSynFunTys,
-- TcLevel
TcLevel(..), topTcLevel, pushTcLevel, isTopTcLevel,
strictlyDeeperThan, sameDepthAs,
tcTypeLevel, tcTyVarLevel, maxTcLevel,
promoteSkolem, promoteSkolemX, promoteSkolemsX,
--------------------------------
-- MetaDetails
TcTyVarDetails(..), pprTcTyVarDetails, vanillaSkolemTv, superSkolemTv,
MetaDetails(Flexi, Indirect), MetaInfo(..),
isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isTyVarTy,
tcIsTcTyVar, isTyVarTyVar, isOverlappableTyVar, isTyConableTyVar,
isFskTyVar, isFmvTyVar, isFlattenTyVar,
isAmbiguousTyVar, metaTyVarRef, metaTyVarInfo,
isFlexi, isIndirect, isRuntimeUnkSkol,
metaTyVarTcLevel, setMetaTyVarTcLevel, metaTyVarTcLevel_maybe,
isTouchableMetaTyVar,
isFloatedTouchableMetaTyVar,
findDupTyVarTvs, mkTyVarNamePairs,
--------------------------------
-- Builders
mkPhiTy, mkInfSigmaTy, mkSpecSigmaTy, mkSigmaTy,
mkTcAppTy, mkTcAppTys, mkTcCastTy,
--------------------------------
-- Splitters
-- These are important because they do not look through newtypes
getTyVar,
tcSplitForAllTy_maybe,
tcSplitForAllTys, tcSplitForAllTysSameVis,
tcSplitPiTys, tcSplitPiTy_maybe, tcSplitForAllVarBndrs,
tcSplitPhiTy, tcSplitPredFunTy_maybe,
tcSplitFunTy_maybe, tcSplitFunTys, tcFunArgTy, tcFunResultTy, tcFunResultTyN,
tcSplitFunTysN,
tcSplitTyConApp, tcSplitTyConApp_maybe,
tcTyConAppTyCon, tcTyConAppTyCon_maybe, tcTyConAppArgs,
tcSplitAppTy_maybe, tcSplitAppTy, tcSplitAppTys, tcRepSplitAppTy_maybe,
tcRepGetNumAppTys,
tcGetCastedTyVar_maybe, tcGetTyVar_maybe, tcGetTyVar, nextRole,
tcSplitSigmaTy, tcSplitNestedSigmaTys, tcDeepSplitSigmaTy_maybe,
---------------------------------
-- Predicates.
-- Again, newtypes are opaque
eqType, eqTypes, nonDetCmpType, nonDetCmpTypes, eqTypeX,
pickyEqType, tcEqType, tcEqKind, tcEqTypeNoKindCheck, tcEqTypeVis,
isSigmaTy, isRhoTy, isRhoExpTy, isOverloadedTy,
isFloatingTy, isDoubleTy, isFloatTy, isIntTy, isWordTy, isStringTy,
isIntegerTy, isBoolTy, isUnitTy, isCharTy, isCallStackTy, isCallStackPred,
hasIPPred, isTauTy, isTauTyCon, tcIsTyVarTy, tcIsForAllTy,
isPredTy, isTyVarClassPred, isTyVarHead, isInsolubleOccursCheck,
checkValidClsArgs, hasTyVarHead,
isRigidTy, isAlmostFunctionFree,
---------------------------------
-- Misc type manipulators
deNoteType,
orphNamesOfType, orphNamesOfCo,
orphNamesOfTypes, orphNamesOfCoCon,
getDFunTyKey, evVarPred,
---------------------------------
-- Predicate types
mkMinimalBySCs, transSuperClasses,
pickQuantifiablePreds, pickCapturedPreds,
immSuperClasses, boxEqPred,
isImprovementPred,
-- * Finding type instances
tcTyFamInsts, tcTyFamInstsAndVis, tcTyConAppTyFamInstsAndVis, isTyFamFree,
-- * Finding "exact" (non-dead) type variables
exactTyCoVarsOfType, exactTyCoVarsOfTypes,
anyRewritableTyVar,
---------------------------------
-- Foreign import and export
isFFIArgumentTy, -- :: DynFlags -> Safety -> Type -> Bool
isFFIImportResultTy, -- :: DynFlags -> Type -> Bool
isFFIExportResultTy, -- :: Type -> Bool
isFFIExternalTy, -- :: Type -> Bool
isFFIDynTy, -- :: Type -> Type -> Bool
isFFIPrimArgumentTy, -- :: DynFlags -> Type -> Bool
isFFIPrimResultTy, -- :: DynFlags -> Type -> Bool
isFFILabelTy, -- :: Type -> Bool
isFFITy, -- :: Type -> Bool
isFunPtrTy, -- :: Type -> Bool
tcSplitIOType_maybe, -- :: Type -> Maybe Type
--------------------------------
-- Reexported from Kind
Kind, tcTypeKind,
liftedTypeKind,
constraintKind,
isLiftedTypeKind, isUnliftedTypeKind, classifiesTypeWithValues,
--------------------------------
-- Reexported from Type
Type, PredType, ThetaType, TyCoBinder,
ArgFlag(..), AnonArgFlag(..), ForallVisFlag(..),
mkForAllTy, mkForAllTys, mkTyCoInvForAllTys, mkSpecForAllTys, mkTyCoInvForAllTy,
mkInvForAllTy, mkInvForAllTys,
mkVisFunTy, mkVisFunTys, mkInvisFunTy, mkInvisFunTys,
mkTyConApp, mkAppTy, mkAppTys,
mkTyConTy, mkTyVarTy, mkTyVarTys,
mkTyCoVarTy, mkTyCoVarTys,
isClassPred, isEqPrimPred, isIPPred, isEqPred, isEqPredClass,
mkClassPred,
tcSplitDFunTy, tcSplitDFunHead, tcSplitMethodTy,
isRuntimeRepVar, isKindLevPoly,
isVisibleBinder, isInvisibleBinder,
-- Type substitutions
TCvSubst(..), -- Representation visible to a few friends
TvSubstEnv, emptyTCvSubst, mkEmptyTCvSubst,
zipTvSubst,
mkTvSubstPrs, notElemTCvSubst, unionTCvSubst,
getTvSubstEnv, setTvSubstEnv, getTCvInScope, extendTCvInScope,
extendTCvInScopeList, extendTCvInScopeSet, extendTvSubstAndInScope,
Type.lookupTyVar, Type.extendTCvSubst, Type.substTyVarBndr,
Type.extendTvSubst,
isInScope, mkTCvSubst, mkTvSubst, zipTyEnv, zipCoEnv,
Type.substTy, substTys, substTyWith, substTyWithCoVars,
substTyAddInScope,
substTyUnchecked, substTysUnchecked, substThetaUnchecked,
substTyWithUnchecked,
substCoUnchecked, substCoWithUnchecked,
substTheta,
isUnliftedType, -- Source types are always lifted
isUnboxedTupleType, -- Ditto
isPrimitiveType,
tcView, coreView,
tyCoVarsOfType, tyCoVarsOfTypes, closeOverKinds,
tyCoFVsOfType, tyCoFVsOfTypes,
tyCoVarsOfTypeDSet, tyCoVarsOfTypesDSet, closeOverKindsDSet,
tyCoVarsOfTypeList, tyCoVarsOfTypesList,
noFreeVarsOfType,
--------------------------------
pprKind, pprParendKind, pprSigmaType,
pprType, pprParendType, pprTypeApp, pprTyThingCategory, tyThingCategory,
pprTheta, pprParendTheta, pprThetaArrowTy, pprClassPred,
pprTCvBndr, pprTCvBndrs,
TypeSize, sizeType, sizeTypes, scopedSort,
---------------------------------
-- argument visibility
tcTyConVisibilities, isNextTyConArgVisible, isNextArgVisible
) where
#include "HsVersions.h"
-- friends:
import GhcPrelude
import TyCoRep
import TyCoSubst ( mkTvSubst, substTyWithCoVars )
import TyCoFVs
import TyCoPpr
import Class
import Var
import ForeignCall
import VarSet
import Coercion
import Type
import Predicate
import GHC.Types.RepType
import TyCon
-- others:
import DynFlags
import CoreFVs
import Name -- hiding (varName)
-- We use this to make dictionaries for type literals.
-- Perhaps there's a better way to do this?
import NameSet
import VarEnv
import PrelNames
import TysWiredIn( coercibleClass, eqClass, heqClass, unitTyCon, unitTyConKey
, listTyCon, constraintKind )
import BasicTypes
import Util
import Maybes
import ListSetOps ( getNth, findDupsEq )
import Outputable
import FastString
import ErrUtils( Validity(..), MsgDoc, isValid )
import qualified GHC.LanguageExtensions as LangExt
import Data.List ( mapAccumL )
-- import Data.Functor.Identity( Identity(..) )
import Data.IORef
import Data.List.NonEmpty( NonEmpty(..) )
{-
************************************************************************
* *
Types
* *
************************************************************************
The type checker divides the generic Type world into the
following more structured beasts:
sigma ::= forall tyvars. phi
-- A sigma type is a qualified type
--
-- Note that even if 'tyvars' is empty, theta
-- may not be: e.g. (?x::Int) => Int
-- Note that 'sigma' is in prenex form:
-- all the foralls are at the front.
-- A 'phi' type has no foralls to the right of
-- an arrow
phi :: theta => rho
rho ::= sigma -> rho
| tau
-- A 'tau' type has no quantification anywhere
-- Note that the args of a type constructor must be taus
tau ::= tyvar
| tycon tau_1 .. tau_n
| tau_1 tau_2
| tau_1 -> tau_2
-- In all cases, a (saturated) type synonym application is legal,
-- provided it expands to the required form.
Note [TcTyVars and TyVars in the typechecker]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The typechecker uses a lot of type variables with special properties,
notably being a unification variable with a mutable reference. These
use the 'TcTyVar' variant of Var.Var.
Note, though, that a /bound/ type variable can (and probably should)
be a TyVar. E.g
forall a. a -> a
Here 'a' is really just a deBruijn-number; it certainly does not have
a significant TcLevel (as every TcTyVar does). So a forall-bound type
variable should be TyVars; and hence a TyVar can appear free in a TcType.
The type checker and constraint solver can also encounter /free/ type
variables that use the 'TyVar' variant of Var.Var, for a couple of
reasons:
- When typechecking a class decl, say
class C (a :: k) where
foo :: T a -> Int
We have first kind-check the header; fix k and (a:k) to be
TyVars, bring 'k' and 'a' into scope, and kind check the
signature for 'foo'. In doing so we call solveEqualities to
solve any kind equalities in foo's signature. So the solver
may see free occurrences of 'k'.
See calls to tcExtendTyVarEnv for other places that ordinary
TyVars are bought into scope, and hence may show up in the types
and kinds generated by TcHsType.
- The pattern-match overlap checker calls the constraint solver,
long after TcTyVars have been zonked away
It's convenient to simply treat these TyVars as skolem constants,
which of course they are. We give them a level number of "outermost",
so they behave as global constants. Specifically:
* Var.tcTyVarDetails succeeds on a TyVar, returning
vanillaSkolemTv, as well as on a TcTyVar.
* tcIsTcTyVar returns True for both TyVar and TcTyVar variants
of Var.Var. The "tc" prefix means "a type variable that can be
encountered by the typechecker".
This is a bit of a change from an earlier era when we remoselessly
insisted on real TcTyVars in the type checker. But that seems
unnecessary (for skolems, TyVars are fine) and it's now very hard
to guarantee, with the advent of kind equalities.
Note [Coercion variables in free variable lists]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are several places in the GHC codebase where functions like
tyCoVarsOfType, tyCoVarsOfCt, et al. are used to compute the free type
variables of a type. The "Co" part of these functions' names shouldn't be
dismissed, as it is entirely possible that they will include coercion variables
in addition to type variables! As a result, there are some places in TcType
where we must take care to check that a variable is a _type_ variable (using
isTyVar) before calling tcTyVarDetails--a partial function that is not defined
for coercion variables--on the variable. Failing to do so led to
GHC #12785.
-}
-- See Note [TcTyVars and TyVars in the typechecker]
type TcCoVar = CoVar -- Used only during type inference
type TcType = Type -- A TcType can have mutable type variables
type TcTyCoVar = Var -- Either a TcTyVar or a CoVar
-- Invariant on ForAllTy in TcTypes:
-- forall a. T
-- a cannot occur inside a MutTyVar in T; that is,
-- T is "flattened" before quantifying over a
type TcTyVarBinder = TyVarBinder
type TcTyCon = TyCon -- these can be the TcTyCon constructor
-- These types do not have boxy type variables in them
type TcPredType = PredType
type TcThetaType = ThetaType
type TcSigmaType = TcType
type TcRhoType = TcType -- Note [TcRhoType]
type TcTauType = TcType
type TcKind = Kind
type TcTyVarSet = TyVarSet
type TcTyCoVarSet = TyCoVarSet
type TcDTyVarSet = DTyVarSet
type TcDTyCoVarSet = DTyCoVarSet
{- *********************************************************************
* *
ExpType: an "expected type" in the type checker
* *
********************************************************************* -}
-- | An expected type to check against during type-checking.
-- See Note [ExpType] in TcMType, where you'll also find manipulators.
data ExpType = Check TcType
| Infer !InferResult
data InferResult
= IR { ir_uniq :: Unique -- For debugging only
, ir_lvl :: TcLevel -- See Note [TcLevel of ExpType] in TcMType
, ir_inst :: Bool
-- True <=> deeply instantiate before returning
-- i.e. return a RhoType
-- False <=> do not instantiate before returning
-- i.e. return a SigmaType
-- See Note [Deep instantiation of InferResult] in TcUnify
, ir_ref :: IORef (Maybe TcType) }
-- The type that fills in this hole should be a Type,
-- that is, its kind should be (TYPE rr) for some rr
type ExpSigmaType = ExpType
type ExpRhoType = ExpType
instance Outputable ExpType where
ppr (Check ty) = text "Check" <> braces (ppr ty)
ppr (Infer ir) = ppr ir
instance Outputable InferResult where
ppr (IR { ir_uniq = u, ir_lvl = lvl
, ir_inst = inst })
= text "Infer" <> braces (ppr u <> comma <> ppr lvl <+> ppr inst)
-- | Make an 'ExpType' suitable for checking.
mkCheckExpType :: TcType -> ExpType
mkCheckExpType = Check
{- *********************************************************************
* *
SyntaxOpType
* *
********************************************************************* -}
-- | What to expect for an argument to a rebindable-syntax operator.
-- Quite like 'Type', but allows for holes to be filled in by tcSyntaxOp.
-- The callback called from tcSyntaxOp gets a list of types; the meaning
-- of these types is determined by a left-to-right depth-first traversal
-- of the 'SyntaxOpType' tree. So if you pass in
--
-- > SynAny `SynFun` (SynList `SynFun` SynType Int) `SynFun` SynAny
--
-- you'll get three types back: one for the first 'SynAny', the /element/
-- type of the list, and one for the last 'SynAny'. You don't get anything
-- for the 'SynType', because you've said positively that it should be an
-- Int, and so it shall be.
--
-- This is defined here to avoid defining it in TcExpr.hs-boot.
data SyntaxOpType
= SynAny -- ^ Any type
| SynRho -- ^ A rho type, deeply skolemised or instantiated as appropriate
| SynList -- ^ A list type. You get back the element type of the list
| SynFun SyntaxOpType SyntaxOpType
-- ^ A function.
| SynType ExpType -- ^ A known type.
infixr 0 `SynFun`
-- | Like 'SynType' but accepts a regular TcType
synKnownType :: TcType -> SyntaxOpType
synKnownType = SynType . mkCheckExpType
-- | Like 'mkFunTys' but for 'SyntaxOpType'
mkSynFunTys :: [SyntaxOpType] -> ExpType -> SyntaxOpType
mkSynFunTys arg_tys res_ty = foldr SynFun (SynType res_ty) arg_tys
{-
Note [TcRhoType]
~~~~~~~~~~~~~~~~
A TcRhoType has no foralls or contexts at the top, or to the right of an arrow
YES (forall a. a->a) -> Int
NO forall a. a -> Int
NO Eq a => a -> a
NO Int -> forall a. a -> Int
************************************************************************
* *
TyVarDetails, MetaDetails, MetaInfo
* *
************************************************************************
TyVarDetails gives extra info about type variables, used during type
checking. It's attached to mutable type variables only.
It's knot-tied back to Var.hs. There is no reason in principle
why Var.hs shouldn't actually have the definition, but it "belongs" here.
Note [Signature skolems]
~~~~~~~~~~~~~~~~~~~~~~~~
A TyVarTv is a specialised variant of TauTv, with the following invariants:
* A TyVarTv can be unified only with a TyVar,
not with any other type
* Its MetaDetails, if filled in, will always be another TyVarTv
or a SkolemTv
TyVarTvs are only distinguished to improve error messages.
Consider this
data T (a:k1) = MkT (S a)
data S (b:k2) = MkS (T b)
When doing kind inference on {S,T} we don't want *skolems* for k1,k2,
because they end up unifying; we want those TyVarTvs again.
Note [TyVars and TcTyVars during type checking]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Var type has constructors TyVar and TcTyVar. They are used
as follows:
* TcTyVar: used /only/ during type checking. Should never appear
afterwards. May contain a mutable field, in the MetaTv case.
* TyVar: is never seen by the constraint solver, except locally
inside a type like (forall a. [a] ->[a]), where 'a' is a TyVar.
We instantiate these with TcTyVars before exposing the type
to the constraint solver.
I have swithered about the latter invariant, excluding TyVars from the
constraint solver. It's not strictly essential, and indeed
(historically but still there) Var.tcTyVarDetails returns
vanillaSkolemTv for a TyVar.
But ultimately I want to seeparate Type from TcType, and in that case
we would need to enforce the separation.
-}
-- A TyVarDetails is inside a TyVar
-- See Note [TyVars and TcTyVars]
data TcTyVarDetails
= SkolemTv -- A skolem
TcLevel -- Level of the implication that binds it
-- See TcUnify Note [Deeper level on the left] for
-- how this level number is used
Bool -- True <=> this skolem type variable can be overlapped
-- when looking up instances
-- See Note [Binding when looking up instances] in InstEnv
| RuntimeUnk -- Stands for an as-yet-unknown type in the GHCi
-- interactive context
| MetaTv { mtv_info :: MetaInfo
, mtv_ref :: IORef MetaDetails
, mtv_tclvl :: TcLevel } -- See Note [TcLevel and untouchable type variables]
vanillaSkolemTv, superSkolemTv :: TcTyVarDetails
-- See Note [Binding when looking up instances] in InstEnv
vanillaSkolemTv = SkolemTv topTcLevel False -- Might be instantiated
superSkolemTv = SkolemTv topTcLevel True -- Treat this as a completely distinct type
-- The choice of level number here is a bit dodgy, but
-- topTcLevel works in the places that vanillaSkolemTv is used
instance Outputable TcTyVarDetails where
ppr = pprTcTyVarDetails
pprTcTyVarDetails :: TcTyVarDetails -> SDoc
-- For debugging
pprTcTyVarDetails (RuntimeUnk {}) = text "rt"
pprTcTyVarDetails (SkolemTv lvl True) = text "ssk" <> colon <> ppr lvl
pprTcTyVarDetails (SkolemTv lvl False) = text "sk" <> colon <> ppr lvl
pprTcTyVarDetails (MetaTv { mtv_info = info, mtv_tclvl = tclvl })
= ppr info <> colon <> ppr tclvl
-----------------------------
data MetaDetails
= Flexi -- Flexi type variables unify to become Indirects
| Indirect TcType
data MetaInfo
= TauTv -- This MetaTv is an ordinary unification variable
-- A TauTv is always filled in with a tau-type, which
-- never contains any ForAlls.
| TyVarTv -- A variant of TauTv, except that it should not be
-- unified with a type, only with a type variable
-- See Note [Signature skolems]
| FlatMetaTv -- A flatten meta-tyvar
-- It is a meta-tyvar, but it is always untouchable, with level 0
-- See Note [The flattening story] in TcFlatten
| FlatSkolTv -- A flatten skolem tyvar
-- Just like FlatMetaTv, but is completely "owned" by
-- its Given CFunEqCan.
-- It is filled in /only/ by unflattenGivens
-- See Note [The flattening story] in TcFlatten
instance Outputable MetaDetails where
ppr Flexi = text "Flexi"
ppr (Indirect ty) = text "Indirect" <+> ppr ty
instance Outputable MetaInfo where
ppr TauTv = text "tau"
ppr TyVarTv = text "tyv"
ppr FlatMetaTv = text "fmv"
ppr FlatSkolTv = text "fsk"
{- *********************************************************************
* *
Untouchable type variables
* *
********************************************************************* -}
newtype TcLevel = TcLevel Int deriving( Eq, Ord )
-- See Note [TcLevel and untouchable type variables] for what this Int is
-- See also Note [TcLevel assignment]
{-
Note [TcLevel and untouchable type variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Each unification variable (MetaTv)
and each Implication
has a level number (of type TcLevel)
* INVARIANTS. In a tree of Implications,
(ImplicInv) The level number (ic_tclvl) of an Implication is
STRICTLY GREATER THAN that of its parent
(SkolInv) The level number of the skolems (ic_skols) of an
Implication is equal to the level of the implication
itself (ic_tclvl)
(GivenInv) The level number of a unification variable appearing
in the 'ic_given' of an implication I should be
STRICTLY LESS THAN the ic_tclvl of I
(WantedInv) The level number of a unification variable appearing
in the 'ic_wanted' of an implication I should be
LESS THAN OR EQUAL TO the ic_tclvl of I
See Note [WantedInv]
* A unification variable is *touchable* if its level number
is EQUAL TO that of its immediate parent implication,
and it is a TauTv or TyVarTv (but /not/ FlatMetaTv or FlatSkolTv)
Note [WantedInv]
~~~~~~~~~~~~~~~~
Why is WantedInv important? Consider this implication, where
the constraint (C alpha[3]) disobeys WantedInv:
forall[2] a. blah => (C alpha[3])
(forall[3] b. alpha[3] ~ b)
We can unify alpha:=b in the inner implication, because 'alpha' is
touchable; but then 'b' has excaped its scope into the outer implication.
Note [Skolem escape prevention]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We only unify touchable unification variables. Because of
(WantedInv), there can be no occurrences of the variable further out,
so the unification can't cause the skolems to escape. Example:
data T = forall a. MkT a (a->Int)
f x (MkT v f) = length [v,x]
We decide (x::alpha), and generate an implication like
[1]forall a. (a ~ alpha[0])
But we must not unify alpha:=a, because the skolem would escape.
For the cases where we DO want to unify, we rely on floating the
equality. Example (with same T)
g x (MkT v f) = x && True
We decide (x::alpha), and generate an implication like
[1]forall a. (Bool ~ alpha[0])
We do NOT unify directly, bur rather float out (if the constraint
does not mention 'a') to get
(Bool ~ alpha[0]) /\ [1]forall a.()
and NOW we can unify alpha.
The same idea of only unifying touchables solves another problem.
Suppose we had
(F Int ~ uf[0]) /\ [1](forall a. C a => F Int ~ beta[1])
In this example, beta is touchable inside the implication. The
first solveSimpleWanteds step leaves 'uf' un-unified. Then we move inside
the implication where a new constraint
uf ~ beta
emerges. If we (wrongly) spontaneously solved it to get uf := beta,
the whole implication disappears but when we pop out again we are left with
(F Int ~ uf) which will be unified by our final zonking stage and
uf will get unified *once more* to (F Int).
Note [TcLevel assignment]
~~~~~~~~~~~~~~~~~~~~~~~~~
We arrange the TcLevels like this
0 Top level
1 First-level implication constraints
2 Second-level implication constraints
...etc...
-}
maxTcLevel :: TcLevel -> TcLevel -> TcLevel
maxTcLevel (TcLevel a) (TcLevel b) = TcLevel (a `max` b)
topTcLevel :: TcLevel
-- See Note [TcLevel assignment]
topTcLevel = TcLevel 0 -- 0 = outermost level
isTopTcLevel :: TcLevel -> Bool
isTopTcLevel (TcLevel 0) = True
isTopTcLevel _ = False
pushTcLevel :: TcLevel -> TcLevel
-- See Note [TcLevel assignment]
pushTcLevel (TcLevel us) = TcLevel (us + 1)
strictlyDeeperThan :: TcLevel -> TcLevel -> Bool
strictlyDeeperThan (TcLevel tv_tclvl) (TcLevel ctxt_tclvl)
= tv_tclvl > ctxt_tclvl
sameDepthAs :: TcLevel -> TcLevel -> Bool
sameDepthAs (TcLevel ctxt_tclvl) (TcLevel tv_tclvl)
= ctxt_tclvl == tv_tclvl -- NB: invariant ctxt_tclvl >= tv_tclvl
-- So <= would be equivalent
checkTcLevelInvariant :: TcLevel -> TcLevel -> Bool
-- Checks (WantedInv) from Note [TcLevel and untouchable type variables]
checkTcLevelInvariant (TcLevel ctxt_tclvl) (TcLevel tv_tclvl)
= ctxt_tclvl >= tv_tclvl
-- Returns topTcLevel for non-TcTyVars
tcTyVarLevel :: TcTyVar -> TcLevel
tcTyVarLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tv_lvl } -> tv_lvl
SkolemTv tv_lvl _ -> tv_lvl
RuntimeUnk -> topTcLevel
tcTypeLevel :: TcType -> TcLevel
-- Max level of any free var of the type
tcTypeLevel ty
= foldDVarSet add topTcLevel (tyCoVarsOfTypeDSet ty)
where
add v lvl
| isTcTyVar v = lvl `maxTcLevel` tcTyVarLevel v
| otherwise = lvl
instance Outputable TcLevel where
ppr (TcLevel us) = ppr us
promoteSkolem :: TcLevel -> TcTyVar -> TcTyVar
promoteSkolem tclvl skol
| tclvl < tcTyVarLevel skol
= ASSERT( isTcTyVar skol && isSkolemTyVar skol )
setTcTyVarDetails skol (SkolemTv tclvl (isOverlappableTyVar skol))
| otherwise
= skol
-- | Change the TcLevel in a skolem, extending a substitution
promoteSkolemX :: TcLevel -> TCvSubst -> TcTyVar -> (TCvSubst, TcTyVar)
promoteSkolemX tclvl subst skol
= ASSERT( isTcTyVar skol && isSkolemTyVar skol )
(new_subst, new_skol)
where
new_skol
| tclvl < tcTyVarLevel skol
= setTcTyVarDetails (updateTyVarKind (substTy subst) skol)
(SkolemTv tclvl (isOverlappableTyVar skol))
| otherwise
= updateTyVarKind (substTy subst) skol
new_subst = extendTvSubstWithClone subst skol new_skol
promoteSkolemsX :: TcLevel -> TCvSubst -> [TcTyVar] -> (TCvSubst, [TcTyVar])
promoteSkolemsX tclvl = mapAccumL (promoteSkolemX tclvl)
{- *********************************************************************
* *
Finding type family instances
* *
************************************************************************
-}
-- | Finds outermost type-family applications occurring in a type,
-- after expanding synonyms. In the list (F, tys) that is returned
-- we guarantee that tys matches F's arity. For example, given
-- type family F a :: * -> * (arity 1)
-- calling tcTyFamInsts on (Maybe (F Int Bool) will return
-- (F, [Int]), not (F, [Int,Bool])
--
-- This is important for its use in deciding termination of type
-- instances (see #11581). E.g.
-- type instance G [Int] = ...(F Int <big type>)...
-- we don't need to take <big type> into account when asking if
-- the calls on the RHS are smaller than the LHS
tcTyFamInsts :: Type -> [(TyCon, [Type])]
tcTyFamInsts = map (\(_,b,c) -> (b,c)) . tcTyFamInstsAndVis
-- | Like 'tcTyFamInsts', except that the output records whether the
-- type family and its arguments occur as an /invisible/ argument in
-- some type application. This information is useful because it helps GHC know
-- when to turn on @-fprint-explicit-kinds@ during error reporting so that
-- users can actually see the type family being mentioned.
--
-- As an example, consider:
--
-- @
-- class C a
-- data T (a :: k)
-- type family F a :: k
-- instance C (T @(F Int) (F Bool))
-- @
--
-- There are two occurrences of the type family `F` in that `C` instance, so
-- @'tcTyFamInstsAndVis' (C (T \@(F Int) (F Bool)))@ will return:
--
-- @
-- [ ('True', F, [Int])
-- , ('False', F, [Bool]) ]
-- @
--
-- @F Int@ is paired with 'True' since it appears as an /invisible/ argument
-- to @C@, whereas @F Bool@ is paired with 'False' since it appears an a
-- /visible/ argument to @C@.
--
-- See also @Note [Kind arguments in error messages]@ in "TcErrors".
tcTyFamInstsAndVis :: Type -> [(Bool, TyCon, [Type])]
tcTyFamInstsAndVis = tcTyFamInstsAndVisX False
tcTyFamInstsAndVisX
:: Bool -- ^ Is this an invisible argument to some type application?
-> Type -> [(Bool, TyCon, [Type])]
tcTyFamInstsAndVisX = go
where
go is_invis_arg ty
| Just exp_ty <- tcView ty = go is_invis_arg exp_ty
go _ (TyVarTy _) = []
go is_invis_arg (TyConApp tc tys)
| isTypeFamilyTyCon tc
= [(is_invis_arg, tc, take (tyConArity tc) tys)]
| otherwise
= tcTyConAppTyFamInstsAndVisX is_invis_arg tc tys
go _ (LitTy {}) = []
go is_invis_arg (ForAllTy bndr ty) = go is_invis_arg (binderType bndr)
++ go is_invis_arg ty
go is_invis_arg (FunTy _ ty1 ty2) = go is_invis_arg ty1
++ go is_invis_arg ty2
go is_invis_arg ty@(AppTy _ _) =
let (ty_head, ty_args) = splitAppTys ty
ty_arg_flags = appTyArgFlags ty_head ty_args
in go is_invis_arg ty_head
++ concat (zipWith (\flag -> go (isInvisibleArgFlag flag))
ty_arg_flags ty_args)
go is_invis_arg (CastTy ty _) = go is_invis_arg ty
go _ (CoercionTy _) = [] -- don't count tyfams in coercions,
-- as they never get normalized,
-- anyway
-- | In an application of a 'TyCon' to some arguments, find the outermost
-- occurrences of type family applications within the arguments. This function
-- will not consider the 'TyCon' itself when checking for type family
-- applications.
--
-- See 'tcTyFamInstsAndVis' for more details on how this works (as this
-- function is called inside of 'tcTyFamInstsAndVis').
tcTyConAppTyFamInstsAndVis :: TyCon -> [Type] -> [(Bool, TyCon, [Type])]
tcTyConAppTyFamInstsAndVis = tcTyConAppTyFamInstsAndVisX False
tcTyConAppTyFamInstsAndVisX
:: Bool -- ^ Is this an invisible argument to some type application?
-> TyCon -> [Type] -> [(Bool, TyCon, [Type])]
tcTyConAppTyFamInstsAndVisX is_invis_arg tc tys =
let (invis_tys, vis_tys) = partitionInvisibleTypes tc tys
in concat $ map (tcTyFamInstsAndVisX True) invis_tys
++ map (tcTyFamInstsAndVisX is_invis_arg) vis_tys
isTyFamFree :: Type -> Bool
-- ^ Check that a type does not contain any type family applications.
isTyFamFree = null . tcTyFamInsts
anyRewritableTyVar :: Bool -- Ignore casts and coercions
-> EqRel -- Ambient role
-> (EqRel -> TcTyVar -> Bool)
-> TcType -> Bool
-- (anyRewritableTyVar ignore_cos pred ty) returns True
-- if the 'pred' returns True of any free TyVar in 'ty'
-- Do not look inside casts and coercions if 'ignore_cos' is True
-- See Note [anyRewritableTyVar must be role-aware]
anyRewritableTyVar ignore_cos role pred ty
= go role emptyVarSet ty
where
go_tv rl bvs tv | tv `elemVarSet` bvs = False
| otherwise = pred rl tv
go rl bvs (TyVarTy tv) = go_tv rl bvs tv
go _ _ (LitTy {}) = False
go rl bvs (TyConApp tc tys) = go_tc rl bvs tc tys
go rl bvs (AppTy fun arg) = go rl bvs fun || go NomEq bvs arg
go rl bvs (FunTy _ arg res) = go rl bvs arg || go rl bvs res
go rl bvs (ForAllTy tv ty) = go rl (bvs `extendVarSet` binderVar tv) ty
go rl bvs (CastTy ty co) = go rl bvs ty || go_co rl bvs co
go rl bvs (CoercionTy co) = go_co rl bvs co -- ToDo: check
go_tc NomEq bvs _ tys = any (go NomEq bvs) tys
go_tc ReprEq bvs tc tys = any (go_arg bvs)
(tyConRolesRepresentational tc `zip` tys)
go_arg bvs (Nominal, ty) = go NomEq bvs ty
go_arg bvs (Representational, ty) = go ReprEq bvs ty
go_arg _ (Phantom, _) = False -- We never rewrite with phantoms
go_co rl bvs co
| ignore_cos = False
| otherwise = anyVarSet (go_tv rl bvs) (tyCoVarsOfCo co)
-- We don't have an equivalent of anyRewritableTyVar for coercions
-- (at least not yet) so take the free vars and test them
{- Note [anyRewritableTyVar must be role-aware]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
anyRewritableTyVar is used during kick-out from the inert set,
to decide if, given a new equality (a ~ ty), we should kick out
a constraint C. Rather than gather free variables and see if 'a'
is among them, we instead pass in a predicate; this is just efficiency.
Moreover, consider
work item: [G] a ~R f b
inert item: [G] b ~R f a
We use anyRewritableTyVar to decide whether to kick out the inert item,
on the grounds that the work item might rewrite it. Well, 'a' is certainly
free in [G] b ~R f a. But because the role of a type variable ('f' in
this case) is nominal, the work item can't actually rewrite the inert item.
Moreover, if we were to kick out the inert item the exact same situation
would re-occur and we end up with an infinite loop in which each kicks
out the other (#14363).
-}
{-
************************************************************************
* *
Predicates
* *
************************************************************************
-}
tcIsTcTyVar :: TcTyVar -> Bool
-- See Note [TcTyVars and TyVars in the typechecker]
tcIsTcTyVar tv = isTyVar tv
isTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isTouchableMetaTyVar ctxt_tclvl tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
, MetaTv { mtv_tclvl = tv_tclvl, mtv_info = info } <- tcTyVarDetails tv
, not (isFlattenInfo info)
= ASSERT2( checkTcLevelInvariant ctxt_tclvl tv_tclvl,
ppr tv $$ ppr tv_tclvl $$ ppr ctxt_tclvl )
tv_tclvl `sameDepthAs` ctxt_tclvl
| otherwise = False
isFloatedTouchableMetaTyVar :: TcLevel -> TcTyVar -> Bool
isFloatedTouchableMetaTyVar ctxt_tclvl tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
, MetaTv { mtv_tclvl = tv_tclvl, mtv_info = info } <- tcTyVarDetails tv
, not (isFlattenInfo info)
= tv_tclvl `strictlyDeeperThan` ctxt_tclvl
| otherwise = False
isImmutableTyVar :: TyVar -> Bool
isImmutableTyVar tv = isSkolemTyVar tv
isTyConableTyVar, isSkolemTyVar, isOverlappableTyVar,
isMetaTyVar, isAmbiguousTyVar,
isFmvTyVar, isFskTyVar, isFlattenTyVar :: TcTyVar -> Bool
isTyConableTyVar tv
-- True of a meta-type variable that can be filled in
-- with a type constructor application; in particular,
-- not a TyVarTv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
= case tcTyVarDetails tv of
MetaTv { mtv_info = TyVarTv } -> False
_ -> True
| otherwise = True
isFmvTyVar tv
= ASSERT2( tcIsTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_info = FlatMetaTv } -> True
_ -> False
isFskTyVar tv
= ASSERT2( tcIsTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_info = FlatSkolTv } -> True
_ -> False
-- | True of both given and wanted flatten-skolems (fmv and fsk)
isFlattenTyVar tv
= ASSERT2( tcIsTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv { mtv_info = info } -> isFlattenInfo info
_ -> False
isSkolemTyVar tv
= ASSERT2( tcIsTcTyVar tv, ppr tv )
case tcTyVarDetails tv of
MetaTv {} -> False
_other -> True
isOverlappableTyVar tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
= case tcTyVarDetails tv of
SkolemTv _ overlappable -> overlappable
_ -> False
| otherwise = False
isMetaTyVar tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
= case tcTyVarDetails tv of
MetaTv {} -> True
_ -> False
| otherwise = False
-- isAmbiguousTyVar is used only when reporting type errors
-- It picks out variables that are unbound, namely meta
-- type variables and the RuntimUnk variables created by
-- RtClosureInspect.zonkRTTIType. These are "ambiguous" in
-- the sense that they stand for an as-yet-unknown type
isAmbiguousTyVar tv
| isTyVar tv -- See Note [Coercion variables in free variable lists]
= case tcTyVarDetails tv of
MetaTv {} -> True
RuntimeUnk {} -> True
_ -> False
| otherwise = False
isMetaTyVarTy :: TcType -> Bool
isMetaTyVarTy (TyVarTy tv) = isMetaTyVar tv
isMetaTyVarTy _ = False
metaTyVarInfo :: TcTyVar -> MetaInfo
metaTyVarInfo tv
= case tcTyVarDetails tv of
MetaTv { mtv_info = info } -> info
_ -> pprPanic "metaTyVarInfo" (ppr tv)
isFlattenInfo :: MetaInfo -> Bool
isFlattenInfo FlatMetaTv = True
isFlattenInfo FlatSkolTv = True
isFlattenInfo _ = False
metaTyVarTcLevel :: TcTyVar -> TcLevel
metaTyVarTcLevel tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> tclvl
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
metaTyVarTcLevel_maybe :: TcTyVar -> Maybe TcLevel
metaTyVarTcLevel_maybe tv
= case tcTyVarDetails tv of
MetaTv { mtv_tclvl = tclvl } -> Just tclvl
_ -> Nothing
metaTyVarRef :: TyVar -> IORef MetaDetails
metaTyVarRef tv
= case tcTyVarDetails tv of
MetaTv { mtv_ref = ref } -> ref
_ -> pprPanic "metaTyVarRef" (ppr tv)
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar
setMetaTyVarTcLevel tv tclvl
= case tcTyVarDetails tv of
details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl })
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
isTyVarTyVar :: Var -> Bool
isTyVarTyVar tv
= case tcTyVarDetails tv of
MetaTv { mtv_info = TyVarTv } -> True
_ -> False
isFlexi, isIndirect :: MetaDetails -> Bool
isFlexi Flexi = True
isFlexi _ = False
isIndirect (Indirect _) = True
isIndirect _ = False
isRuntimeUnkSkol :: TyVar -> Bool
-- Called only in TcErrors; see Note [Runtime skolems] there
isRuntimeUnkSkol x
| RuntimeUnk <- tcTyVarDetails x = True
| otherwise = False
mkTyVarNamePairs :: [TyVar] -> [(Name,TyVar)]
-- Just pair each TyVar with its own name
mkTyVarNamePairs tvs = [(tyVarName tv, tv) | tv <- tvs]
findDupTyVarTvs :: [(Name,TcTyVar)] -> [(Name,Name)]
-- If we have [...(x1,tv)...(x2,tv)...]
-- return (x1,x2) in the result list
findDupTyVarTvs prs
= concatMap mk_result_prs $
findDupsEq eq_snd prs
where
eq_snd (_,tv1) (_,tv2) = tv1 == tv2
mk_result_prs ((n1,_) :| xs) = map (\(n2,_) -> (n1,n2)) xs
{-
************************************************************************
* *
\subsection{Tau, sigma and rho}
* *
************************************************************************
-}
mkSigmaTy :: [TyCoVarBinder] -> [PredType] -> Type -> Type
mkSigmaTy bndrs theta tau = mkForAllTys bndrs (mkPhiTy theta tau)
-- | Make a sigma ty where all type variables are 'Inferred'. That is,
-- they cannot be used with visible type application.
mkInfSigmaTy :: [TyCoVar] -> [PredType] -> Type -> Type
mkInfSigmaTy tyvars theta ty = mkSigmaTy (mkTyCoVarBinders Inferred tyvars) theta ty
-- | Make a sigma ty where all type variables are "specified". That is,
-- they can be used with visible type application
mkSpecSigmaTy :: [TyVar] -> [PredType] -> Type -> Type
mkSpecSigmaTy tyvars preds ty = mkSigmaTy (mkTyCoVarBinders Specified tyvars) preds ty
mkPhiTy :: [PredType] -> Type -> Type
mkPhiTy = mkInvisFunTys
---------------
getDFunTyKey :: Type -> OccName -- Get some string from a type, to be used to
-- construct a dictionary function name
getDFunTyKey ty | Just ty' <- coreView ty = getDFunTyKey ty'
getDFunTyKey (TyVarTy tv) = getOccName tv
getDFunTyKey (TyConApp tc _) = getOccName tc
getDFunTyKey (LitTy x) = getDFunTyLitKey x
getDFunTyKey (AppTy fun _) = getDFunTyKey fun
getDFunTyKey (FunTy {}) = getOccName funTyCon
getDFunTyKey (ForAllTy _ t) = getDFunTyKey t
getDFunTyKey (CastTy ty _) = getDFunTyKey ty
getDFunTyKey t@(CoercionTy _) = pprPanic "getDFunTyKey" (ppr t)
getDFunTyLitKey :: TyLit -> OccName
getDFunTyLitKey (NumTyLit n) = mkOccName Name.varName (show n)
getDFunTyLitKey (StrTyLit n) = mkOccName Name.varName (show n) -- hm
{- *********************************************************************
* *
Building types
* *
********************************************************************* -}
-- ToDo: I think we need Tc versions of these
-- Reason: mkCastTy checks isReflexiveCastTy, which checks
-- for equality; and that has a different answer
-- depending on whether or not Type = Constraint
mkTcAppTys :: Type -> [Type] -> Type
mkTcAppTys = mkAppTys
mkTcAppTy :: Type -> Type -> Type
mkTcAppTy = mkAppTy
mkTcCastTy :: Type -> Coercion -> Type
mkTcCastTy = mkCastTy -- Do we need a tc version of mkCastTy?
{-
************************************************************************
* *
\subsection{Expanding and splitting}
* *
************************************************************************
These tcSplit functions are like their non-Tc analogues, but
*) they do not look through newtypes
However, they are non-monadic and do not follow through mutable type
variables. It's up to you to make sure this doesn't matter.
-}
-- | Splits a forall type into a list of 'TyBinder's and the inner type.
-- Always succeeds, even if it returns an empty list.
tcSplitPiTys :: Type -> ([TyBinder], Type)
tcSplitPiTys ty
= ASSERT( all isTyBinder (fst sty) ) sty
where sty = splitPiTys ty
-- | Splits a type into a TyBinder and a body, if possible. Panics otherwise
tcSplitPiTy_maybe :: Type -> Maybe (TyBinder, Type)
tcSplitPiTy_maybe ty
= ASSERT( isMaybeTyBinder sty ) sty
where
sty = splitPiTy_maybe ty
isMaybeTyBinder (Just (t,_)) = isTyBinder t
isMaybeTyBinder _ = True
tcSplitForAllTy_maybe :: Type -> Maybe (TyVarBinder, Type)
tcSplitForAllTy_maybe ty | Just ty' <- tcView ty = tcSplitForAllTy_maybe ty'
tcSplitForAllTy_maybe (ForAllTy tv ty) = ASSERT( isTyVarBinder tv ) Just (tv, ty)
tcSplitForAllTy_maybe _ = Nothing
-- | Like 'tcSplitPiTys', but splits off only named binders,
-- returning just the tycovars.
tcSplitForAllTys :: Type -> ([TyVar], Type)
tcSplitForAllTys ty
= ASSERT( all isTyVar (fst sty) ) sty
where sty = splitForAllTys ty
-- | Like 'tcSplitForAllTys', but only splits a 'ForAllTy' if
-- @'sameVis' argf supplied_argf@ is 'True', where @argf@ is the visibility
-- of the @ForAllTy@'s binder and @supplied_argf@ is the visibility provided
-- as an argument to this function.
tcSplitForAllTysSameVis :: ArgFlag -> Type -> ([TyVar], Type)
tcSplitForAllTysSameVis supplied_argf ty = ASSERT( all isTyVar (fst sty) ) sty
where sty = splitForAllTysSameVis supplied_argf ty
-- | Like 'tcSplitForAllTys', but splits off only named binders.
tcSplitForAllVarBndrs :: Type -> ([TyVarBinder], Type)
tcSplitForAllVarBndrs ty = ASSERT( all isTyVarBinder (fst sty)) sty
where sty = splitForAllVarBndrs ty
-- | Is this a ForAllTy with a named binder?
tcIsForAllTy :: Type -> Bool
tcIsForAllTy ty | Just ty' <- tcView ty = tcIsForAllTy ty'
tcIsForAllTy (ForAllTy {}) = True
tcIsForAllTy _ = False
tcSplitPredFunTy_maybe :: Type -> Maybe (PredType, Type)
-- Split off the first predicate argument from a type
tcSplitPredFunTy_maybe ty
| Just ty' <- tcView ty = tcSplitPredFunTy_maybe ty'
tcSplitPredFunTy_maybe (FunTy { ft_af = InvisArg
, ft_arg = arg, ft_res = res })
= Just (arg, res)
tcSplitPredFunTy_maybe _
= Nothing
tcSplitPhiTy :: Type -> (ThetaType, Type)
tcSplitPhiTy ty
= split ty []
where
split ty ts
= case tcSplitPredFunTy_maybe ty of
Just (pred, ty) -> split ty (pred:ts)
Nothing -> (reverse ts, ty)
-- | Split a sigma type into its parts.
tcSplitSigmaTy :: Type -> ([TyVar], ThetaType, Type)
tcSplitSigmaTy ty = case tcSplitForAllTys ty of
(tvs, rho) -> case tcSplitPhiTy rho of
(theta, tau) -> (tvs, theta, tau)
-- | Split a sigma type into its parts, going underneath as many @ForAllTy@s
-- as possible. For example, given this type synonym:
--
-- @
-- type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
-- @
--
-- if you called @tcSplitSigmaTy@ on this type:
--
-- @
-- forall s t a b. Each s t a b => Traversal s t a b
-- @
--
-- then it would return @([s,t,a,b], [Each s t a b], Traversal s t a b)@. But
-- if you instead called @tcSplitNestedSigmaTys@ on the type, it would return
-- @([s,t,a,b,f], [Each s t a b, Applicative f], (a -> f b) -> s -> f t)@.
tcSplitNestedSigmaTys :: Type -> ([TyVar], ThetaType, Type)
-- NB: This is basically a pure version of deeplyInstantiate (from Inst) that
-- doesn't compute an HsWrapper.
tcSplitNestedSigmaTys ty
-- If there's a forall, split it apart and try splitting the rho type
-- underneath it.
| Just (arg_tys, tvs1, theta1, rho1) <- tcDeepSplitSigmaTy_maybe ty
= let (tvs2, theta2, rho2) = tcSplitNestedSigmaTys rho1
in (tvs1 ++ tvs2, theta1 ++ theta2, mkVisFunTys arg_tys rho2)
-- If there's no forall, we're done.
| otherwise = ([], [], ty)
-----------------------
tcDeepSplitSigmaTy_maybe
:: TcSigmaType -> Maybe ([TcType], [TyVar], ThetaType, TcSigmaType)
-- Looks for a *non-trivial* quantified type, under zero or more function arrows
-- By "non-trivial" we mean either tyvars or constraints are non-empty
tcDeepSplitSigmaTy_maybe ty
| Just (arg_ty, res_ty) <- tcSplitFunTy_maybe ty
, Just (arg_tys, tvs, theta, rho) <- tcDeepSplitSigmaTy_maybe res_ty
= Just (arg_ty:arg_tys, tvs, theta, rho)
| (tvs, theta, rho) <- tcSplitSigmaTy ty
, not (null tvs && null theta)
= Just ([], tvs, theta, rho)
| otherwise = Nothing
-----------------------
tcTyConAppTyCon :: Type -> TyCon
tcTyConAppTyCon ty
= case tcTyConAppTyCon_maybe ty of
Just tc -> tc
Nothing -> pprPanic "tcTyConAppTyCon" (pprType ty)
-- | Like 'tcRepSplitTyConApp_maybe', but only returns the 'TyCon'.
tcTyConAppTyCon_maybe :: Type -> Maybe TyCon
tcTyConAppTyCon_maybe ty
| Just ty' <- tcView ty = tcTyConAppTyCon_maybe ty'
tcTyConAppTyCon_maybe (TyConApp tc _)
= Just tc
tcTyConAppTyCon_maybe (FunTy { ft_af = VisArg })
= Just funTyCon -- (=>) is /not/ a TyCon in its own right
-- C.f. tcRepSplitAppTy_maybe
tcTyConAppTyCon_maybe _
= Nothing
tcTyConAppArgs :: Type -> [Type]
tcTyConAppArgs ty = case tcSplitTyConApp_maybe ty of
Just (_, args) -> args
Nothing -> pprPanic "tcTyConAppArgs" (pprType ty)
tcSplitTyConApp :: Type -> (TyCon, [Type])
tcSplitTyConApp ty = case tcSplitTyConApp_maybe ty of
Just stuff -> stuff
Nothing -> pprPanic "tcSplitTyConApp" (pprType ty)
-----------------------
tcSplitFunTys :: Type -> ([Type], Type)
tcSplitFunTys ty = case tcSplitFunTy_maybe ty of
Nothing -> ([], ty)
Just (arg,res) -> (arg:args, res')
where
(args,res') = tcSplitFunTys res
tcSplitFunTy_maybe :: Type -> Maybe (Type, Type)
tcSplitFunTy_maybe ty
| Just ty' <- tcView ty = tcSplitFunTy_maybe ty'
tcSplitFunTy_maybe (FunTy { ft_af = af, ft_arg = arg, ft_res = res })
| VisArg <- af = Just (arg, res)
tcSplitFunTy_maybe _ = Nothing
-- Note the VisArg guard
-- Consider (?x::Int) => Bool
-- We don't want to treat this as a function type!
-- A concrete example is test tc230:
-- f :: () -> (?p :: ()) => () -> ()
--
-- g = f () ()
tcSplitFunTysN :: Arity -- n: Number of desired args
-> TcRhoType
-> Either Arity -- Number of missing arrows
([TcSigmaType], -- Arg types (always N types)
TcSigmaType) -- The rest of the type
-- ^ Split off exactly the specified number argument types
-- Returns
-- (Left m) if there are 'm' missing arrows in the type
-- (Right (tys,res)) if the type looks like t1 -> ... -> tn -> res
tcSplitFunTysN n ty
| n == 0
= Right ([], ty)
| Just (arg,res) <- tcSplitFunTy_maybe ty
= case tcSplitFunTysN (n-1) res of
Left m -> Left m
Right (args,body) -> Right (arg:args, body)
| otherwise
= Left n
tcSplitFunTy :: Type -> (Type, Type)
tcSplitFunTy ty = expectJust "tcSplitFunTy" (tcSplitFunTy_maybe ty)
tcFunArgTy :: Type -> Type
tcFunArgTy ty = fst (tcSplitFunTy ty)
tcFunResultTy :: Type -> Type
tcFunResultTy ty = snd (tcSplitFunTy ty)
-- | Strips off n *visible* arguments and returns the resulting type
tcFunResultTyN :: HasDebugCallStack => Arity -> Type -> Type
tcFunResultTyN n ty
| Right (_, res_ty) <- tcSplitFunTysN n ty
= res_ty
| otherwise
= pprPanic "tcFunResultTyN" (ppr n <+> ppr ty)
-----------------------
tcSplitAppTy_maybe :: Type -> Maybe (Type, Type)
tcSplitAppTy_maybe ty | Just ty' <- tcView ty = tcSplitAppTy_maybe ty'
tcSplitAppTy_maybe ty = tcRepSplitAppTy_maybe ty
tcSplitAppTy :: Type -> (Type, Type)
tcSplitAppTy ty = case tcSplitAppTy_maybe ty of
Just stuff -> stuff
Nothing -> pprPanic "tcSplitAppTy" (pprType ty)
tcSplitAppTys :: Type -> (Type, [Type])
tcSplitAppTys ty
= go ty []
where
go ty args = case tcSplitAppTy_maybe ty of
Just (ty', arg) -> go ty' (arg:args)
Nothing -> (ty,args)
-- | Returns the number of arguments in the given type, without
-- looking through synonyms. This is used only for error reporting.
-- We don't look through synonyms because of #11313.
tcRepGetNumAppTys :: Type -> Arity
tcRepGetNumAppTys = length . snd . repSplitAppTys
-----------------------
-- | If the type is a tyvar, possibly under a cast, returns it, along
-- with the coercion. Thus, the co is :: kind tv ~N kind type
tcGetCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN)
tcGetCastedTyVar_maybe ty | Just ty' <- tcView ty = tcGetCastedTyVar_maybe ty'
tcGetCastedTyVar_maybe (CastTy (TyVarTy tv) co) = Just (tv, co)
tcGetCastedTyVar_maybe (TyVarTy tv) = Just (tv, mkNomReflCo (tyVarKind tv))
tcGetCastedTyVar_maybe _ = Nothing
tcGetTyVar_maybe :: Type -> Maybe TyVar
tcGetTyVar_maybe ty | Just ty' <- tcView ty = tcGetTyVar_maybe ty'
tcGetTyVar_maybe (TyVarTy tv) = Just tv
tcGetTyVar_maybe _ = Nothing
tcGetTyVar :: String -> Type -> TyVar
tcGetTyVar msg ty
= case tcGetTyVar_maybe ty of
Just tv -> tv
Nothing -> pprPanic msg (ppr ty)
tcIsTyVarTy :: Type -> Bool
tcIsTyVarTy ty | Just ty' <- tcView ty = tcIsTyVarTy ty'
tcIsTyVarTy (CastTy ty _) = tcIsTyVarTy ty -- look through casts, as
-- this is only used for
-- e.g., FlexibleContexts
tcIsTyVarTy (TyVarTy _) = True
tcIsTyVarTy _ = False
-----------------------
tcSplitDFunTy :: Type -> ([TyVar], [Type], Class, [Type])
-- Split the type of a dictionary function
-- We don't use tcSplitSigmaTy, because a DFun may (with NDP)
-- have non-Pred arguments, such as
-- df :: forall m. (forall b. Eq b => Eq (m b)) -> C m
--
-- Also NB splitFunTys, not tcSplitFunTys;
-- the latter specifically stops at PredTy arguments,
-- and we don't want to do that here
tcSplitDFunTy ty
= case tcSplitForAllTys ty of { (tvs, rho) ->
case splitFunTys rho of { (theta, tau) ->
case tcSplitDFunHead tau of { (clas, tys) ->
(tvs, theta, clas, tys) }}}
tcSplitDFunHead :: Type -> (Class, [Type])
tcSplitDFunHead = getClassPredTys
tcSplitMethodTy :: Type -> ([TyVar], PredType, Type)
-- A class method (selector) always has a type like
-- forall as. C as => blah
-- So if the class looks like
-- class C a where
-- op :: forall b. (Eq a, Ix b) => a -> b
-- the class method type looks like
-- op :: forall a. C a => forall b. (Eq a, Ix b) => a -> b
--
-- tcSplitMethodTy just peels off the outer forall and
-- that first predicate
tcSplitMethodTy ty
| (sel_tyvars,sel_rho) <- tcSplitForAllTys ty
, Just (first_pred, local_meth_ty) <- tcSplitPredFunTy_maybe sel_rho
= (sel_tyvars, first_pred, local_meth_ty)
| otherwise
= pprPanic "tcSplitMethodTy" (ppr ty)
{- *********************************************************************
* *
Type equalities
* *
********************************************************************* -}
tcEqKind :: HasDebugCallStack => TcKind -> TcKind -> Bool
tcEqKind = tcEqType
tcEqType :: HasDebugCallStack => TcType -> TcType -> Bool
-- tcEqType is a proper implements the same Note [Non-trivial definitional
-- equality] (in TyCoRep) as `eqType`, but Type.eqType believes (* ==
-- Constraint), and that is NOT what we want in the type checker!
tcEqType ty1 ty2
= tc_eq_type False False ki1 ki2
&& tc_eq_type False False ty1 ty2
where
ki1 = tcTypeKind ty1
ki2 = tcTypeKind ty2
-- | Just like 'tcEqType', but will return True for types of different kinds
-- as long as their non-coercion structure is identical.
tcEqTypeNoKindCheck :: TcType -> TcType -> Bool
tcEqTypeNoKindCheck ty1 ty2
= tc_eq_type False False ty1 ty2
-- | Like 'tcEqType', but returns True if the /visible/ part of the types
-- are equal, even if they are really unequal (in the invisible bits)
tcEqTypeVis :: TcType -> TcType -> Bool
tcEqTypeVis ty1 ty2 = tc_eq_type False True ty1 ty2
-- | Like 'pickyEqTypeVis', but returns a Bool for convenience
pickyEqType :: TcType -> TcType -> Bool
-- Check when two types _look_ the same, _including_ synonyms.
-- So (pickyEqType String [Char]) returns False
-- This ignores kinds and coercions, because this is used only for printing.
pickyEqType ty1 ty2 = tc_eq_type True False ty1 ty2
-- | Real worker for 'tcEqType'. No kind check!
tc_eq_type :: Bool -- ^ True <=> do not expand type synonyms
-> Bool -- ^ True <=> compare visible args only
-> Type -> Type
-> Bool
-- Flags False, False is the usual setting for tc_eq_type
tc_eq_type keep_syns vis_only orig_ty1 orig_ty2
= go orig_env orig_ty1 orig_ty2
where
go :: RnEnv2 -> Type -> Type -> Bool
go env t1 t2 | not keep_syns, Just t1' <- tcView t1 = go env t1' t2
go env t1 t2 | not keep_syns, Just t2' <- tcView t2 = go env t1 t2'
go env (TyVarTy tv1) (TyVarTy tv2)
= rnOccL env tv1 == rnOccR env tv2
go _ (LitTy lit1) (LitTy lit2)
= lit1 == lit2
go env (ForAllTy (Bndr tv1 vis1) ty1)
(ForAllTy (Bndr tv2 vis2) ty2)
= vis1 == vis2
&& (vis_only || go env (varType tv1) (varType tv2))
&& go (rnBndr2 env tv1 tv2) ty1 ty2
-- Make sure we handle all FunTy cases since falling through to the
-- AppTy case means that tcRepSplitAppTy_maybe may see an unzonked
-- kind variable, which causes things to blow up.
go env (FunTy _ arg1 res1) (FunTy _ arg2 res2)
= go env arg1 arg2 && go env res1 res2
go env ty (FunTy _ arg res) = eqFunTy env arg res ty
go env (FunTy _ arg res) ty = eqFunTy env arg res ty
-- See Note [Equality on AppTys] in Type
go env (AppTy s1 t1) ty2
| Just (s2, t2) <- tcRepSplitAppTy_maybe ty2
= go env s1 s2 && go env t1 t2
go env ty1 (AppTy s2 t2)
| Just (s1, t1) <- tcRepSplitAppTy_maybe ty1
= go env s1 s2 && go env t1 t2
go env (TyConApp tc1 ts1) (TyConApp tc2 ts2)
= tc1 == tc2 && gos env (tc_vis tc1) ts1 ts2
go env (CastTy t1 _) t2 = go env t1 t2
go env t1 (CastTy t2 _) = go env t1 t2
go _ (CoercionTy {}) (CoercionTy {}) = True
go _ _ _ = False
gos _ _ [] [] = True
gos env (ig:igs) (t1:ts1) (t2:ts2) = (ig || go env t1 t2)
&& gos env igs ts1 ts2
gos _ _ _ _ = False
tc_vis :: TyCon -> [Bool] -- True for the fields we should ignore
tc_vis tc | vis_only = inviss ++ repeat False -- Ignore invisibles
| otherwise = repeat False -- Ignore nothing
-- The repeat False is necessary because tycons
-- can legitimately be oversaturated
where
bndrs = tyConBinders tc
inviss = map isInvisibleTyConBinder bndrs
orig_env = mkRnEnv2 $ mkInScopeSet $ tyCoVarsOfTypes [orig_ty1, orig_ty2]
-- @eqFunTy arg res ty@ is True when @ty@ equals @FunTy arg res@. This is
-- sometimes hard to know directly because @ty@ might have some casts
-- obscuring the FunTy. And 'splitAppTy' is difficult because we can't
-- always extract a RuntimeRep (see Note [xyz]) if the kind of the arg or
-- res is unzonked/unflattened. Thus this function, which handles this
-- corner case.
eqFunTy :: RnEnv2 -> Type -> Type -> Type -> Bool
-- Last arg is /not/ FunTy
eqFunTy env arg res ty@(AppTy{}) = get_args ty []
where
get_args :: Type -> [Type] -> Bool
get_args (AppTy f x) args = get_args f (x:args)
get_args (CastTy t _) args = get_args t args
get_args (TyConApp tc tys) args
| tc == funTyCon
, [_, _, arg', res'] <- tys ++ args
= go env arg arg' && go env res res'
get_args _ _ = False
eqFunTy _ _ _ _ = False
{- *********************************************************************
* *
Predicate types
* *
************************************************************************
Deconstructors and tests on predicate types
Note [Kind polymorphic type classes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C f where... -- C :: forall k. k -> Constraint
g :: forall (f::*). C f => f -> f
Here the (C f) in the signature is really (C * f), and we
don't want to complain that the * isn't a type variable!
-}
isTyVarClassPred :: PredType -> Bool
isTyVarClassPred ty = case getClassPredTys_maybe ty of
Just (_, tys) -> all isTyVarTy tys
_ -> False
-------------------------
checkValidClsArgs :: Bool -> Class -> [KindOrType] -> Bool
-- If the Bool is True (flexible contexts), return True (i.e. ok)
-- Otherwise, check that the type (not kind) args are all headed by a tyvar
-- E.g. (Eq a) accepted, (Eq (f a)) accepted, but (Eq Int) rejected
-- This function is here rather than in TcValidity because it is
-- called from TcSimplify, which itself is imported by TcValidity
checkValidClsArgs flexible_contexts cls kts
| flexible_contexts = True
| otherwise = all hasTyVarHead tys
where
tys = filterOutInvisibleTypes (classTyCon cls) kts
hasTyVarHead :: Type -> Bool
-- Returns true of (a t1 .. tn), where 'a' is a type variable
hasTyVarHead ty -- Haskell 98 allows predicates of form
| tcIsTyVarTy ty = True -- C (a ty1 .. tyn)
| otherwise -- where a is a type variable
= case tcSplitAppTy_maybe ty of
Just (ty, _) -> hasTyVarHead ty
Nothing -> False
evVarPred :: EvVar -> PredType
evVarPred var = varType var
-- Historical note: I used to have an ASSERT here,
-- checking (isEvVarType (varType var)). But with something like
-- f :: c => _ -> _
-- we end up with (c :: kappa), and (kappa ~ Constraint). Until
-- we solve and zonk (which there is no particular reason to do for
-- partial signatures, (isEvVarType kappa) will return False. But
-- nothing is wrong. So I just removed the ASSERT.
------------------
-- | When inferring types, should we quantify over a given predicate?
-- Generally true of classes; generally false of equality constraints.
-- Equality constraints that mention quantified type variables and
-- implicit variables complicate the story. See Notes
-- [Inheriting implicit parameters] and [Quantifying over equality constraints]
pickQuantifiablePreds
:: TyVarSet -- Quantifying over these
-> TcThetaType -- Proposed constraints to quantify
-> TcThetaType -- A subset that we can actually quantify
-- This function decides whether a particular constraint should be
-- quantified over, given the type variables that are being quantified
pickQuantifiablePreds qtvs theta
= let flex_ctxt = True in -- Quantify over non-tyvar constraints, even without
-- -XFlexibleContexts: see #10608, #10351
-- flex_ctxt <- xoptM Opt_FlexibleContexts
mapMaybe (pick_me flex_ctxt) theta
where
pick_me flex_ctxt pred
= case classifyPredType pred of
ClassPred cls tys
| Just {} <- isCallStackPred cls tys
-- NEVER infer a CallStack constraint. Otherwise we let
-- the constraints bubble up to be solved from the outer
-- context, or be defaulted when we reach the top-level.
-- See Note [Overview of implicit CallStacks]
-> Nothing
| isIPClass cls
-> Just pred -- See note [Inheriting implicit parameters]
| pick_cls_pred flex_ctxt cls tys
-> Just pred
EqPred eq_rel ty1 ty2
| quantify_equality eq_rel ty1 ty2
, Just (cls, tys) <- boxEqPred eq_rel ty1 ty2
-- boxEqPred: See Note [Lift equality constraints when quantifying]
, pick_cls_pred flex_ctxt cls tys
-> Just (mkClassPred cls tys)
IrredPred ty
| tyCoVarsOfType ty `intersectsVarSet` qtvs
-> Just pred
_ -> Nothing
pick_cls_pred flex_ctxt cls tys
= tyCoVarsOfTypes tys `intersectsVarSet` qtvs
&& (checkValidClsArgs flex_ctxt cls tys)
-- Only quantify over predicates that checkValidType
-- will pass! See #10351.
-- See Note [Quantifying over equality constraints]
quantify_equality NomEq ty1 ty2 = quant_fun ty1 || quant_fun ty2
quantify_equality ReprEq _ _ = True
quant_fun ty
= case tcSplitTyConApp_maybe ty of
Just (tc, tys) | isTypeFamilyTyCon tc
-> tyCoVarsOfTypes tys `intersectsVarSet` qtvs
_ -> False
boxEqPred :: EqRel -> Type -> Type -> Maybe (Class, [Type])
-- Given (t1 ~# t2) or (t1 ~R# t2) return the boxed version
-- (t1 ~ t2) or (t1 `Coercible` t2)
boxEqPred eq_rel ty1 ty2
= case eq_rel of
NomEq | homo_kind -> Just (eqClass, [k1, ty1, ty2])
| otherwise -> Just (heqClass, [k1, k2, ty1, ty2])
ReprEq | homo_kind -> Just (coercibleClass, [k1, ty1, ty2])
| otherwise -> Nothing -- Sigh: we do not have hererogeneous Coercible
-- so we can't abstract over it
-- Nothing fundamental: we could add it
where
k1 = tcTypeKind ty1
k2 = tcTypeKind ty2
homo_kind = k1 `tcEqType` k2
pickCapturedPreds
:: TyVarSet -- Quantifying over these
-> TcThetaType -- Proposed constraints to quantify
-> TcThetaType -- A subset that we can actually quantify
-- A simpler version of pickQuantifiablePreds, used to winnow down
-- the inferred constraints of a group of bindings, into those for
-- one particular identifier
pickCapturedPreds qtvs theta
= filter captured theta
where
captured pred = isIPPred pred || (tyCoVarsOfType pred `intersectsVarSet` qtvs)
-- Superclasses
type PredWithSCs a = (PredType, [PredType], a)
mkMinimalBySCs :: forall a. (a -> PredType) -> [a] -> [a]
-- Remove predicates that
--
-- - are the same as another predicate
--
-- - can be deduced from another by superclasses,
--
-- - are a reflexive equality (e.g * ~ *)
-- (see Note [Remove redundant provided dicts] in TcPatSyn)
--
-- The result is a subset of the input.
-- The 'a' is just paired up with the PredType;
-- typically it might be a dictionary Id
mkMinimalBySCs get_pred xs = go preds_with_scs []
where
preds_with_scs :: [PredWithSCs a]
preds_with_scs = [ (pred, pred : transSuperClasses pred, x)
| x <- xs
, let pred = get_pred x ]
go :: [PredWithSCs a] -- Work list
-> [PredWithSCs a] -- Accumulating result
-> [a]
go [] min_preds
= reverse (map thdOf3 min_preds)
-- The 'reverse' isn't strictly necessary, but it
-- means that the results are returned in the same
-- order as the input, which is generally saner
go (work_item@(p,_,_) : work_list) min_preds
| EqPred _ t1 t2 <- classifyPredType p
, t1 `tcEqType` t2 -- See TcPatSyn
-- Note [Remove redundant provided dicts]
= go work_list min_preds
| p `in_cloud` work_list || p `in_cloud` min_preds
= go work_list min_preds
| otherwise
= go work_list (work_item : min_preds)
in_cloud :: PredType -> [PredWithSCs a] -> Bool
in_cloud p ps = or [ p `tcEqType` p' | (_, scs, _) <- ps, p' <- scs ]
transSuperClasses :: PredType -> [PredType]
-- (transSuperClasses p) returns (p's superclasses) not including p
-- Stop if you encounter the same class again
-- See Note [Expanding superclasses]
transSuperClasses p
= go emptyNameSet p
where
go :: NameSet -> PredType -> [PredType]
go rec_clss p
| ClassPred cls tys <- classifyPredType p
, let cls_nm = className cls
, not (cls_nm `elemNameSet` rec_clss)
, let rec_clss' | isCTupleClass cls = rec_clss
| otherwise = rec_clss `extendNameSet` cls_nm
= [ p' | sc <- immSuperClasses cls tys
, p' <- sc : go rec_clss' sc ]
| otherwise
= []
immSuperClasses :: Class -> [Type] -> [PredType]
immSuperClasses cls tys
= substTheta (zipTvSubst tyvars tys) sc_theta
where
(tyvars,sc_theta,_,_) = classBigSig cls
isImprovementPred :: PredType -> Bool
-- Either it's an equality, or has some functional dependency
isImprovementPred ty
= case classifyPredType ty of
EqPred NomEq t1 t2 -> not (t1 `tcEqType` t2)
EqPred ReprEq _ _ -> False
ClassPred cls _ -> classHasFds cls
IrredPred {} -> True -- Might have equalities after reduction?
ForAllPred {} -> False
-- | Is the equality
-- a ~r ...a....
-- definitely insoluble or not?
-- a ~r Maybe a -- Definitely insoluble
-- a ~N ...(F a)... -- Not definitely insoluble
-- -- Perhaps (F a) reduces to Int
-- a ~R ...(N a)... -- Not definitely insoluble
-- -- Perhaps newtype N a = MkN Int
-- See Note [Occurs check error] in
-- TcCanonical for the motivation for this function.
isInsolubleOccursCheck :: EqRel -> TcTyVar -> TcType -> Bool
isInsolubleOccursCheck eq_rel tv ty
= go ty
where
go ty | Just ty' <- tcView ty = go ty'
go (TyVarTy tv') = tv == tv' || go (tyVarKind tv')
go (LitTy {}) = False
go (AppTy t1 t2) = case eq_rel of -- See Note [AppTy and ReprEq]
NomEq -> go t1 || go t2
ReprEq -> go t1
go (FunTy _ t1 t2) = go t1 || go t2
go (ForAllTy (Bndr tv' _) inner_ty)
| tv' == tv = False
| otherwise = go (varType tv') || go inner_ty
go (CastTy ty _) = go ty -- ToDo: what about the coercion
go (CoercionTy _) = False -- ToDo: what about the coercion
go (TyConApp tc tys)
| isGenerativeTyCon tc role = any go tys
| otherwise = any go (drop (tyConArity tc) tys)
-- (a ~ F b a), where F has arity 1,
-- has an insoluble occurs check
role = eqRelRole eq_rel
{- Note [Expanding superclasses]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When we expand superclasses, we use the following algorithm:
transSuperClasses( C tys ) returns the transitive superclasses
of (C tys), not including C itself
For example
class C a b => D a b
class D b a => C a b
Then
transSuperClasses( Ord ty ) = [Eq ty]
transSuperClasses( C ta tb ) = [D tb ta, C tb ta]
Notice that in the recursive-superclass case we include C again at
the end of the chain. One could exclude C in this case, but
the code is more awkward and there seems no good reason to do so.
(However C.f. TcCanonical.mk_strict_superclasses, which /does/
appear to do so.)
The algorithm is expand( so_far, pred ):
1. If pred is not a class constraint, return empty set
Otherwise pred = C ts
2. If C is in so_far, return empty set (breaks loops)
3. Find the immediate superclasses constraints of (C ts)
4. For each such sc_pred, return (sc_pred : expand( so_far+C, D ss )
Notice that
* With normal Haskell-98 classes, the loop-detector will never bite,
so we'll get all the superclasses.
* We need the loop-breaker in case we have UndecidableSuperClasses on
* Since there is only a finite number of distinct classes, expansion
must terminate.
* The loop breaking is a bit conservative. Notably, a tuple class
could contain many times without threatening termination:
(Eq a, (Ord a, Ix a))
And this is try of any class that we can statically guarantee
as non-recursive (in some sense). For now, we just make a special
case for tuples. Something better would be cool.
See also TcTyDecls.checkClassCycles.
Note [Lift equality constraints when quantifying]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We can't quantify over a constraint (t1 ~# t2) because that isn't a
predicate type; see Note [Types for coercions, predicates, and evidence]
in TyCoRep.
So we have to 'lift' it to (t1 ~ t2). Similarly (~R#) must be lifted
to Coercible.
This tiresome lifting is the reason that pick_me (in
pickQuantifiablePreds) returns a Maybe rather than a Bool.
Note [Quantifying over equality constraints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Should we quantify over an equality constraint (s ~ t)? In general, we don't.
Doing so may simply postpone a type error from the function definition site to
its call site. (At worst, imagine (Int ~ Bool)).
However, consider this
forall a. (F [a] ~ Int) => blah
Should we quantify over the (F [a] ~ Int)? Perhaps yes, because at the call
site we will know 'a', and perhaps we have instance F [Bool] = Int.
So we *do* quantify over a type-family equality where the arguments mention
the quantified variables.
Note [Inheriting implicit parameters]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider this:
f x = (x::Int) + ?y
where f is *not* a top-level binding.
From the RHS of f we'll get the constraint (?y::Int).
There are two types we might infer for f:
f :: Int -> Int
(so we get ?y from the context of f's definition), or
f :: (?y::Int) => Int -> Int
At first you might think the first was better, because then
?y behaves like a free variable of the definition, rather than
having to be passed at each call site. But of course, the WHOLE
IDEA is that ?y should be passed at each call site (that's what
dynamic binding means) so we'd better infer the second.
BOTTOM LINE: when *inferring types* you must quantify over implicit
parameters, *even if* they don't mention the bound type variables.
Reason: because implicit parameters, uniquely, have local instance
declarations. See pickQuantifiablePreds.
Note [Quantifying over equality constraints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Should we quantify over an equality constraint (s ~ t)? In general, we don't.
Doing so may simply postpone a type error from the function definition site to
its call site. (At worst, imagine (Int ~ Bool)).
However, consider this
forall a. (F [a] ~ Int) => blah
Should we quantify over the (F [a] ~ Int). Perhaps yes, because at the call
site we will know 'a', and perhaps we have instance F [Bool] = Int.
So we *do* quantify over a type-family equality where the arguments mention
the quantified variables.
************************************************************************
* *
Classifying types
* *
************************************************************************
-}
isSigmaTy :: TcType -> Bool
-- isSigmaTy returns true of any qualified type. It doesn't
-- *necessarily* have any foralls. E.g
-- f :: (?x::Int) => Int -> Int
isSigmaTy ty | Just ty' <- tcView ty = isSigmaTy ty'
isSigmaTy (ForAllTy {}) = True
isSigmaTy (FunTy { ft_af = InvisArg }) = True
isSigmaTy _ = False
isRhoTy :: TcType -> Bool -- True of TcRhoTypes; see Note [TcRhoType]
isRhoTy ty | Just ty' <- tcView ty = isRhoTy ty'
isRhoTy (ForAllTy {}) = False
isRhoTy (FunTy { ft_af = VisArg, ft_res = r }) = isRhoTy r
isRhoTy _ = True
-- | Like 'isRhoTy', but also says 'True' for 'Infer' types
isRhoExpTy :: ExpType -> Bool
isRhoExpTy (Check ty) = isRhoTy ty
isRhoExpTy (Infer {}) = True
isOverloadedTy :: Type -> Bool
-- Yes for a type of a function that might require evidence-passing
-- Used only by bindLocalMethods
isOverloadedTy ty | Just ty' <- tcView ty = isOverloadedTy ty'
isOverloadedTy (ForAllTy _ ty) = isOverloadedTy ty
isOverloadedTy (FunTy { ft_af = InvisArg }) = True
isOverloadedTy _ = False
isFloatTy, isDoubleTy, isIntegerTy, isIntTy, isWordTy, isBoolTy,
isUnitTy, isCharTy, isAnyTy :: Type -> Bool
isFloatTy = is_tc floatTyConKey
isDoubleTy = is_tc doubleTyConKey
isIntegerTy = is_tc integerTyConKey
isIntTy = is_tc intTyConKey
isWordTy = is_tc wordTyConKey
isBoolTy = is_tc boolTyConKey
isUnitTy = is_tc unitTyConKey
isCharTy = is_tc charTyConKey
isAnyTy = is_tc anyTyConKey
-- | Does a type represent a floating-point number?
isFloatingTy :: Type -> Bool
isFloatingTy ty = isFloatTy ty || isDoubleTy ty
-- | Is a type 'String'?
isStringTy :: Type -> Bool
isStringTy ty
= case tcSplitTyConApp_maybe ty of
Just (tc, [arg_ty]) -> tc == listTyCon && isCharTy arg_ty
_ -> False
-- | Is a type a 'CallStack'?
isCallStackTy :: Type -> Bool
isCallStackTy ty
| Just tc <- tyConAppTyCon_maybe ty
= tc `hasKey` callStackTyConKey
| otherwise
= False
-- | Is a 'PredType' a 'CallStack' implicit parameter?
--
-- If so, return the name of the parameter.
isCallStackPred :: Class -> [Type] -> Maybe FastString
isCallStackPred cls tys
| [ty1, ty2] <- tys
, isIPClass cls
, isCallStackTy ty2
= isStrLitTy ty1
| otherwise
= Nothing
is_tc :: Unique -> Type -> Bool
-- Newtypes are opaque to this
is_tc uniq ty = case tcSplitTyConApp_maybe ty of
Just (tc, _) -> uniq == getUnique tc
Nothing -> False
-- | Does the given tyvar appear at the head of a chain of applications
-- (a t1 ... tn)
isTyVarHead :: TcTyVar -> TcType -> Bool
isTyVarHead tv (TyVarTy tv') = tv == tv'
isTyVarHead tv (AppTy fun _) = isTyVarHead tv fun
isTyVarHead tv (CastTy ty _) = isTyVarHead tv ty
isTyVarHead _ (TyConApp {}) = False
isTyVarHead _ (LitTy {}) = False
isTyVarHead _ (ForAllTy {}) = False
isTyVarHead _ (FunTy {}) = False
isTyVarHead _ (CoercionTy {}) = False
{- Note [AppTy and ReprEq]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider a ~R# b a
a ~R# a b
The former is /not/ a definite error; we might instantiate 'b' with Id
newtype Id a = MkId a
but the latter /is/ a definite error.
On the other hand, with nominal equality, both are definite errors
-}
isRigidTy :: TcType -> Bool
isRigidTy ty
| Just (tc,_) <- tcSplitTyConApp_maybe ty = isGenerativeTyCon tc Nominal
| Just {} <- tcSplitAppTy_maybe ty = True
| isForAllTy ty = True
| otherwise = False
-- | Is this type *almost function-free*? See Note [Almost function-free]
-- in TcRnTypes
isAlmostFunctionFree :: TcType -> Bool
isAlmostFunctionFree ty | Just ty' <- tcView ty = isAlmostFunctionFree ty'
isAlmostFunctionFree (TyVarTy {}) = True
isAlmostFunctionFree (AppTy ty1 ty2) = isAlmostFunctionFree ty1 &&
isAlmostFunctionFree ty2
isAlmostFunctionFree (TyConApp tc args)
| isTypeFamilyTyCon tc = False
| otherwise = all isAlmostFunctionFree args
isAlmostFunctionFree (ForAllTy bndr _) = isAlmostFunctionFree (binderType bndr)
isAlmostFunctionFree (FunTy _ ty1 ty2) = isAlmostFunctionFree ty1 &&
isAlmostFunctionFree ty2
isAlmostFunctionFree (LitTy {}) = True
isAlmostFunctionFree (CastTy ty _) = isAlmostFunctionFree ty
isAlmostFunctionFree (CoercionTy {}) = True
{-
************************************************************************
* *
\subsection{Misc}
* *
************************************************************************
Note [Visible type application]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GHC implements a generalisation of the algorithm described in the
"Visible Type Application" paper (available from
http://www.cis.upenn.edu/~sweirich/publications.html). A key part
of that algorithm is to distinguish user-specified variables from inferred
variables. For example, the following should typecheck:
f :: forall a b. a -> b -> b
f = const id
g = const id
x = f @Int @Bool 5 False
y = g 5 @Bool False
The idea is that we wish to allow visible type application when we are
instantiating a specified, fixed variable. In practice, specified, fixed
variables are either written in a type signature (or
annotation), OR are imported from another module. (We could do better here,
for example by doing SCC analysis on parts of a module and considering any
type from outside one's SCC to be fully specified, but this is very confusing to
users. The simple rule above is much more straightforward and predictable.)
So, both of f's quantified variables are specified and may be instantiated.
But g has no type signature, so only id's variable is specified (because id
is imported). We write the type of g as forall {a}. a -> forall b. b -> b.
Note that the a is in braces, meaning it cannot be instantiated with
visible type application.
Tracking specified vs. inferred variables is done conveniently by a field
in TyBinder.
-}
deNoteType :: Type -> Type
-- Remove all *outermost* type synonyms and other notes
deNoteType ty | Just ty' <- coreView ty = deNoteType ty'
deNoteType ty = ty
{-
Find the free tycons and classes of a type. This is used in the front
end of the compiler.
-}
{-
************************************************************************
* *
\subsection[TysWiredIn-ext-type]{External types}
* *
************************************************************************
The compiler's foreign function interface supports the passing of a
restricted set of types as arguments and results (the restricting factor
being the )
-}
tcSplitIOType_maybe :: Type -> Maybe (TyCon, Type)
-- (tcSplitIOType_maybe t) returns Just (IO,t',co)
-- if co : t ~ IO t'
-- returns Nothing otherwise
tcSplitIOType_maybe ty
= case tcSplitTyConApp_maybe ty of
Just (io_tycon, [io_res_ty])
| io_tycon `hasKey` ioTyConKey ->
Just (io_tycon, io_res_ty)
_ ->
Nothing
isFFITy :: Type -> Bool
-- True for any TyCon that can possibly be an arg or result of an FFI call
isFFITy ty = isValid (checkRepTyCon legalFFITyCon ty)
isFFIArgumentTy :: DynFlags -> Safety -> Type -> Validity
-- Checks for valid argument type for a 'foreign import'
isFFIArgumentTy dflags safety ty
= checkRepTyCon (legalOutgoingTyCon dflags safety) ty
isFFIExternalTy :: Type -> Validity
-- Types that are allowed as arguments of a 'foreign export'
isFFIExternalTy ty = checkRepTyCon legalFEArgTyCon ty
isFFIImportResultTy :: DynFlags -> Type -> Validity
isFFIImportResultTy dflags ty
= checkRepTyCon (legalFIResultTyCon dflags) ty
isFFIExportResultTy :: Type -> Validity
isFFIExportResultTy ty = checkRepTyCon legalFEResultTyCon ty
isFFIDynTy :: Type -> Type -> Validity
-- The type in a foreign import dynamic must be Ptr, FunPtr, or a newtype of
-- either, and the wrapped function type must be equal to the given type.
-- We assume that all types have been run through normaliseFfiType, so we don't
-- need to worry about expanding newtypes here.
isFFIDynTy expected ty
-- Note [Foreign import dynamic]
-- In the example below, expected would be 'CInt -> IO ()', while ty would
-- be 'FunPtr (CDouble -> IO ())'.
| Just (tc, [ty']) <- splitTyConApp_maybe ty
, tyConUnique tc `elem` [ptrTyConKey, funPtrTyConKey]
, eqType ty' expected
= IsValid
| otherwise
= NotValid (vcat [ text "Expected: Ptr/FunPtr" <+> pprParendType expected <> comma
, text " Actual:" <+> ppr ty ])
isFFILabelTy :: Type -> Validity
-- The type of a foreign label must be Ptr, FunPtr, or a newtype of either.
isFFILabelTy ty = checkRepTyCon ok ty
where
ok tc | tc `hasKey` funPtrTyConKey || tc `hasKey` ptrTyConKey
= IsValid
| otherwise
= NotValid (text "A foreign-imported address (via &foo) must have type (Ptr a) or (FunPtr a)")
isFFIPrimArgumentTy :: DynFlags -> Type -> Validity
-- Checks for valid argument type for a 'foreign import prim'
-- Currently they must all be simple unlifted types, or the well-known type
-- Any, which can be used to pass the address to a Haskell object on the heap to
-- the foreign function.
isFFIPrimArgumentTy dflags ty
| isAnyTy ty = IsValid
| otherwise = checkRepTyCon (legalFIPrimArgTyCon dflags) ty
isFFIPrimResultTy :: DynFlags -> Type -> Validity
-- Checks for valid result type for a 'foreign import prim' Currently
-- it must be an unlifted type, including unboxed tuples, unboxed
-- sums, or the well-known type Any.
isFFIPrimResultTy dflags ty
| isAnyTy ty = IsValid
| otherwise = checkRepTyCon (legalFIPrimResultTyCon dflags) ty
isFunPtrTy :: Type -> Bool
isFunPtrTy ty
| Just (tc, [_]) <- splitTyConApp_maybe ty
= tc `hasKey` funPtrTyConKey
| otherwise
= False
-- normaliseFfiType gets run before checkRepTyCon, so we don't
-- need to worry about looking through newtypes or type functions
-- here; that's already been taken care of.
checkRepTyCon :: (TyCon -> Validity) -> Type -> Validity
checkRepTyCon check_tc ty
= case splitTyConApp_maybe ty of
Just (tc, tys)
| isNewTyCon tc -> NotValid (hang msg 2 (mk_nt_reason tc tys $$ nt_fix))
| otherwise -> case check_tc tc of
IsValid -> IsValid
NotValid extra -> NotValid (msg $$ extra)
Nothing -> NotValid (quotes (ppr ty) <+> text "is not a data type")
where
msg = quotes (ppr ty) <+> text "cannot be marshalled in a foreign call"
mk_nt_reason tc tys
| null tys = text "because its data constructor is not in scope"
| otherwise = text "because the data constructor for"
<+> quotes (ppr tc) <+> text "is not in scope"
nt_fix = text "Possible fix: import the data constructor to bring it into scope"
{-
Note [Foreign import dynamic]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A dynamic stub must be of the form 'FunPtr ft -> ft' where ft is any foreign
type. Similarly, a wrapper stub must be of the form 'ft -> IO (FunPtr ft)'.
We use isFFIDynTy to check whether a signature is well-formed. For example,
given a (illegal) declaration like:
foreign import ccall "dynamic"
foo :: FunPtr (CDouble -> IO ()) -> CInt -> IO ()
isFFIDynTy will compare the 'FunPtr' type 'CDouble -> IO ()' with the curried
result type 'CInt -> IO ()', and return False, as they are not equal.
----------------------------------------------
These chaps do the work; they are not exported
----------------------------------------------
-}
legalFEArgTyCon :: TyCon -> Validity
legalFEArgTyCon tc
-- It's illegal to make foreign exports that take unboxed
-- arguments. The RTS API currently can't invoke such things. --SDM 7/2000
= boxedMarshalableTyCon tc
legalFIResultTyCon :: DynFlags -> TyCon -> Validity
legalFIResultTyCon dflags tc
| tc == unitTyCon = IsValid
| otherwise = marshalableTyCon dflags tc
legalFEResultTyCon :: TyCon -> Validity
legalFEResultTyCon tc
| tc == unitTyCon = IsValid
| otherwise = boxedMarshalableTyCon tc
legalOutgoingTyCon :: DynFlags -> Safety -> TyCon -> Validity
-- Checks validity of types going from Haskell -> external world
legalOutgoingTyCon dflags _ tc
= marshalableTyCon dflags tc
legalFFITyCon :: TyCon -> Validity
-- True for any TyCon that can possibly be an arg or result of an FFI call
legalFFITyCon tc
| isUnliftedTyCon tc = IsValid
| tc == unitTyCon = IsValid
| otherwise = boxedMarshalableTyCon tc
marshalableTyCon :: DynFlags -> TyCon -> Validity
marshalableTyCon dflags tc
| isUnliftedTyCon tc
, not (isUnboxedTupleTyCon tc || isUnboxedSumTyCon tc)
, not (null (tyConPrimRep tc)) -- Note [Marshalling void]
= validIfUnliftedFFITypes dflags
| otherwise
= boxedMarshalableTyCon tc
boxedMarshalableTyCon :: TyCon -> Validity
boxedMarshalableTyCon tc
| getUnique tc `elem` [ intTyConKey, int8TyConKey, int16TyConKey
, int32TyConKey, int64TyConKey
, wordTyConKey, word8TyConKey, word16TyConKey
, word32TyConKey, word64TyConKey
, floatTyConKey, doubleTyConKey
, ptrTyConKey, funPtrTyConKey
, charTyConKey
, stablePtrTyConKey
, boolTyConKey
]
= IsValid
| otherwise = NotValid empty
legalFIPrimArgTyCon :: DynFlags -> TyCon -> Validity
-- Check args of 'foreign import prim', only allow simple unlifted types.
-- Strictly speaking it is unnecessary to ban unboxed tuples and sums here since
-- currently they're of the wrong kind to use in function args anyway.
legalFIPrimArgTyCon dflags tc
| isUnliftedTyCon tc
, not (isUnboxedTupleTyCon tc || isUnboxedSumTyCon tc)
= validIfUnliftedFFITypes dflags
| otherwise
= NotValid unlifted_only
legalFIPrimResultTyCon :: DynFlags -> TyCon -> Validity
-- Check result type of 'foreign import prim'. Allow simple unlifted
-- types and also unboxed tuple and sum result types.
legalFIPrimResultTyCon dflags tc
| isUnliftedTyCon tc
, isUnboxedTupleTyCon tc || isUnboxedSumTyCon tc
|| not (null (tyConPrimRep tc)) -- Note [Marshalling void]
= validIfUnliftedFFITypes dflags
| otherwise
= NotValid unlifted_only
unlifted_only :: MsgDoc
unlifted_only = text "foreign import prim only accepts simple unlifted types"
validIfUnliftedFFITypes :: DynFlags -> Validity
validIfUnliftedFFITypes dflags
| xopt LangExt.UnliftedFFITypes dflags = IsValid
| otherwise = NotValid (text "To marshal unlifted types, use UnliftedFFITypes")
{-
Note [Marshalling void]
~~~~~~~~~~~~~~~~~~~~~~~
We don't treat State# (whose PrimRep is VoidRep) as marshalable.
In turn that means you can't write
foreign import foo :: Int -> State# RealWorld
Reason: the back end falls over with panic "primRepHint:VoidRep";
and there is no compelling reason to permit it
-}
{-
************************************************************************
* *
The "Paterson size" of a type
* *
************************************************************************
-}
{-
Note [Paterson conditions on PredTypes]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We are considering whether *class* constraints terminate
(see Note [Paterson conditions]). Precisely, the Paterson conditions
would have us check that "the constraint has fewer constructors and variables
(taken together and counting repetitions) than the head.".
However, we can be a bit more refined by looking at which kind of constraint
this actually is. There are two main tricks:
1. It seems like it should be OK not to count the tuple type constructor
for a PredType like (Show a, Eq a) :: Constraint, since we don't
count the "implicit" tuple in the ThetaType itself.
In fact, the Paterson test just checks *each component* of the top level
ThetaType against the size bound, one at a time. By analogy, it should be
OK to return the size of the *largest* tuple component as the size of the
whole tuple.
2. Once we get into an implicit parameter or equality we
can't get back to a class constraint, so it's safe
to say "size 0". See #4200.
NB: we don't want to detect PredTypes in sizeType (and then call
sizePred on them), or we might get an infinite loop if that PredType
is irreducible. See #5581.
-}
type TypeSize = IntWithInf
sizeType :: Type -> TypeSize
-- Size of a type: the number of variables and constructors
-- Ignore kinds altogether
sizeType = go
where
go ty | Just exp_ty <- tcView ty = go exp_ty
go (TyVarTy {}) = 1
go (TyConApp tc tys)
| isTypeFamilyTyCon tc = infinity -- Type-family applications can
-- expand to any arbitrary size
| otherwise = sizeTypes (filterOutInvisibleTypes tc tys) + 1
-- Why filter out invisible args? I suppose any
-- size ordering is sound, but why is this better?
-- I came across this when investigating #14010.
go (LitTy {}) = 1
go (FunTy _ arg res) = go arg + go res + 1
go (AppTy fun arg) = go fun + go arg
go (ForAllTy (Bndr tv vis) ty)
| isVisibleArgFlag vis = go (tyVarKind tv) + go ty + 1
| otherwise = go ty + 1
go (CastTy ty _) = go ty
go (CoercionTy {}) = 0
sizeTypes :: [Type] -> TypeSize
sizeTypes tys = sum (map sizeType tys)
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------
-- | For every arg a tycon can take, the returned list says True if the argument
-- is taken visibly, and False otherwise. Ends with an infinite tail of Trues to
-- allow for oversaturation.
tcTyConVisibilities :: TyCon -> [Bool]
tcTyConVisibilities tc = tc_binder_viss ++ tc_return_kind_viss ++ repeat True
where
tc_binder_viss = map isVisibleTyConBinder (tyConBinders tc)
tc_return_kind_viss = map isVisibleBinder (fst $ tcSplitPiTys (tyConResKind tc))
-- | If the tycon is applied to the types, is the next argument visible?
isNextTyConArgVisible :: TyCon -> [Type] -> Bool
isNextTyConArgVisible tc tys
= tcTyConVisibilities tc `getNth` length tys
-- | Should this type be applied to a visible argument?
isNextArgVisible :: TcType -> Bool
isNextArgVisible ty
| Just (bndr, _) <- tcSplitPiTy_maybe ty = isVisibleBinder bndr
| otherwise = True
-- this second case might happen if, say, we have an unzonked TauTv.
-- But TauTvs can't range over types that take invisible arguments
|
sdiehl/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
| 94,212
| 0
| 17
| 24,003
| 14,751
| 7,870
| 6,881
| -1
| -1
|
module Main where
import Control.Monad.Writer
import Control.Monad.Identity
import Expr
import CodeGen
import Optimization
import X86_64
test :: [Instr]
test = optimize $ assemble $ compile $ optimize (Lit 10 :+: Lit 5 :*: Lit 3)
main :: IO ()
main = print test
|
faineance/minigen
|
src/Main.hs
|
bsd-3-clause
| 285
| 0
| 10
| 66
| 94
| 52
| 42
| 11
| 1
|
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.Rendering.OpenGL.GLU.Errors
-- Copyright : (c) Sven Panne 2003
-- License : BSD-style (see the file libraries/OpenGL/LICENSE)
--
-- Maintainer : sven_panne@yahoo.com
-- Stability : provisional
-- Portability : portable
--
-- This module corresponds to section 2.5 (GL Errors) of the OpenGL 1.4 specs
-- and chapter 8 (Errors) of the GLU specs, offering a generalized view of
-- errors in GL and GLU.
--
--------------------------------------------------------------------------------
module Graphics.Rendering.OpenGL.GLU.Errors (
Error(..), ErrorCategory(..), errors
) where
import Graphics.Rendering.OpenGL.GL.BasicTypes ( GLenum )
import Graphics.Rendering.OpenGL.GL.StateVar (
GettableStateVar, makeGettableStateVar )
import Graphics.Rendering.OpenGL.GLU.ErrorsInternal (
Error(..), ErrorCategory(..), makeError, isError )
--------------------------------------------------------------------------------
-- | When an error occurs, it is recorded in this state variable and no further
-- errors are recorded. Reading 'errors' returns the currently recorded errors
-- (there may be more than one due to a possibly distributed implementation) and
-- resets the state variable to @[]@, re-enabling the recording of future
-- errors. The value @[]@ means that there has been no detectable error since
-- the last time 'errors' was read, or since the GL was initialized.
errors :: GettableStateVar [Error]
errors = makeGettableStateVar $ getErrors []
where getErrors acc = do
errorCode <- glGetError
if isError errorCode
then getErrors (errorCode:acc)
else mapM makeError (reverse acc)
foreign import stdcall unsafe "HsOpenGL.h glGetError" glGetError :: IO GLenum
|
OS2World/DEV-UTIL-HUGS
|
libraries/Graphics/Rendering/OpenGL/GLU/Errors.hs
|
bsd-3-clause
| 1,861
| 0
| 12
| 312
| 203
| 130
| 73
| 15
| 2
|
module Parser where
import Text.Parsec hiding (space)
import Text.Parsec.String
import Text.Parsec.Combinator
import Text.Parsec.Char hiding (space)
import Data.Char
import Types
import Control.Applicative hiding (many, (<|>))
import Test.QuickCheck
square :: Parser Square
square = (toSquare <$> oneOf "abcdefgh" <*> digit) <?> "square" where
toSquare :: Char -> Char -> Square
toSquare col rank = Square . fromIntegral $ (ord col - ord 'a') + (8 * (ord rank - ord '1'))
piece :: Parser Piece
piece = (toPiece <$> oneOf "rcdhmeRCDHME") <?> "piece" where
toPiece c = (pieceType (toLower c), if isLower c then Silver else Gold)
pieceType 'r' = Rabbit
pieceType 'c' = Cat
pieceType 'd' = Dog
pieceType 'h' = Horse
pieceType 'm' = Camel
pieceType 'e' = Elephant
dir :: Parser Direction
dir = (toDir <$> oneOf "nwse") <?> "direction" where
toDir 'n' = North
toDir 's' = South
toDir 'e' = East
toDir 'w' = West
move :: Parser Move
move = (Move <$> piece <*> square <*> dir) <?> "move"
maybeParse :: Parser a -> String -> Maybe a
maybeParse p input = case parse p "" input of
Left _ -> Nothing
Right x -> Just x
colour :: Parser Colour
colour = (toColour <$> oneOf "gswb") <?> "colour" where
toColour 'w' = Gold
toColour 'g' = Gold
toColour 's' = Silver
toColour 'b' = Silver
int :: Parser Int
int = read <$> many1 digit
moveNumber :: Parser MoveNumber
moveNumber = MoveNumber <$> int <*> colour
space :: Parser Char
space = (char ' ')
moveLine :: Parser (MoveNumber, [Move])
moveLine = (,) <$> moveNumber <*> (space *> move `sepBy` space)
edge :: Parser ()
edge = (string " +-----------------+" >> return ()) <?> "board edge"
boardCols :: Parser ()
boardCols = (string " a b c d e f g h" >> return ()) <?> "column labels"
boardLine :: Int -> Parser [Maybe Piece]
boardLine n = (do
char number >> pipe >> space
many1 (boardSquare <* space) <* char '|') <?> "board rank " ++ (show n)
where
number = chr $ ord '0' + n
pipe = char '|' <?> "board edge"
boardSquare = ((Just <$> piece) <|> const Nothing <$> oneOf "xX ") <?> "board square"
board :: Parser Board
board = do
moves <- moveLine <* newline
edge <* newline
pieces <- mapM (\n -> boardLine n <* newline) [8, 7..1]
edge <* newline
boardCols
return $ Board moves (concat pieces)
prop_moveIdentity m = Just m == maybeParse move (show m)
prop_boardIdentity b = Just b == maybeParse board (show b)
|
Saulzar/arimaa
|
src/Parser.hs
|
bsd-3-clause
| 2,555
| 0
| 13
| 634
| 955
| 490
| 465
| 69
| 7
|
{-# LANGUAGE OverloadedStrings, FlexibleContexts, FlexibleInstances, RankNTypes #-}
module Web.Scotty.Route
( get, post, put, delete, patch, addroute, matchAny, notFound,
capture, regex, function, literal
) where
import Control.Arrow ((***))
import Control.Monad.Error
import qualified Control.Monad.State as MS
import Control.Monad.Trans.Resource (runResourceT, withInternalState, MonadBaseControl)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as BL
import Data.Conduit (($$), (=$))
import Data.Conduit.Binary (sourceLbs)
import Data.Conduit.Lazy (lazyConsume)
import Data.Conduit.List (consume)
import Data.Either (partitionEithers)
import Data.Maybe (fromMaybe)
import Data.Monoid (mconcat)
import qualified Data.Text.Lazy as T
import qualified Data.Text as TS
import Network.HTTP.Types
import Network.Wai (Request(..))
import qualified Network.Wai.Parse as Parse hiding (parseRequestBody)
import qualified Text.Regex as Regex
import Web.Scotty.Action
import Web.Scotty.Types
import Web.Scotty.Util
-- | get = 'addroute' 'GET'
get :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
get = addroute GET
-- | post = 'addroute' 'POST'
post :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
post = addroute POST
-- | put = 'addroute' 'PUT'
put :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
put = addroute PUT
-- | delete = 'addroute' 'DELETE'
delete :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
delete = addroute DELETE
-- | patch = 'addroute' 'PATCH'
patch :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
patch = addroute PATCH
-- | Add a route that matches regardless of the HTTP verb.
matchAny :: (ScottyError e, MonadIO m) => RoutePattern -> ActionT e m () -> ScottyT e m ()
matchAny pattern action = mapM_ (\v -> addroute v pattern action) [minBound..maxBound]
-- | Specify an action to take if nothing else is found. Note: this _always_ matches,
-- so should generally be the last route specified.
notFound :: (ScottyError e, MonadIO m) => ActionT e m () -> ScottyT e m ()
notFound action = matchAny (Function (\req -> Just [("path", path req)])) (status status404 >> action)
-- | Define a route with a 'StdMethod', 'T.Text' value representing the path spec,
-- and a body ('Action') which modifies the response.
--
-- > addroute GET "/" $ text "beam me up!"
--
-- The path spec can include values starting with a colon, which are interpreted
-- as /captures/. These are named wildcards that can be looked up with 'param'.
--
-- > addroute GET "/foo/:bar" $ do
-- > v <- param "bar"
-- > text v
--
-- >>> curl http://localhost:3000/foo/something
-- something
addroute :: (ScottyError e, MonadIO m) => StdMethod -> RoutePattern -> ActionT e m () -> ScottyT e m ()
addroute method pat action = ScottyT $ MS.modify $ \s -> addRoute (route (handler s) method pat action) s
route :: (ScottyError e, MonadIO m) => ErrorHandler e m -> StdMethod -> RoutePattern -> ActionT e m () -> Middleware m
route h method pat action app req =
let tryNext = app req
in if Right method == parseMethod (requestMethod req)
then case matchRoute pat req of
Just captures -> do
env <- mkEnv req captures
res <- runAction h env action
maybe tryNext return res
Nothing -> tryNext
else tryNext
matchRoute :: RoutePattern -> Request -> Maybe [Param]
matchRoute (Literal pat) req | pat == path req = Just []
| otherwise = Nothing
matchRoute (Function fun) req = fun req
matchRoute (Capture pat) req = go (T.split (=='/') pat) (T.split (=='/') $ path req) []
where go [] [] prs = Just prs -- request string and pattern match!
go [] r prs | T.null (mconcat r) = Just prs -- in case request has trailing slashes
| otherwise = Nothing -- request string is longer than pattern
go p [] prs | T.null (mconcat p) = Just prs -- in case pattern has trailing slashes
| otherwise = Nothing -- request string is not long enough
go (p:ps) (r:rs) prs | p == r = go ps rs prs -- equal literals, keeping checking
| T.null p = Nothing -- p is null, but r is not, fail
| T.head p == ':' = go ps rs $ (T.tail p, r) : prs -- p is a capture, add to params
| otherwise = Nothing -- both literals, but unequal, fail
-- Pretend we are at the top level.
path :: Request -> T.Text
path = T.fromStrict . TS.cons '/' . TS.intercalate "/" . pathInfo
-- Stolen from wai-extra, modified to accept body as lazy ByteString
parseRequestBody :: (MonadBaseControl IO m, MonadIO m)
=> BL.ByteString
-> Parse.BackEnd y
-> Request
-> m ([Parse.Param], [Parse.File y])
parseRequestBody b s r =
case Parse.getRequestBodyType r of
Nothing -> return ([], [])
Just rbt -> runResourceT $ withInternalState $ \ is ->
liftIO $ liftM partitionEithers $ sourceLbs b $$ Parse.conduitRequestBody is s rbt =$ consume
mkEnv :: MonadIO m => Request -> [Param] -> m ActionEnv
mkEnv req captures = do
b <- liftIO $ liftM BL.fromChunks $ lazyConsume (requestBody req)
(formparams, fs) <- liftIO $ parseRequestBody b Parse.lbsBackEnd req
let convert (k, v) = (strictByteStringToLazyText k, strictByteStringToLazyText v)
parameters = captures ++ map convert formparams ++ queryparams
queryparams = parseEncodedParams $ rawQueryString req
return $ Env req parameters b [ (strictByteStringToLazyText k, fi) | (k,fi) <- fs ]
parseEncodedParams :: B.ByteString -> [Param]
parseEncodedParams bs = [ (T.fromStrict k, T.fromStrict $ fromMaybe "" v) | (k,v) <- parseQueryText bs ]
-- | Match requests using a regular expression.
-- Named captures are not yet supported.
--
-- > get (regex "^/f(.*)r$") $ do
-- > path <- param "0"
-- > cap <- param "1"
-- > text $ mconcat ["Path: ", path, "\nCapture: ", cap]
--
-- >>> curl http://localhost:3000/foo/bar
-- Path: /foo/bar
-- Capture: oo/ba
--
regex :: String -> RoutePattern
regex pattern = Function $ \ req -> fmap (map (T.pack . show *** T.pack) . zip [0 :: Int ..] . strip)
(Regex.matchRegexAll rgx $ T.unpack $ path req)
where rgx = Regex.mkRegex pattern
strip (_, match, _, subs) = match : subs
-- | Standard Sinatra-style route. Named captures are prepended with colons.
-- This is the default route type generated by OverloadedString routes. i.e.
--
-- > get (capture "/foo/:bar") $ ...
--
-- and
--
-- > {-# LANGUAGE OverloadedStrings #-}
-- > ...
-- > get "/foo/:bar" $ ...
--
-- are equivalent.
capture :: String -> RoutePattern
capture = Capture . T.pack
-- | Build a route based on a function which can match using the entire 'Request' object.
-- 'Nothing' indicates the route does not match. A 'Just' value indicates
-- a successful match, optionally returning a list of key-value pairs accessible
-- by 'param'.
--
-- > get (function $ \req -> Just [("version", T.pack $ show $ httpVersion req)]) $ do
-- > v <- param "version"
-- > text v
--
-- >>> curl http://localhost:3000/
-- HTTP/1.1
--
function :: (Request -> Maybe [Param]) -> RoutePattern
function = Function
-- | Build a route that requires the requested path match exactly, without captures.
literal :: String -> RoutePattern
literal = Literal . T.pack
|
xich/scotty
|
Web/Scotty/Route.hs
|
bsd-3-clause
| 7,738
| 0
| 15
| 1,841
| 2,053
| 1,105
| 948
| -1
| -1
|
{-# LANGUAGE Arrows, ScopedTypeVariables, OverloadedStrings #-}
module Blankeroids.Ship where
import FRP.Yampa
import FRP.Yampa.Vector2
import Control.Monad.Random
import Blankeroids.Polygons
import Blankeroids.Types
import Blankeroids.Utils
import Blankeroids.Debris
import Blankeroids.Missiles
shipThrust :: Double
shipThrust = 10.0
shipDrag :: Double
shipDrag = 3.0
shipHyperLength :: Double
shipHyperLength = 1.0
shipReaniInterval :: Double
shipReaniInterval = 4.0
theShip :: Object
theShip = Ship {polys = [shipPolygon],
pos = vector2 0.5 0.5, vel = vector2 0.0 0.0,
angPos = 0.0, radius = 0.016, thrusting = False,
done = NoEvent, reqReanimate = False,
reanimate = NoEvent, spawn = NoEvent }
movingShip :: RandomGen g => g -> Object -> SFObject
movingShip g s = proc ev -> do
-- Calculate the angular position of the ship, accumulating turn left and
-- turn right events.
angPos' <- accumHoldBy accumAngPos (angPos s) -< ev
-- Create fire event, based on fire key events, and the number of missiles
-- that are curently in the magazie and a reload rate.
trigger' <- arr fireCannon -< ev
(_, fire) <- magazine 4 4.5 -< trigger'
-- Calculate boolean flags for destroyed, hyperspace start, request
-- reanmiation, and request end of hyperspace based on input events and
-- delays
(destroyed', hyperspace') <-
accumHoldBy destroyHyperOccured (False, False) -< ev
reqReanimate' <-
accumHoldBy destroyOccured False <<<
delayEvent shipReaniInterval -< ev
reqHyperEnd <-
accumHoldBy hyperOccured False <<<
delayEvent shipHyperLength -< ev
-- Pulse thrust flame for a period after each thrust key event
let thrustOn = thrustToUnit ev `tag` True
thrustOff <- delayEvent 0.5 -< thrustToUnit ev `tag` False
thrusting' <- hold False -< mergeBy (||) thrustOn thrustOff
-- Calculate accleration and velocity based on input thrust events and
-- ship angle.
rec
accel <- arr calcAccel -< (ev, angPos', vel')
vel' <- integral -< accel
-- Calculate the xy position, based on integral of velocity, wrappnig
-- at the edge of the screen as required.
pos' <- wrapObject (radius s) <<< ((pos s) ^+^) ^<< integral -< vel'
returnA -< s { polys = if (destroyed')
then []
else [transformPoly angPos'
(pos2Point pos') shipPolygon] ++
if thrusting'
then [transformPoly angPos' (pos2Point pos')
thrustPolygon]
else [],
pos = pos', vel = vel', angPos = angPos',
thrusting = thrusting',
-- Request a reanimation event if done with destroyed timeout
-- or hyperspace delay timeout
reqReanimate = reqReanimate' || reqHyperEnd,
-- Ship SF should be removed if it received a Reanimate Event
done = reanimateToUnit ev,
-- New SF's should be created for fire missile, ship debris,
-- or a new ship or one coming out of hyperspace
spawn = foldl (mergeBy (++)) NoEvent
[(fire `tag` (addMissile pos' angPos')),
(destroyedToUnit ev `tag`
(evalRand (newDebris pos') g')),
(reanimateToUnit ev `tag`
(reanimateShip angPos' hyperspace'))] }
where
(g', g'') = split g
destroyHyperOccured :: (Bool, Bool) -> GameEvent -> (Bool, Bool)
destroyHyperOccured _ Destroyed = (True, False)
destroyHyperOccured _ Hyperspace = (True, True)
destroyHyperOccured initial _ = initial
destroyOccured :: Bool -> GameEvent -> Bool
destroyOccured _ Destroyed = True
destroyOccured initial _ = initial
hyperOccured :: Bool -> GameEvent -> Bool
hyperOccured _ Hyperspace = True
hyperOccured initial _ = initial
thrustToUnit :: Event GameEvent -> Event ()
thrustToUnit (Event Thruster) = Event ()
thrustToUnit _ = NoEvent
addMissile :: Position -> AngPosition -> [SFObject]
addMissile p' ap' = [movingMissile $ newMissile p' ap']
newMissile :: Position -> AngPosition -> Object
newMissile p' ap' = Missile { poly = missilePolygon,
source = ShipMissile,
pos = vector2 ((vector2X p') - 0.016 * sin ap')
((vector2Y p') + 0.016 * cos ap'),
vel = vector2 (-missileVel * sin ap')
( missileVel * cos ap'),
done = NoEvent, spawn = NoEvent }
-- Ammunition magazine. Reloaded up to maximal capacity at constant rate.
-- n ... Maximal and initial number of missiles.
-- f .......... Reload rate.
-- input ...... Trigger.
-- output ..... Tuple: #1: Current number of missiles in magazine.
-- #2: Missile fired event.
-- Reused from Yampa Space Invaders Example
-- Copyright (c) Yale University, 2003
magazine :: Int -> Double -> SF (Event ()) (Int, Event ())
magazine n f = proc trigger' -> do
reload <- repeatedly (1/f) () -< ()
(level,canFire) <- accumHold (n,True) -< (trigger' `tag` dec)
`lMerge` (reload `tag` inc)
returnA -< (level, trigger' `gate` canFire)
where
inc :: (Int,Bool) -> (Int, Bool)
inc (l,_) | l < n = (l + 1, l > 0)
| otherwise = (l, True)
dec :: (Int,Bool) -> (Int, Bool)
dec (l,_) | l > 0 = (l - 1, True)
| otherwise = (l, False)
reanimateShip :: AngPosition -> Bool-> [SFObject]
reanimateShip ap' h' = [movingShip g'' (newShip ap' h')]
randomPosition :: RandomGen g => Rand g Position
randomPosition = do
x <- getRandomR(0.1,0.9)
y <- getRandomR(0.1,0.9)
return (vector2 x y)
newShip :: AngPosition -> Bool -> Object
newShip ap'' h'' = Ship {polys = [shipPolygon],
pos = startPos, vel = vector2 0.0 0.0,
angPos = ap'', radius = 0.016, thrusting = False,
done = NoEvent, reqReanimate = False,
reanimate = NoEvent, spawn = NoEvent }
where
startPos = if h''
then evalRand randomPosition g'
else vector2 0.5 0.5
accumAngPos :: Double -> GameEvent -> Double
accumAngPos start TurnRight = start - (pi / 8)
accumAngPos start TurnLeft = start + (pi / 8)
accumAngPos start _ = start
fireCannon :: Event GameEvent -> Event ()
fireCannon (Event Fire) = Event ()
fireCannon _ = NoEvent
-- Calculate acceleration based on if the ship is thrusting, or if not
-- slow it by inertia.
calcAccel :: (Event GameEvent, AngPosition, Velocity) -> Acceleration
calcAccel (Event Thruster, currAngPos, _) =
vector2 (-shipThrust * sin currAngPos) (shipThrust * cos currAngPos)
calcAccel (_ , _ , currVel) =
let mag = vector2Rho currVel
(xVel,yVel) = vector2XY currVel
in if (mag < shipDrag)
then vector2 (-xVel) (-yVel)
else vector2 (-shipDrag * xVel / mag) (-shipDrag * yVel / mag)
newDebris :: RandomGen g => Position -> Rand g [SFObject]
newDebris p = do
debris <- mapM (oneDebris p) [0..(length shipDebrisPolygons - 1)]
return debris
-- Create one piece of debris, at a random life span, velocity and angle.
oneDebris :: RandomGen g => Position -> Int -> Rand g SFObject
oneDebris p i = do
life' <- getRandomR(0.8,1.6)
vel' <- getRandomR(0.03,0.08)
angle' <- getRandomR(0.0, 2*pi)
return (movingDebris
Debris { basePoly = shipDebrisPolygons !! i,
poly = shipDebrisPolygons !! i, pos = p,
vel = vector2 (vel' * sin angle') (vel' * cos angle'),
life = life', done = NoEvent, spawn = NoEvent } )
---------------------------------------------------
shipPolygon :: Polygon
shipPolygon = [( -0.008,-0.016),(0.000,0.016),(0.008,-0.016),
( 0.000,-0.012),(-0.008,-0.016)]
thrustPolygon :: Polygon
thrustPolygon = [(0.000,-0.012),(0.006,-0.018),(0.000,-0.024),
( -0.006,-0.018),(0.000,-0.012)]
|
markgrebe/Blankeroids
|
Blankeroids/Ship.hs
|
bsd-3-clause
| 8,812
| 2
| 18
| 2,989
| 2,275
| 1,245
| 1,030
| 150
| 14
|
{-# LANGUAGE NoMonomorphismRestriction #-}
module Diagrams.Swimunit.Dotmatrix
where
import qualified Data.Map as Map
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
{-|
Renders list of characters to a diagram where the characters
are shown as if displayed by an old dotmatrix panel.
Only the light emitting dots are shown.
This function maps a list of n characters passed as third argument
to n dotmatrix characters.
-}
dotmatrix :: Diagram B -- ^ Diagram to show a 'dot'.
-> Dotfont -- ^ The Dotfont to be used.
-> String -- ^ List of characters to be rendered in dotmatrix.
-> Diagram B -- ^ Resulting diagram.
dotmatrix dt fnt txt = dotmatrix' dt fnt False txt
{-|
Renders list of characters to a diagram where the characters
are shown as if displayed by an old dotmatrix panel.
Only the dark dots are shown. This function is usually used to render
the back panel.
Function is calling dotmatrix.
-}
notdotmatrix :: Diagram B -- ^ Diagram to show a 'dot'.
-> Dotfont -- ^ The Dotfont to be used.
-> String -- ^ List of characters to be rendered in dotmatrix.
-> Diagram B -- ^ Resulting diagram.
notdotmatrix dt fnt txt = dotmatrix' dt fnt True txt
{-|
Renders list of characters to a diagram where the characters
are shown as if displayed by an old dotmatrix panel.
Whether light emitting dots or backpanel dots are shown is controlled by third
argument.
This function maps a list of n characters passed as fourth argument
to n dotmatrix characters. The third argument decides whether the
dots of the font or the dots of the backplane are rendered.
Devnote: Function loops over list of characters in fourth argument.
-}
dotmatrix' :: Diagram B -- ^ Diagram to show a 'dot'.
-> Dotfont -- ^ The Dotfont to be used.
-> Bool -- ^ True if inverse of font is returned.
-> String -- ^ List of characters to be rendered in dotmatrix.
-> Diagram B -- ^ Resulting diagram.
dotmatrix' dt fnt rev txt = hcat (map (dotcharblock dt fnt rev) txt)
{-|
Vertically stacks a number of lines of dots prepared by function dotline
to a block of dots representing a Dotchar.
-}
dotcharblock :: Diagram B -- ^ Diagram to show a 'dot'.
-> Dotfont -- ^ The Dotfont to be used.
-> Bool -- ^ If true comparison is inverted.
-> Char -- ^ Character to be mapped to a Dotchar.
-> Diagram B -- ^ Resulting diagram.
dotcharblock dt fnt rev c = vcat (map (dotcharline dt rev)
(dotcharlistoflistsofchars(dotcharmap fnt c))
)
{-|
Maps sequence of Char to a horizontal sequence of dots.
Devnote: Due to partial application the line has to be the last argument.
-}
dotcharline :: Diagram B -- ^ Diagram to show a 'dot'.
-> Bool -- ^ If true comparison is inverted.
-> [Char] -- ^ Squence of characters.
-> Diagram B -- ^ Resulting diagram.
dotcharline dt rev ln = hcat (map (dotornotdot dt rev) ln)
{-|
Maps a Char to a Dotchar.
If Char has no associated entry the undefined Dotchar is returned. Note that
therefore the mapping to the undefined character has always to be present.
-}
dotcharmap :: Dotfont -- ^ The Dotfont to be used.
-> Char -- ^ Character to be mapped to a bunch of dots.
-> Dotchar -- ^ Resulting dot matrix character.
dotcharmap fnt c = case (Map.lookup c fnt) of
Just x -> x
Nothing -> case (Map.lookup '\0' fnt) of
Just y -> y
Nothing -> Dotchar [[]]
{-|
Function decides whether a character (passed as third argument)
in a character definition is interpreted as a dot or not.
If it is a dot the diagram passed as first argument is rendered
otherwise the phantom of the diagram is returned.
To make the rendering of the back panel easier the second argument
can invert the decision.
Devnote: Due to partial application of this function the character deciding
must be the last argument.
-}
dotornotdot :: Diagram B -- ^ Diagram to show a 'dot'.
-> Bool -- ^ If true comparison is inverted.
-> Char -- ^ Character to control generation of 'dot' or empty space ('notdot').
-> Diagram B -- ^ Resulting diagram.
dotornotdot dt rev c =
if rev
then
if c == ' ' -- add more conditions here
then dt
else (phantom dt)
else
if c /= ' ' -- add more conditions here
then dt
else (phantom dt)
{-|
A character for Dotmatrix consists of a number of lines of characters.
All characters for a given character set should have the same width and height.
-}
data Dotchar = Dotchar {
dotcharlistoflistsofchars :: [[Char]]
}
{-|
Defines a font for Dotmatrix which is nothing more than a collection
of Dotcharacters with a map than combines ASCII characters to Dotcharacters.
-}
type Dotfont = Map.Map Char Dotchar
{-|
This is the concrete mapping of Char to Dotchar for font B6x9.
-}
dotfont_B6x9 :: Map.Map Char Dotchar
dotfont_B6x9 = Map.fromList ([
(' ' , dotchar_Blank_B6x9)
, ('#' , dotchar_Hash_B6x9)
, (':' , dotchar_Colon_B6x9)
, (',' , dotchar_Comma_B6x9)
, (';' , dotchar_Semicolon_B6x9)
, ('.' , dotchar_Point_B6x9)
, ('+' , dotchar_Plus_B6x9)
, ('-' , dotchar_Minus_B6x9)
, ('_' , dotchar_Underscore_B6x9)
, ('!' , dotchar_Exclamation_B6x9)
, ('=' , dotchar_Equals_B6x9)
, ('0' , dotchar_0__B6x9)
, ('1' , dotchar_1__B6x9)
, ('2' , dotchar_2__B6x9)
, ('3' , dotchar_3__B6x9)
, ('4' , dotchar_4__B6x9)
, ('5' , dotchar_5__B6x9)
, ('6' , dotchar_6__B6x9)
, ('7' , dotchar_7__B6x9)
, ('8' , dotchar_8__B6x9)
, ('9' , dotchar_9__B6x9)
, ('A' , dotchar_A__B6x9)
, ('a' , dotchar_A__B6x9)
, ('B' , dotchar_B__B6x9)
, ('b' , dotchar_B__B6x9)
, ('C' , dotchar_C__B6x9)
, ('c' , dotchar_C__B6x9)
, ('D' , dotchar_D__B6x9)
, ('d' , dotchar_D__B6x9)
, ('E' , dotchar_E__B6x9)
, ('e' , dotchar_E__B6x9)
, ('F' , dotchar_F__B6x9)
, ('f' , dotchar_F__B6x9)
, ('G' , dotchar_G__B6x9)
, ('g' , dotchar_G__B6x9)
, ('H' , dotchar_H__B6x9)
, ('h' , dotchar_H__B6x9)
, ('I' , dotchar_I__B6x9)
, ('i' , dotchar_I__B6x9)
, ('J' , dotchar_J__B6x9)
, ('j' , dotchar_J__B6x9)
, ('K' , dotchar_K__B6x9)
, ('k' , dotchar_K__B6x9)
, ('L' , dotchar_L__B6x9)
, ('l' , dotchar_L__B6x9)
, ('M' , dotchar_M__B6x9)
, ('m' , dotchar_M__B6x9)
, ('N' , dotchar_N__B6x9)
, ('n' , dotchar_N__B6x9)
, ('O' , dotchar_O__B6x9)
, ('o' , dotchar_O__B6x9)
, ('P' , dotchar_P__B6x9)
, ('p' , dotchar_P__B6x9)
, ('Q' , dotchar_Q__B6x9)
, ('q' , dotchar_Q__B6x9)
, ('R' , dotchar_R__B6x9)
, ('r' , dotchar_R__B6x9)
, ('S' , dotchar_S__B6x9)
, ('s' , dotchar_S__B6x9)
, ('T' , dotchar_T__B6x9)
, ('t' , dotchar_T__B6x9)
, ('U' , dotchar_U__B6x9)
, ('u' , dotchar_U__B6x9)
, ('V' , dotchar_V__B6x9)
, ('v' , dotchar_V__B6x9)
, ('W' , dotchar_W__B6x9)
, ('w' , dotchar_W__B6x9)
, ('X' , dotchar_X__B6x9)
, ('x' , dotchar_X__B6x9)
, ('Y' , dotchar_Y__B6x9)
, ('y' , dotchar_Y__B6x9)
, ('Z' , dotchar_Z__B6x9)
, ('z' , dotchar_Z__B6x9)
, ('\0' , dotchar_Unmapped_B6x9) -- Only mapping that unconditionally has to be present.
])
dotchar_Hash_B6x9 :: Dotchar
dotchar_Hash_B6x9 = Dotchar
[" "
," # # "
," # # "
,"##### "
," # # "
,"##### "
," # # "
," # # "
," "]
dotchar_Blank_B6x9 :: Dotchar
dotchar_Blank_B6x9 = Dotchar
[" "
," "
," "
," "
," "
," "
," "
," "
," "]
dotchar_Colon_B6x9 :: Dotchar
dotchar_Colon_B6x9 = Dotchar
[" "
," "
," "
," :: "
," :: "
," "
," :: "
," :: "
," "]
dotchar_Comma_B6x9 :: Dotchar
dotchar_Comma_B6x9 = Dotchar
[" "
," "
," "
," "
," "
," ,, "
," ,, "
," ,, "
," ,, "]
dotchar_Semicolon_B6x9 :: Dotchar
dotchar_Semicolon_B6x9 = Dotchar
[" "
," "
," "
," ;; "
," "
," ;; "
," ;; "
," ;; "
," ;; "]
dotchar_Point_B6x9 :: Dotchar
dotchar_Point_B6x9 = Dotchar
[" "
," "
," "
," "
," "
," "
," .. "
," .. "
," "]
dotchar_Plus_B6x9 :: Dotchar
dotchar_Plus_B6x9 = Dotchar
[" "
," "
," + "
," + "
,"+++++ "
," + "
," + "
," "
," "]
dotchar_Minus_B6x9 :: Dotchar
dotchar_Minus_B6x9 = Dotchar
[" "
," "
," "
," "
,"----- "
," "
," "
," "
," "]
dotchar_Equals_B6x9 :: Dotchar
dotchar_Equals_B6x9 = Dotchar
[" "
," "
," "
,"===== "
," "
,"===== "
," "
," "
," "]
dotchar_Underscore_B6x9 :: Dotchar
dotchar_Underscore_B6x9 = Dotchar
[" "
," "
," "
," "
," "
," "
," "
," "
,"_____ "]
dotchar_Exclamation_B6x9 :: Dotchar
dotchar_Exclamation_B6x9 = Dotchar
[" "
," ! "
," ! "
," ! "
," ! "
," ! "
," "
," ! "
," "]
dotchar_0__B6x9 :: Dotchar
dotchar_0__B6x9 = Dotchar
[" "
," 000 "
,"0 0 "
,"00 0 "
,"0 0 0 "
,"0 00 "
,"0 0 "
," 000 "
," "]
dotchar_1__B6x9 :: Dotchar
dotchar_1__B6x9 = Dotchar
[" "
," 1 "
," 11 "
,"1 1 "
," 1 "
," 1 "
," 1 "
,"1111 "
," "]
dotchar_2__B6x9 :: Dotchar
dotchar_2__B6x9 = Dotchar
[" "
," 222 "
,"2 2 "
," 2 "
," 2 "
," 2 "
," 2 "
,"22222 "
," "]
dotchar_3__B6x9 :: Dotchar
dotchar_3__B6x9 = Dotchar
[" "
,"33333 "
," 3 "
," 3 "
," 333 "
," 3 "
," 3 "
,"3333 "
," "]
dotchar_4__B6x9 :: Dotchar
dotchar_4__B6x9 = Dotchar
[" "
," 44 "
," 4 4 "
," 4 4 "
,"44444 "
," 4 "
," 4 "
," 4 "
," "]
dotchar_5__B6x9 :: Dotchar
dotchar_5__B6x9 = Dotchar
[" "
,"55555 "
,"5 "
,"5 "
,"5555 "
," 5 "
,"5 5 "
," 555 "
," "]
dotchar_6__B6x9 :: Dotchar
dotchar_6__B6x9 = Dotchar
[" "
," 666 "
,"6 "
,"6 "
,"6666 "
,"6 6 "
,"6 6 "
," 666 "
," "]
dotchar_7__B6x9 :: Dotchar
dotchar_7__B6x9 = Dotchar
[" "
,"77777 "
," 7 "
," 7 "
," 7 "
," 7 "
," 7 "
," 7 "
," "]
dotchar_8__B6x9 :: Dotchar
dotchar_8__B6x9 = Dotchar
[" "
," 888 "
,"8 8 "
,"8 8 "
," 888 "
,"8 8 "
,"8 8 "
," 888 "
," "]
dotchar_9__B6x9 :: Dotchar
dotchar_9__B6x9 = Dotchar
[" "
," 999 "
,"9 9 "
,"9 9 "
," 9999 "
," 9 "
," 9 "
," 999 "
," "]
dotchar_A__B6x9 :: Dotchar
dotchar_A__B6x9 = Dotchar
[" "
," AAA "
,"A A "
,"A A "
,"AAAAA "
,"A A "
,"A A "
,"A A "
," "]
{-
dotchar_AE_B6x9 :: Dotchar
dotchar_AE_B6x9 = Dotchar
[" Ä Ä "
," "
," ÄÄÄ "
,"Ä Ä "
,"Ä Ä "
,"ÄÄÄÄÄ "
,"Ä Ä "
,"Ä Ä "
," "]
-}
dotchar_B__B6x9 :: Dotchar
dotchar_B__B6x9 = Dotchar
[" "
,"BBBB "
," B B "
," B B "
," BBB "
," B B "
," B B "
,"BBBB "
," "]
dotchar_C__B6x9 :: Dotchar
dotchar_C__B6x9 = Dotchar
[" "
," CCC "
,"C C "
,"C "
,"C "
,"C "
,"C C "
," CCC "
," "]
dotchar_D__B6x9 :: Dotchar
dotchar_D__B6x9 = Dotchar
[" "
,"DDDD "
," D C "
," D D "
," D D "
," D D "
," D D "
,"DDDD "
," "]
dotchar_E__B6x9 :: Dotchar
dotchar_E__B6x9 = Dotchar
[" "
,"EEEEE "
,"E "
,"E "
,"EEEE "
,"E "
,"E "
,"EEEEE "
," "]
dotchar_F__B6x9 :: Dotchar
dotchar_F__B6x9 = Dotchar
[" "
,"FFFFF "
,"F "
,"F "
,"FFFF "
,"F "
,"F "
,"F "
," "]
dotchar_G__B6x9 :: Dotchar
dotchar_G__B6x9 = Dotchar
[" "
," GGGG "
,"G "
,"G "
,"G 66G "
,"G G "
,"G G "
," GGG "
," "]
dotchar_H__B6x9 :: Dotchar
dotchar_H__B6x9 = Dotchar
[" "
,"H H "
,"H H "
,"H H "
,"HHHHH "
,"H H "
,"H H "
,"H H "
," "]
dotchar_I__B6x9 :: Dotchar
dotchar_I__B6x9 = Dotchar
[" "
," III "
," I "
," I "
," I "
," I "
," I "
," III "
," "]
dotchar_J__B6x9 :: Dotchar
dotchar_J__B6x9 = Dotchar
[" "
," JJJ "
," J "
," J "
," J "
," J "
,"J J "
," JJ "
," "]
dotchar_K__B6x9 :: Dotchar
dotchar_K__B6x9 = Dotchar
[" "
,"K K "
,"K K "
,"K K "
,"KK "
,"K K "
,"K K "
,"K K "
," "]
dotchar_L__B6x9 :: Dotchar
dotchar_L__B6x9 = Dotchar
[" "
,"L "
,"L "
,"L "
,"L "
,"L "
,"L "
,"LLLLL "
," "]
dotchar_M__B6x9 :: Dotchar
dotchar_M__B6x9 = Dotchar
[" "
,"M M "
,"MM MM "
,"MM MM "
,"W M M "
,"M M "
,"M M "
,"M M "
," "]
dotchar_N__B6x9 :: Dotchar
dotchar_N__B6x9 = Dotchar
[" "
,"N N "
,"N N "
,"NN N "
,"N N N "
,"N NN "
,"N NN "
,"N N "
," "]
dotchar_O__B6x9 :: Dotchar
dotchar_O__B6x9 = Dotchar
[" "
," OOO "
,"O O "
,"O O "
,"O O "
,"O O "
,"O O "
," OOO "
," "]
{-
dotchar_OE_B6x9 :: Dotchar
dotchar_OE_B6x9 = Dotchar
[" Ö Ö "
," "
," ÖÖÖ "
,"Ö Ö "
,"Ö Ö "
,"Ö Ö "
,"Ö Ö "
," ÖÖÖ "
," "]
-}
dotchar_P__B6x9 :: Dotchar
dotchar_P__B6x9 = Dotchar
[" "
,"PPPP "
,"P P "
,"P P "
,"PPPP "
,"P "
,"P "
,"P "
," "]
dotchar_Q__B6x9 :: Dotchar
dotchar_Q__B6x9 = Dotchar
[" "
," QQQ "
,"Q Q "
,"Q Q "
,"Q Q "
,"Q Q Q "
,"Q QQ "
," QQQQ "
," Q"]
dotchar_R__B6x9 :: Dotchar
dotchar_R__B6x9 = Dotchar
[" "
,"RRRR "
,"R R "
,"R R "
,"RRRR "
,"R R "
,"R R "
,"R R "
," "]
dotchar_S__B6x9 :: Dotchar
dotchar_S__B6x9 = Dotchar
[" "
," SSS "
,"S S "
,"S "
," SSS "
," S "
,"S S "
," SSS "
," "]
dotchar_T__B6x9 :: Dotchar
dotchar_T__B6x9 = Dotchar
[" "
,"TTTTT "
," T "
," T "
," T "
," T "
," T "
," T "
," "]
dotchar_U__B6x9 :: Dotchar
dotchar_U__B6x9 = Dotchar
[" "
,"U U "
,"U U "
,"U U "
,"U U "
,"U U "
,"U U "
," UUU "
," "]
{-
dotchar_UE_B6x9 :: Dotchar
dotchar_UE_B6x9 = Dotchar
[" Ü Ü "
," "
,"Ü Ü "
,"Ü Ü "
,"Ü Ü "
,"Ü Ü "
,"Ü Ü "
," ÜÜÜ "
," "]
-}
dotchar_V__B6x9 :: Dotchar
dotchar_V__B6x9 = Dotchar
[" "
,"V V "
,"V V "
,"V V "
,"V V "
," V V "
," V V "
," V "
," "]
dotchar_W__B6x9 :: Dotchar
dotchar_W__B6x9 = Dotchar
[" "
,"W W "
,"W W "
,"W W "
,"W W W "
,"W W W "
,"WW WW "
,"W W "
," "]
dotchar_X__B6x9 :: Dotchar
dotchar_X__B6x9 = Dotchar
[" "
,"X X "
,"X X "
," X X "
," X "
," X X "
,"X X "
,"X X "
," "]
dotchar_Y__B6x9 :: Dotchar
dotchar_Y__B6x9 = Dotchar
[" "
,"Y Y "
,"Y Y "
," Y Y "
," Y "
," Y "
," Y "
," Y "
," "]
dotchar_Z__B6x9 :: Dotchar
dotchar_Z__B6x9 = Dotchar
[" "
,"ZZZZZ "
," Z "
," Z "
," Z "
," Z "
,"Z "
,"ZZZZZ "
," "]
dotchar_Unmapped_B6x9 :: Dotchar
dotchar_Unmapped_B6x9 = Dotchar
[" "
,"+ + + "
," + + "
,"+ + + "
," + + "
,"+ + + "
," + + "
,"+ + + "
," "]
--
----
--
|
wherkendell/diagrams-contrib
|
src/Diagrams/Swimunit/Dotmatrix.hs
|
bsd-3-clause
| 23,603
| 0
| 13
| 13,379
| 3,170
| 1,967
| 1,203
| 660
| 4
|
--------------------------------------------------------------------------------
-- | Exports a datastructure for the top-level hakyll configuration
module Hakyll.Core.Configuration
( Configuration (..)
, shouldIgnoreFile
, defaultConfiguration
) where
--------------------------------------------------------------------------------
import Data.List (isPrefixOf, isSuffixOf)
import System.FilePath (normalise, takeFileName)
--------------------------------------------------------------------------------
data Configuration = Configuration
{ -- | Directory in which the output written
destinationDirectory :: FilePath
, -- | Directory where hakyll's internal store is kept
storeDirectory :: FilePath
, -- | Directory in which some temporary files will be kept
tmpDirectory :: FilePath
, -- | Directory where hakyll finds the files to compile. This is @.@ by
-- default.
providerDirectory :: FilePath
, -- | Function to determine ignored files
--
-- In 'defaultConfiguration', the following files are ignored:
--
-- * files starting with a @.@
--
-- * files starting with a @#@
--
-- * files ending with a @~@
--
-- * files ending with @.swp@
--
-- Note that the files in 'destinationDirectory' and 'storeDirectory' will
-- also be ignored. Note that this is the configuration parameter, if you
-- want to use the test, you should use 'shouldIgnoreFile'.
--
ignoreFile :: FilePath -> Bool
, -- | Here, you can plug in a system command to upload/deploy your site.
--
-- Example:
--
-- > rsync -ave 'ssh -p 2217' _site jaspervdj@jaspervdj.be:hakyll
--
-- You can execute this by using
--
-- > ./site deploy
--
deployCommand :: String
, -- | Use an in-memory cache for items. This is faster but uses more
-- memory.
inMemoryCache :: Bool
}
--------------------------------------------------------------------------------
-- | Default configuration for a hakyll application
defaultConfiguration :: Configuration
defaultConfiguration = Configuration
{ destinationDirectory = "_site"
, storeDirectory = "_cache"
, tmpDirectory = "_cache/tmp"
, providerDirectory = "."
, ignoreFile = ignoreFile'
, deployCommand = "echo 'No deploy command specified'"
, inMemoryCache = True
}
where
ignoreFile' path
| "." `isPrefixOf` fileName = True
| "#" `isPrefixOf` fileName = True
| "~" `isSuffixOf` fileName = True
| ".swp" `isSuffixOf` fileName = True
| otherwise = False
where
fileName = takeFileName path
--------------------------------------------------------------------------------
-- | Check if a file should be ignored
shouldIgnoreFile :: Configuration -> FilePath -> Bool
shouldIgnoreFile conf path =
destinationDirectory conf `isPrefixOf` path' ||
storeDirectory conf `isPrefixOf` path' ||
tmpDirectory conf `isPrefixOf` path' ||
ignoreFile conf path'
where
path' = normalise path
|
bergmark/hakyll
|
src/Hakyll/Core/Configuration.hs
|
bsd-3-clause
| 3,284
| 0
| 11
| 888
| 361
| 226
| 135
| 37
| 1
|
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
module Control.Monad.Code.Typed
( module Control.Monad.Code.Class.Typed
, Typed.Label
, Typed.return
, CodeT
, runCodeT
) where
import Control.Applicative
import Control.Monad.Code.Class.Typed hiding (Label, return)
import qualified Control.Monad.Code.Class.Typed as Typed
import qualified Control.Monad.Code.Internal as Internal
import Control.Monad.Fix
import Control.Monad.Indexed hiding (Monad)
import qualified Control.Monad.Indexed as Indexed
newtype CodeT s m p q a = CodeT
{ unCodeT :: Internal.CodeT s m a
} deriving ( Functor
, Applicative
, Monad
, MonadFix
)
runCodeT = undefined
instance Monad m => Indexed.Monad (CodeT s m) where
returnM = CodeT . return
{-# INLINE returnM #-}
m `thenM` k = CodeT $ unCodeT m >>= unCodeT . k
{-# INLINE thenM #-}
failM = CodeT . fail
newtype Label q = Label Internal.Label
instance Monad m => MonadCode (CodeT s m) where
newtype ArrayType (CodeT s m) = ArrayType Internal.ArrayType
type Typed.Label (CodeT s m) = Label
|
sonyandy/tnt
|
Control/Monad/Code/Typed.hs
|
bsd-3-clause
| 1,292
| 0
| 9
| 414
| 305
| 184
| 121
| 31
| 1
|
{-# language CPP #-}
-- No documentation found for Chapter "StructureType"
module Vulkan.Core10.Enums.StructureType (StructureType( STRUCTURE_TYPE_APPLICATION_INFO
, STRUCTURE_TYPE_INSTANCE_CREATE_INFO
, STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
, STRUCTURE_TYPE_DEVICE_CREATE_INFO
, STRUCTURE_TYPE_SUBMIT_INFO
, STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
, STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
, STRUCTURE_TYPE_BIND_SPARSE_INFO
, STRUCTURE_TYPE_FENCE_CREATE_INFO
, STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
, STRUCTURE_TYPE_EVENT_CREATE_INFO
, STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
, STRUCTURE_TYPE_BUFFER_CREATE_INFO
, STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
, STRUCTURE_TYPE_IMAGE_CREATE_INFO
, STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
, STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
, STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
, STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
, STRUCTURE_TYPE_SAMPLER_CREATE_INFO
, STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
, STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
, STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
, STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
, STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
, STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
, STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
, STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
, STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
, STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
, STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
, STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
, STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
, STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
, STRUCTURE_TYPE_MEMORY_BARRIER
, STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO
, STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV
, STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT
, STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT
, STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT
, STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT
, STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV
, STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI
, STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI
, STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA
, STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA
, STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA
, STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA
, STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA
, STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA
, STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA
, STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA
, STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA
, STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA
, STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA
, STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA
, STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA
, STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA
, STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT
, STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT
, STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT
, STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE
, STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR
, STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV
, STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR
, STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV
, STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV
, STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR
, STRUCTURE_TYPE_PRESENT_ID_KHR
, STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT
, STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT
, STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT
, STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT
, STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM
, STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT
, STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV
, STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV
, STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV
, STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV
, STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV
, STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV
, STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT
, STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR
, STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR
, STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR
, STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR
, STRUCTURE_TYPE_PIPELINE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT
, STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT
, STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT
, STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT
, STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT
, STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV
, STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV
, STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR
, STRUCTURE_TYPE_VALIDATION_FEATURES_EXT
, STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV
, STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR
, STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR
, STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR
, STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR
, STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT
, STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT
, STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA
, STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD
, STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT
, STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL
, STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL
, STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL
, STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL
, STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL
, STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL
, STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV
, STRUCTURE_TYPE_CHECKPOINT_DATA_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV
, STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT
, STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT
, STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD
, STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR
, STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD
, STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT
, STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT
, STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT
, STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT
, STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT
, STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV
, STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV
, STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV
, STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV
, STRUCTURE_TYPE_GEOMETRY_AABB_NV
, STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV
, STRUCTURE_TYPE_GEOMETRY_NV
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV
, STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR
, STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT
, STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT
, STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT
, STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT
, STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT
, STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT
, STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV
, STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR
, STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR
, STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR
, STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR
, STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR
, STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR
, STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR
, STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR
, STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT
, STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT
, STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT
, STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT
, STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID
, STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID
, STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID
, STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID
, STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID
, STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID
, STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID
, STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT
, STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT
, STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT
, STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT
, STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT
, STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK
, STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK
, STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR
, STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR
, STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR
, STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR
, STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR
, STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR
, STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR
, STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR
, STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR
, STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR
, STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR
, STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR
, STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR
, STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR
, STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR
, STRUCTURE_TYPE_HDR_METADATA_EXT
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT
, STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX
, STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE
, STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT
, STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT
, STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT
, STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT
, STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT
, STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV
, STRUCTURE_TYPE_PRESENT_REGIONS_KHR
, STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT
, STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR
, STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR
, STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR
, STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR
, STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR
, STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR
, STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR
, STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR
, STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR
, STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT
, STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT
, STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN
, STRUCTURE_TYPE_VALIDATION_FLAGS_EXT
, STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR
, STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR
, STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR
, STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR
, STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR
, STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR
, STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV
, STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV
, STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV
, STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV
, STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV
, STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV
, STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP
, STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX
, STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD
, STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT
, STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR
, STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD
, STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX
, STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX
, STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX
, STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX
, STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT
, STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV
, STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV
, STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV
, STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT
, STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT
, STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT
, STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD
, STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT
, STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR
, STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR
, STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR
, STRUCTURE_TYPE_PRESENT_INFO_KHR
, STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR
, STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS
, STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES
, STRUCTURE_TYPE_FORMAT_PROPERTIES_3
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES
, STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES
, STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO
, STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO
, STRUCTURE_TYPE_RENDERING_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES
, STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO
, STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK
, STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES
, STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES
, STRUCTURE_TYPE_IMAGE_RESOLVE_2
, STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2
, STRUCTURE_TYPE_IMAGE_BLIT_2
, STRUCTURE_TYPE_IMAGE_COPY_2
, STRUCTURE_TYPE_BUFFER_COPY_2
, STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2
, STRUCTURE_TYPE_BLIT_IMAGE_INFO_2
, STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2
, STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2
, STRUCTURE_TYPE_COPY_IMAGE_INFO_2
, STRUCTURE_TYPE_COPY_BUFFER_INFO_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES
, STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO
, STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO
, STRUCTURE_TYPE_SUBMIT_INFO_2
, STRUCTURE_TYPE_DEPENDENCY_INFO
, STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2
, STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2
, STRUCTURE_TYPE_MEMORY_BARRIER_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES
, STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO
, STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES
, STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES
, STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO
, STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO
, STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO
, STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES
, STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO
, STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO
, STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO
, STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES
, STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT
, STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES
, STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO
, STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO
, STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES
, STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES
, STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES
, STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES
, STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT
, STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES
, STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES
, STRUCTURE_TYPE_SUBPASS_END_INFO
, STRUCTURE_TYPE_SUBPASS_BEGIN_INFO
, STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2
, STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2
, STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2
, STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2
, STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2
, STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES
, STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES
, STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO
, STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO
, STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO
, STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO
, STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO
, STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO
, STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES
, STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO
, STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO
, STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO
, STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES
, STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO
, STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO
, STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO
, STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO
, STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES
, STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES
, STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO
, STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO
, STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO
, STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2
, STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2
, STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2
, STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2
, STRUCTURE_TYPE_FORMAT_PROPERTIES_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2
, STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2
, STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2
, STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2
, STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2
, STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2
, STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2
, STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES
, STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO
, STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO
, STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO
, STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO
, STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO
, STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO
, STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO
, STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO
, STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS
, STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES
, STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO
, STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO
, STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES
, ..
)) where
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import GHC.Show (showsPrec)
import Vulkan.Zero (Zero)
import Foreign.Storable (Storable)
import Data.Int (Int32)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
-- | VkStructureType - Vulkan structure types (@sType@)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>,
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureBuildGeometryInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureBuildSizesInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureCreateInfoKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureCreateInfoNV',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureDeviceAddressInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureGeometryAabbsDataKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureGeometryInstancesDataKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureGeometryKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing_motion_blur.AccelerationStructureGeometryMotionTrianglesDataNV',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureGeometryTrianglesDataKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureInfoNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.AccelerationStructureMemoryRequirementsInfoNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing_motion_blur.AccelerationStructureMotionInfoNV',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.AccelerationStructureVersionInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.AcquireNextImageInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_performance_query.AcquireProfilingLockInfoKHR',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.AndroidHardwareBufferFormatProperties2ANDROID',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.AndroidHardwareBufferFormatPropertiesANDROID',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.AndroidHardwareBufferPropertiesANDROID',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.AndroidHardwareBufferUsageANDROID',
-- 'Vulkan.Extensions.VK_KHR_android_surface.AndroidSurfaceCreateInfoKHR',
-- 'Vulkan.Core10.DeviceInitialization.ApplicationInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentDescription2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentReference2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout',
-- 'Vulkan.Extensions.VK_KHR_dynamic_rendering.AttachmentSampleCountInfoAMD',
-- 'Vulkan.CStruct.Extends.BaseInStructure',
-- 'Vulkan.CStruct.Extends.BaseOutStructure',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.BindAccelerationStructureMemoryInfoNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_groupAndVK_KHR_bind_memory2.BindBufferMemoryDeviceGroupInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindBufferMemoryInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_groupAndVK_KHR_bind_memory2.BindImageMemoryDeviceGroupInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_bind_memory2.BindImageMemoryInfo',
-- 'Vulkan.Extensions.VK_KHR_swapchain.BindImageMemorySwapchainInfoKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.BindImagePlaneMemoryInfo',
-- 'Vulkan.Core10.SparseResourceMemoryManagement.BindSparseInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.BlitImageInfo2',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferCollectionBufferCreateInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferCollectionConstraintsInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferCollectionCreateInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferCollectionImageCreateInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferCollectionPropertiesFUCHSIA',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.BufferConstraintsInfoFUCHSIA',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.BufferCopy2',
-- 'Vulkan.Core10.Buffer.BufferCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_buffer_device_address.BufferDeviceAddressCreateInfoEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.BufferDeviceAddressInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.BufferImageCopy2',
-- 'Vulkan.Core10.OtherTypes.BufferMemoryBarrier',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.BufferMemoryBarrier2',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.BufferMemoryRequirementsInfo2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.BufferOpaqueCaptureAddressCreateInfo',
-- 'Vulkan.Core10.BufferView.BufferViewCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_calibrated_timestamps.CalibratedTimestampInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_synchronization2.CheckpointData2NV',
-- 'Vulkan.Extensions.VK_NV_device_diagnostic_checkpoints.CheckpointDataNV',
-- 'Vulkan.Core10.CommandBuffer.CommandBufferAllocateInfo',
-- 'Vulkan.Core10.CommandBuffer.CommandBufferBeginInfo',
-- 'Vulkan.Extensions.VK_EXT_conditional_rendering.CommandBufferInheritanceConditionalRenderingInfoEXT',
-- 'Vulkan.Core10.CommandBuffer.CommandBufferInheritanceInfo',
-- 'Vulkan.Extensions.VK_QCOM_render_pass_transform.CommandBufferInheritanceRenderPassTransformInfoQCOM',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.CommandBufferInheritanceRenderingInfo',
-- 'Vulkan.Extensions.VK_NV_inherited_viewport_scissor.CommandBufferInheritanceViewportScissorInfoNV',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.CommandBufferSubmitInfo',
-- 'Vulkan.Core10.CommandPool.CommandPoolCreateInfo',
-- 'Vulkan.Core10.Pipeline.ComputePipelineCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_conditional_rendering.ConditionalRenderingBeginInfoEXT',
-- 'Vulkan.Extensions.VK_NV_cooperative_matrix.CooperativeMatrixPropertiesNV',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyAccelerationStructureToMemoryInfoKHR',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.CopyBufferInfo2',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.CopyBufferToImageInfo2',
-- 'Vulkan.Extensions.VK_QCOM_rotated_copy_commands.CopyCommandTransformInfoQCOM',
-- 'Vulkan.Core10.DescriptorSet.CopyDescriptorSet',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.CopyImageInfo2',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.CopyImageToBufferInfo2',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.CopyMemoryToAccelerationStructureInfoKHR',
-- 'Vulkan.Extensions.VK_NVX_binary_import.CuFunctionCreateInfoNVX',
-- 'Vulkan.Extensions.VK_NVX_binary_import.CuLaunchInfoNVX',
-- 'Vulkan.Extensions.VK_NVX_binary_import.CuModuleCreateInfoNVX',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_win32.D3D12FenceSubmitInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_debug_marker.DebugMarkerMarkerInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_marker.DebugMarkerObjectNameInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_marker.DebugMarkerObjectTagInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_report.DebugReportCallbackCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_utils.DebugUtilsLabelEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_utils.DebugUtilsMessengerCallbackDataEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_utils.DebugUtilsMessengerCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_utils.DebugUtilsObjectNameInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_debug_utils.DebugUtilsObjectTagInfoEXT',
-- 'Vulkan.Extensions.VK_NV_dedicated_allocation.DedicatedAllocationBufferCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_dedicated_allocation.DedicatedAllocationImageCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_dedicated_allocation.DedicatedAllocationMemoryAllocateInfoNV',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.DependencyInfo',
-- 'Vulkan.Core10.DescriptorSet.DescriptorPoolCreateInfo',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_inline_uniform_block.DescriptorPoolInlineUniformBlockCreateInfo',
-- 'Vulkan.Core10.DescriptorSet.DescriptorSetAllocateInfo',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_descriptor_indexing.DescriptorSetLayoutBindingFlagsCreateInfo',
-- 'Vulkan.Core10.DescriptorSet.DescriptorSetLayoutCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance3.DescriptorSetLayoutSupport',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_descriptor_indexing.DescriptorSetVariableDescriptorCountAllocateInfo',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_descriptor_indexing.DescriptorSetVariableDescriptorCountLayoutSupport',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_descriptor_update_template.DescriptorUpdateTemplateCreateInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_maintenance4.DeviceBufferMemoryRequirements',
-- 'Vulkan.Core10.Device.DeviceCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_device_memory_report.DeviceDeviceMemoryReportCreateInfoEXT',
-- 'Vulkan.Extensions.VK_NV_device_diagnostics_config.DeviceDiagnosticsConfigCreateInfoNV',
-- 'Vulkan.Extensions.VK_EXT_display_control.DeviceEventInfoEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group.DeviceGroupBindSparseInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group.DeviceGroupCommandBufferBeginInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group_creation.DeviceGroupDeviceCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_swapchain.DeviceGroupPresentCapabilitiesKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.DeviceGroupPresentInfoKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group.DeviceGroupRenderPassBeginInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group.DeviceGroupSubmitInfo',
-- 'Vulkan.Extensions.VK_KHR_swapchain.DeviceGroupSwapchainCreateInfoKHR',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_maintenance4.DeviceImageMemoryRequirements',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.DeviceMemoryOpaqueCaptureAddressInfo',
-- 'Vulkan.Extensions.VK_AMD_memory_overallocation_behavior.DeviceMemoryOverallocationCreateInfoAMD',
-- 'Vulkan.Extensions.VK_EXT_device_memory_report.DeviceMemoryReportCallbackDataEXT',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_private_data.DevicePrivateDataCreateInfo',
-- 'Vulkan.Core10.Device.DeviceQueueCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_global_priority.DeviceQueueGlobalPriorityCreateInfoKHR',
-- 'Vulkan.Core11.Originally_Based_On_VK_KHR_protected_memory.DeviceQueueInfo2',
-- 'Vulkan.Extensions.VK_EXT_directfb_surface.DirectFBSurfaceCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_display_control.DisplayEventInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_display.DisplayModeCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_get_display_properties2.DisplayModeProperties2KHR',
-- 'Vulkan.Extensions.VK_AMD_display_native_hdr.DisplayNativeHdrSurfaceCapabilitiesAMD',
-- 'Vulkan.Extensions.VK_KHR_get_display_properties2.DisplayPlaneCapabilities2KHR',
-- 'Vulkan.Extensions.VK_KHR_get_display_properties2.DisplayPlaneInfo2KHR',
-- 'Vulkan.Extensions.VK_KHR_get_display_properties2.DisplayPlaneProperties2KHR',
-- 'Vulkan.Extensions.VK_EXT_display_control.DisplayPowerInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_display_swapchain.DisplayPresentInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_get_display_properties2.DisplayProperties2KHR',
-- 'Vulkan.Extensions.VK_KHR_display.DisplaySurfaceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.DrmFormatModifierPropertiesList2EXT',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.DrmFormatModifierPropertiesListEXT',
-- 'Vulkan.Core10.Event.EventCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_fence.ExportFenceCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_external_fence_win32.ExportFenceWin32HandleInfoKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory.ExportMemoryAllocateInfo',
-- 'Vulkan.Extensions.VK_NV_external_memory.ExportMemoryAllocateInfoNV',
-- 'Vulkan.Extensions.VK_KHR_external_memory_win32.ExportMemoryWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_NV_external_memory_win32.ExportMemoryWin32HandleInfoNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_semaphore.ExportSemaphoreCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_win32.ExportSemaphoreWin32HandleInfoKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalBufferProperties',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_fence_capabilities.ExternalFenceProperties',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.ExternalImageFormatProperties',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory.ExternalMemoryBufferCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory.ExternalMemoryImageCreateInfo',
-- 'Vulkan.Extensions.VK_NV_external_memory.ExternalMemoryImageCreateInfoNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_semaphore_capabilities.ExternalSemaphoreProperties',
-- 'Vulkan.Core10.Fence.FenceCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_external_fence_fd.FenceGetFdInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_external_fence_win32.FenceGetWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_filter_cubic.FilterCubicImageViewImageFormatPropertiesEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.FormatProperties2',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_format_feature_flags2.FormatProperties3',
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_imageless_framebuffer.FramebufferAttachmentImageInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_imageless_framebuffer.FramebufferAttachmentsCreateInfo',
-- 'Vulkan.Core10.Pass.FramebufferCreateInfo',
-- 'Vulkan.Extensions.VK_NV_coverage_reduction_mode.FramebufferMixedSamplesCombinationNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.GeneratedCommandsInfoNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.GeneratedCommandsMemoryRequirementsInfoNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.GeometryAABBNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.GeometryNV',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.GeometryTrianglesNV',
-- 'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.GraphicsPipelineShaderGroupsCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.GraphicsShaderGroupCreateInfoNV',
-- 'Vulkan.Extensions.VK_EXT_hdr_metadata.HdrMetadataEXT',
-- 'Vulkan.Extensions.VK_EXT_headless_surface.HeadlessSurfaceCreateInfoEXT',
-- 'Vulkan.Extensions.VK_MVK_ios_surface.IOSSurfaceCreateInfoMVK',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.ImageBlit2',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.ImageConstraintsInfoFUCHSIA',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.ImageCopy2',
-- 'Vulkan.Core10.Image.ImageCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierExplicitCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierListCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierPropertiesEXT',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.ImageFormatConstraintsInfoFUCHSIA',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_image_format_list.ImageFormatListCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.ImageFormatProperties2',
-- 'Vulkan.Core10.OtherTypes.ImageMemoryBarrier',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.ImageMemoryBarrier2',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.ImageMemoryRequirementsInfo2',
-- 'Vulkan.Extensions.VK_FUCHSIA_imagepipe_surface.ImagePipeSurfaceCreateInfoFUCHSIA',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.ImagePlaneMemoryRequirementsInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.ImageResolve2',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.ImageSparseMemoryRequirementsInfo2',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_separate_stencil_usage.ImageStencilUsageCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_swapchain.ImageSwapchainCreateInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_astc_decode_mode.ImageViewASTCDecodeModeEXT',
-- 'Vulkan.Extensions.VK_NVX_image_view_handle.ImageViewAddressPropertiesNVX',
-- 'Vulkan.Core10.ImageView.ImageViewCreateInfo',
-- 'Vulkan.Extensions.VK_NVX_image_view_handle.ImageViewHandleInfoNVX',
-- 'Vulkan.Extensions.VK_EXT_image_view_min_lod.ImageViewMinLodCreateInfoEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance2.ImageViewUsageCreateInfo',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ImportAndroidHardwareBufferInfoANDROID',
-- 'Vulkan.Extensions.VK_KHR_external_fence_fd.ImportFenceFdInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_external_fence_win32.ImportFenceWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.ImportMemoryBufferCollectionFUCHSIA',
-- 'Vulkan.Extensions.VK_KHR_external_memory_fd.ImportMemoryFdInfoKHR',
-- 'Vulkan.Extensions.VK_EXT_external_memory_host.ImportMemoryHostPointerInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_external_memory_win32.ImportMemoryWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_NV_external_memory_win32.ImportMemoryWin32HandleInfoNV',
-- 'Vulkan.Extensions.VK_FUCHSIA_external_memory.ImportMemoryZirconHandleInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_fd.ImportSemaphoreFdInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_win32.ImportSemaphoreWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_FUCHSIA_external_semaphore.ImportSemaphoreZirconHandleInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.IndirectCommandsLayoutCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.IndirectCommandsLayoutTokenNV',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.InitializePerformanceApiInfoINTEL',
-- 'Vulkan.Core10.DeviceInitialization.InstanceCreateInfo',
-- 'Vulkan.Extensions.VK_MVK_macos_surface.MacOSSurfaceCreateInfoMVK',
-- 'Vulkan.Core10.Memory.MappedMemoryRange',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group.MemoryAllocateFlagsInfo',
-- 'Vulkan.Core10.Memory.MemoryAllocateInfo',
-- 'Vulkan.Core10.OtherTypes.MemoryBarrier',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.MemoryBarrier2',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedRequirements',
-- 'Vulkan.Extensions.VK_KHR_external_memory_fd.MemoryFdPropertiesKHR',
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.MemoryGetAndroidHardwareBufferInfoANDROID',
-- 'Vulkan.Extensions.VK_KHR_external_memory_fd.MemoryGetFdInfoKHR',
-- 'Vulkan.Extensions.VK_NV_external_memory_rdma.MemoryGetRemoteAddressInfoNV',
-- 'Vulkan.Extensions.VK_KHR_external_memory_win32.MemoryGetWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_FUCHSIA_external_memory.MemoryGetZirconHandleInfoFUCHSIA',
-- 'Vulkan.Extensions.VK_EXT_external_memory_host.MemoryHostPointerPropertiesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.MemoryOpaqueCaptureAddressAllocateInfo',
-- 'Vulkan.Extensions.VK_EXT_memory_priority.MemoryPriorityAllocateInfoEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.MemoryRequirements2',
-- 'Vulkan.Extensions.VK_KHR_external_memory_win32.MemoryWin32HandlePropertiesKHR',
-- 'Vulkan.Extensions.VK_FUCHSIA_external_memory.MemoryZirconHandlePropertiesFUCHSIA',
-- 'Vulkan.Extensions.VK_EXT_metal_surface.MetalSurfaceCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.MultisamplePropertiesEXT',
-- 'Vulkan.Extensions.VK_KHR_dynamic_rendering.MultiviewPerViewAttributesInfoNVX',
-- 'Vulkan.Extensions.VK_VALVE_mutable_descriptor_type.MutableDescriptorTypeCreateInfoVALVE',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.PerformanceConfigurationAcquireInfoINTEL',
-- 'Vulkan.Extensions.VK_KHR_performance_query.PerformanceCounterDescriptionKHR',
-- 'Vulkan.Extensions.VK_KHR_performance_query.PerformanceCounterKHR',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.PerformanceMarkerInfoINTEL',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.PerformanceOverrideInfoINTEL',
-- 'Vulkan.Extensions.VK_KHR_performance_query.PerformanceQuerySubmitInfoKHR',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.PerformanceStreamMarkerInfoINTEL',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_16bit_storage.PhysicalDevice16BitStorageFeatures',
-- 'Vulkan.Extensions.VK_EXT_4444_formats.PhysicalDevice4444FormatsFeaturesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_8bit_storage.PhysicalDevice8BitStorageFeatures',
-- 'Vulkan.Extensions.VK_EXT_astc_decode_mode.PhysicalDeviceASTCDecodeFeaturesEXT',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.PhysicalDeviceAccelerationStructureFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.PhysicalDeviceAccelerationStructurePropertiesKHR',
-- 'Vulkan.Extensions.VK_EXT_blend_operation_advanced.PhysicalDeviceBlendOperationAdvancedFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_blend_operation_advanced.PhysicalDeviceBlendOperationAdvancedPropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_border_color_swizzle.PhysicalDeviceBorderColorSwizzleFeaturesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_buffer_device_address.PhysicalDeviceBufferDeviceAddressFeatures',
-- 'Vulkan.Extensions.VK_EXT_buffer_device_address.PhysicalDeviceBufferDeviceAddressFeaturesEXT',
-- 'Vulkan.Extensions.VK_AMD_device_coherent_memory.PhysicalDeviceCoherentMemoryFeaturesAMD',
-- 'Vulkan.Extensions.VK_EXT_color_write_enable.PhysicalDeviceColorWriteEnableFeaturesEXT',
-- 'Vulkan.Extensions.VK_NV_compute_shader_derivatives.PhysicalDeviceComputeShaderDerivativesFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_conditional_rendering.PhysicalDeviceConditionalRenderingFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_conservative_rasterization.PhysicalDeviceConservativeRasterizationPropertiesEXT',
-- 'Vulkan.Extensions.VK_NV_cooperative_matrix.PhysicalDeviceCooperativeMatrixFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_cooperative_matrix.PhysicalDeviceCooperativeMatrixPropertiesNV',
-- 'Vulkan.Extensions.VK_NV_corner_sampled_image.PhysicalDeviceCornerSampledImageFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_coverage_reduction_mode.PhysicalDeviceCoverageReductionModeFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_custom_border_color.PhysicalDeviceCustomBorderColorFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_custom_border_color.PhysicalDeviceCustomBorderColorPropertiesEXT',
-- 'Vulkan.Extensions.VK_NV_dedicated_allocation_image_aliasing.PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_depth_clip_control.PhysicalDeviceDepthClipControlFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_depth_clip_enable.PhysicalDeviceDepthClipEnableFeaturesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.PhysicalDeviceDepthStencilResolveProperties',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_descriptor_indexing.PhysicalDeviceDescriptorIndexingFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_descriptor_indexing.PhysicalDeviceDescriptorIndexingProperties',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.PhysicalDeviceDeviceGeneratedCommandsFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_device_generated_commands.PhysicalDeviceDeviceGeneratedCommandsPropertiesNV',
-- 'Vulkan.Extensions.VK_EXT_device_memory_report.PhysicalDeviceDeviceMemoryReportFeaturesEXT',
-- 'Vulkan.Extensions.VK_NV_device_diagnostics_config.PhysicalDeviceDiagnosticsConfigFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_discard_rectangles.PhysicalDeviceDiscardRectanglePropertiesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_driver_properties.PhysicalDeviceDriverProperties',
-- 'Vulkan.Extensions.VK_EXT_physical_device_drm.PhysicalDeviceDrmPropertiesEXT',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.PhysicalDeviceDynamicRenderingFeatures',
-- 'Vulkan.Extensions.VK_NV_scissor_exclusive.PhysicalDeviceExclusiveScissorFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_extended_dynamic_state2.PhysicalDeviceExtendedDynamicState2FeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_extended_dynamic_state.PhysicalDeviceExtendedDynamicStateFeaturesEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.PhysicalDeviceExternalBufferInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_fence_capabilities.PhysicalDeviceExternalFenceInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.PhysicalDeviceExternalImageFormatInfo',
-- 'Vulkan.Extensions.VK_EXT_external_memory_host.PhysicalDeviceExternalMemoryHostPropertiesEXT',
-- 'Vulkan.Extensions.VK_NV_external_memory_rdma.PhysicalDeviceExternalMemoryRDMAFeaturesNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_semaphore_capabilities.PhysicalDeviceExternalSemaphoreInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_shader_float_controls.PhysicalDeviceFloatControlsProperties',
-- 'Vulkan.Extensions.VK_EXT_fragment_density_map2.PhysicalDeviceFragmentDensityMap2FeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_fragment_density_map2.PhysicalDeviceFragmentDensityMap2PropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_fragment_density_map.PhysicalDeviceFragmentDensityMapFeaturesEXT',
-- 'Vulkan.Extensions.VK_QCOM_fragment_density_map_offset.PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM',
-- 'Vulkan.Extensions.VK_QCOM_fragment_density_map_offset.PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM',
-- 'Vulkan.Extensions.VK_EXT_fragment_density_map.PhysicalDeviceFragmentDensityMapPropertiesEXT',
-- 'Vulkan.Extensions.VK_NV_fragment_shader_barycentric.PhysicalDeviceFragmentShaderBarycentricFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_fragment_shader_interlock.PhysicalDeviceFragmentShaderInterlockFeaturesEXT',
-- 'Vulkan.Extensions.VK_NV_fragment_shading_rate_enums.PhysicalDeviceFragmentShadingRateEnumsFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_fragment_shading_rate_enums.PhysicalDeviceFragmentShadingRateEnumsPropertiesNV',
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.PhysicalDeviceFragmentShadingRateFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.PhysicalDeviceFragmentShadingRateKHR',
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.PhysicalDeviceFragmentShadingRatePropertiesKHR',
-- 'Vulkan.Extensions.VK_KHR_global_priority.PhysicalDeviceGlobalPriorityQueryFeaturesKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_device_group_creation.PhysicalDeviceGroupProperties',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_host_query_reset.PhysicalDeviceHostQueryResetFeatures',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_external_memory_capabilities.PhysicalDeviceIDProperties',
-- 'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.PhysicalDeviceImageDrmFormatModifierInfoEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceImageFormatInfo2',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_image_robustness.PhysicalDeviceImageRobustnessFeatures',
-- 'Vulkan.Extensions.VK_EXT_filter_cubic.PhysicalDeviceImageViewImageFormatInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_image_view_min_lod.PhysicalDeviceImageViewMinLodFeaturesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_imageless_framebuffer.PhysicalDeviceImagelessFramebufferFeatures',
-- 'Vulkan.Extensions.VK_EXT_index_type_uint8.PhysicalDeviceIndexTypeUint8FeaturesEXT',
-- 'Vulkan.Extensions.VK_NV_inherited_viewport_scissor.PhysicalDeviceInheritedViewportScissorFeaturesNV',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_inline_uniform_block.PhysicalDeviceInlineUniformBlockFeatures',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_inline_uniform_block.PhysicalDeviceInlineUniformBlockProperties',
-- 'Vulkan.Extensions.VK_HUAWEI_invocation_mask.PhysicalDeviceInvocationMaskFeaturesHUAWEI',
-- 'Vulkan.Extensions.VK_EXT_line_rasterization.PhysicalDeviceLineRasterizationFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_line_rasterization.PhysicalDeviceLineRasterizationPropertiesEXT',
-- 'Vulkan.Extensions.VK_NV_linear_color_attachment.PhysicalDeviceLinearColorAttachmentFeaturesNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance3.PhysicalDeviceMaintenance3Properties',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_maintenance4.PhysicalDeviceMaintenance4Features',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_maintenance4.PhysicalDeviceMaintenance4Properties',
-- 'Vulkan.Extensions.VK_EXT_memory_budget.PhysicalDeviceMemoryBudgetPropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_memory_priority.PhysicalDeviceMemoryPriorityFeaturesEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceMemoryProperties2',
-- 'Vulkan.Extensions.VK_NV_mesh_shader.PhysicalDeviceMeshShaderFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_mesh_shader.PhysicalDeviceMeshShaderPropertiesNV',
-- 'Vulkan.Extensions.VK_EXT_multi_draw.PhysicalDeviceMultiDrawFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_multi_draw.PhysicalDeviceMultiDrawPropertiesEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.PhysicalDeviceMultiviewFeatures',
-- 'Vulkan.Extensions.VK_NVX_multiview_per_view_attributes.PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.PhysicalDeviceMultiviewProperties',
-- 'Vulkan.Extensions.VK_VALVE_mutable_descriptor_type.PhysicalDeviceMutableDescriptorTypeFeaturesVALVE',
-- 'Vulkan.Extensions.VK_EXT_pci_bus_info.PhysicalDevicePCIBusInfoPropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_pageable_device_local_memory.PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT',
-- 'Vulkan.Extensions.VK_KHR_performance_query.PhysicalDevicePerformanceQueryFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_performance_query.PhysicalDevicePerformanceQueryPropertiesKHR',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_cache_control.PhysicalDevicePipelineCreationCacheControlFeatures',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PhysicalDevicePipelineExecutablePropertiesFeaturesKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance2.PhysicalDevicePointClippingProperties',
-- 'Vulkan.Extensions.VK_KHR_portability_subset.PhysicalDevicePortabilitySubsetFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_portability_subset.PhysicalDevicePortabilitySubsetPropertiesKHR',
-- 'Vulkan.Extensions.VK_KHR_present_id.PhysicalDevicePresentIdFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_present_wait.PhysicalDevicePresentWaitFeaturesKHR',
-- 'Vulkan.Extensions.VK_EXT_primitive_topology_list_restart.PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_private_data.PhysicalDevicePrivateDataFeatures',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2',
-- 'Vulkan.Core11.Originally_Based_On_VK_KHR_protected_memory.PhysicalDeviceProtectedMemoryFeatures',
-- 'Vulkan.Core11.Originally_Based_On_VK_KHR_protected_memory.PhysicalDeviceProtectedMemoryProperties',
-- 'Vulkan.Extensions.VK_EXT_provoking_vertex.PhysicalDeviceProvokingVertexFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_provoking_vertex.PhysicalDeviceProvokingVertexPropertiesEXT',
-- 'Vulkan.Extensions.VK_KHR_push_descriptor.PhysicalDevicePushDescriptorPropertiesKHR',
-- 'Vulkan.Extensions.VK_EXT_rgba10x6_formats.PhysicalDeviceRGBA10X6FormatsFeaturesEXT',
-- 'Vulkan.Extensions.VK_ARM_rasterization_order_attachment_access.PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM',
-- 'Vulkan.Extensions.VK_KHR_ray_query.PhysicalDeviceRayQueryFeaturesKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing_motion_blur.PhysicalDeviceRayTracingMotionBlurFeaturesNV',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.PhysicalDeviceRayTracingPipelineFeaturesKHR',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.PhysicalDeviceRayTracingPipelinePropertiesKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.PhysicalDeviceRayTracingPropertiesNV',
-- 'Vulkan.Extensions.VK_NV_representative_fragment_test.PhysicalDeviceRepresentativeFragmentTestFeaturesNV',
-- 'Vulkan.Extensions.VK_EXT_robustness2.PhysicalDeviceRobustness2FeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_robustness2.PhysicalDeviceRobustness2PropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.PhysicalDeviceSampleLocationsPropertiesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax.PhysicalDeviceSamplerFilterMinmaxProperties',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.PhysicalDeviceSamplerYcbcrConversionFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_scalar_block_layout.PhysicalDeviceScalarBlockLayoutFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.PhysicalDeviceSeparateDepthStencilLayoutsFeatures',
-- 'Vulkan.Extensions.VK_EXT_shader_atomic_float2.PhysicalDeviceShaderAtomicFloat2FeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_shader_atomic_float.PhysicalDeviceShaderAtomicFloatFeaturesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_shader_atomic_int64.PhysicalDeviceShaderAtomicInt64Features',
-- 'Vulkan.Extensions.VK_KHR_shader_clock.PhysicalDeviceShaderClockFeaturesKHR',
-- 'Vulkan.Extensions.VK_AMD_shader_core_properties2.PhysicalDeviceShaderCoreProperties2AMD',
-- 'Vulkan.Extensions.VK_AMD_shader_core_properties.PhysicalDeviceShaderCorePropertiesAMD',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_shader_demote_to_helper_invocation.PhysicalDeviceShaderDemoteToHelperInvocationFeatures',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_shader_draw_parameters.PhysicalDeviceShaderDrawParametersFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_shader_float16_int8.PhysicalDeviceShaderFloat16Int8Features',
-- 'Vulkan.Extensions.VK_EXT_shader_image_atomic_int64.PhysicalDeviceShaderImageAtomicInt64FeaturesEXT',
-- 'Vulkan.Extensions.VK_NV_shader_image_footprint.PhysicalDeviceShaderImageFootprintFeaturesNV',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_shader_integer_dot_product.PhysicalDeviceShaderIntegerDotProductFeatures',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_shader_integer_dot_product.PhysicalDeviceShaderIntegerDotProductProperties',
-- 'Vulkan.Extensions.VK_INTEL_shader_integer_functions2.PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL',
-- 'Vulkan.Extensions.VK_NV_shader_sm_builtins.PhysicalDeviceShaderSMBuiltinsFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_shader_sm_builtins.PhysicalDeviceShaderSMBuiltinsPropertiesNV',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_shader_subgroup_extended_types.PhysicalDeviceShaderSubgroupExtendedTypesFeatures',
-- 'Vulkan.Extensions.VK_KHR_shader_subgroup_uniform_control_flow.PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_shader_terminate_invocation.PhysicalDeviceShaderTerminateInvocationFeatures',
-- 'Vulkan.Extensions.VK_NV_shading_rate_image.PhysicalDeviceShadingRateImageFeaturesNV',
-- 'Vulkan.Extensions.VK_NV_shading_rate_image.PhysicalDeviceShadingRateImagePropertiesNV',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceSparseImageFormatInfo2',
-- 'Vulkan.Core11.Originally_Based_On_VK_KHR_subgroup.PhysicalDeviceSubgroupProperties',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_subgroup_size_control.PhysicalDeviceSubgroupSizeControlFeatures',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_subgroup_size_control.PhysicalDeviceSubgroupSizeControlProperties',
-- 'Vulkan.Extensions.VK_HUAWEI_subpass_shading.PhysicalDeviceSubpassShadingFeaturesHUAWEI',
-- 'Vulkan.Extensions.VK_HUAWEI_subpass_shading.PhysicalDeviceSubpassShadingPropertiesHUAWEI',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.PhysicalDeviceSurfaceInfo2KHR',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.PhysicalDeviceSynchronization2Features',
-- 'Vulkan.Extensions.VK_EXT_texel_buffer_alignment.PhysicalDeviceTexelBufferAlignmentFeaturesEXT',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_texel_buffer_alignment.PhysicalDeviceTexelBufferAlignmentProperties',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_texture_compression_astc_hdr.PhysicalDeviceTextureCompressionASTCHDRFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.PhysicalDeviceTimelineSemaphoreFeatures',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.PhysicalDeviceTimelineSemaphoreProperties',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_tooling_info.PhysicalDeviceToolProperties',
-- 'Vulkan.Extensions.VK_EXT_transform_feedback.PhysicalDeviceTransformFeedbackFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_transform_feedback.PhysicalDeviceTransformFeedbackPropertiesEXT',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_uniform_buffer_standard_layout.PhysicalDeviceUniformBufferStandardLayoutFeatures',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_variable_pointers.PhysicalDeviceVariablePointersFeatures',
-- 'Vulkan.Extensions.VK_EXT_vertex_attribute_divisor.PhysicalDeviceVertexAttributeDivisorFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_vertex_attribute_divisor.PhysicalDeviceVertexAttributeDivisorPropertiesEXT',
-- 'Vulkan.Extensions.VK_EXT_vertex_input_dynamic_state.PhysicalDeviceVertexInputDynamicStateFeaturesEXT',
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkPhysicalDeviceVideoFormatInfoKHR VkPhysicalDeviceVideoFormatInfoKHR>,
-- 'Vulkan.Core12.PhysicalDeviceVulkan11Features',
-- 'Vulkan.Core12.PhysicalDeviceVulkan11Properties',
-- 'Vulkan.Core12.PhysicalDeviceVulkan12Features',
-- 'Vulkan.Core12.PhysicalDeviceVulkan12Properties',
-- 'Vulkan.Core13.PhysicalDeviceVulkan13Features',
-- 'Vulkan.Core13.PhysicalDeviceVulkan13Properties',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_vulkan_memory_model.PhysicalDeviceVulkanMemoryModelFeatures',
-- 'Vulkan.Extensions.VK_KHR_workgroup_memory_explicit_layout.PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR',
-- 'Vulkan.Extensions.VK_EXT_ycbcr_2plane_444_formats.PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_ycbcr_image_arrays.PhysicalDeviceYcbcrImageArraysFeaturesEXT',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_zero_initialize_workgroup_memory.PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures',
-- 'Vulkan.Core10.PipelineCache.PipelineCacheCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_blend_operation_advanced.PipelineColorBlendAdvancedStateCreateInfoEXT',
-- 'Vulkan.Core10.Pipeline.PipelineColorBlendStateCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_color_write_enable.PipelineColorWriteCreateInfoEXT',
-- 'Vulkan.Extensions.VK_AMD_pipeline_compiler_control.PipelineCompilerControlCreateInfoAMD',
-- 'Vulkan.Extensions.VK_NV_framebuffer_mixed_samples.PipelineCoverageModulationStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_coverage_reduction_mode.PipelineCoverageReductionStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_fragment_coverage_to_color.PipelineCoverageToColorStateCreateInfoNV',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_pipeline_creation_feedback.PipelineCreationFeedbackCreateInfo',
-- 'Vulkan.Core10.Pipeline.PipelineDepthStencilStateCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_discard_rectangles.PipelineDiscardRectangleStateCreateInfoEXT',
-- 'Vulkan.Core10.Pipeline.PipelineDynamicStateCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PipelineExecutableInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PipelineExecutableInternalRepresentationKHR',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PipelineExecutablePropertiesKHR',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PipelineExecutableStatisticKHR',
-- 'Vulkan.Extensions.VK_NV_fragment_shading_rate_enums.PipelineFragmentShadingRateEnumStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.PipelineFragmentShadingRateStateCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_pipeline_executable_properties.PipelineInfoKHR',
-- 'Vulkan.Core10.Pipeline.PipelineInputAssemblyStateCreateInfo',
-- 'Vulkan.Core10.PipelineLayout.PipelineLayoutCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_pipeline_library.PipelineLibraryCreateInfoKHR',
-- 'Vulkan.Core10.Pipeline.PipelineMultisampleStateCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_conservative_rasterization.PipelineRasterizationConservativeStateCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_depth_clip_enable.PipelineRasterizationDepthClipStateCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_line_rasterization.PipelineRasterizationLineStateCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_provoking_vertex.PipelineRasterizationProvokingVertexStateCreateInfoEXT',
-- 'Vulkan.Core10.Pipeline.PipelineRasterizationStateCreateInfo',
-- 'Vulkan.Extensions.VK_AMD_rasterization_order.PipelineRasterizationStateRasterizationOrderAMD',
-- 'Vulkan.Extensions.VK_EXT_transform_feedback.PipelineRasterizationStateStreamCreateInfoEXT',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.PipelineRenderingCreateInfo',
-- 'Vulkan.Extensions.VK_NV_representative_fragment_test.PipelineRepresentativeFragmentTestStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.PipelineSampleLocationsStateCreateInfoEXT',
-- 'Vulkan.Core10.Pipeline.PipelineShaderStageCreateInfo',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_subgroup_size_control.PipelineShaderStageRequiredSubgroupSizeCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance2.PipelineTessellationDomainOriginStateCreateInfo',
-- 'Vulkan.Core10.Pipeline.PipelineTessellationStateCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_vertex_attribute_divisor.PipelineVertexInputDivisorStateCreateInfoEXT',
-- 'Vulkan.Core10.Pipeline.PipelineVertexInputStateCreateInfo',
-- 'Vulkan.Extensions.VK_NV_shading_rate_image.PipelineViewportCoarseSampleOrderStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_EXT_depth_clip_control.PipelineViewportDepthClipControlCreateInfoEXT',
-- 'Vulkan.Extensions.VK_NV_scissor_exclusive.PipelineViewportExclusiveScissorStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_shading_rate_image.PipelineViewportShadingRateImageStateCreateInfoNV',
-- 'Vulkan.Core10.Pipeline.PipelineViewportStateCreateInfo',
-- 'Vulkan.Extensions.VK_NV_viewport_swizzle.PipelineViewportSwizzleStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_NV_clip_space_w_scaling.PipelineViewportWScalingStateCreateInfoNV',
-- 'Vulkan.Extensions.VK_GGP_frame_token.PresentFrameTokenGGP',
-- 'Vulkan.Extensions.VK_KHR_present_id.PresentIdKHR',
-- 'Vulkan.Extensions.VK_KHR_swapchain.PresentInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_incremental_present.PresentRegionsKHR',
-- 'Vulkan.Extensions.VK_GOOGLE_display_timing.PresentTimesInfoGOOGLE',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_private_data.PrivateDataSlotCreateInfo',
-- 'Vulkan.Core11.Originally_Based_On_VK_KHR_protected_memory.ProtectedSubmitInfo',
-- 'Vulkan.Core10.Query.QueryPoolCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_performance_query.QueryPoolPerformanceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_INTEL_performance_query.QueryPoolPerformanceQueryCreateInfoINTEL',
-- 'Vulkan.Extensions.VK_KHR_synchronization2.QueueFamilyCheckpointProperties2NV',
-- 'Vulkan.Extensions.VK_NV_device_diagnostic_checkpoints.QueueFamilyCheckpointPropertiesNV',
-- 'Vulkan.Extensions.VK_KHR_global_priority.QueueFamilyGlobalPriorityPropertiesKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.QueueFamilyProperties2',
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFamilyQueryResultStatusProperties2KHR VkQueueFamilyQueryResultStatusProperties2KHR>,
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingPipelineCreateInfoKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.RayTracingPipelineCreateInfoNV',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingPipelineInterfaceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_ray_tracing_pipeline.RayTracingShaderGroupCreateInfoKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.RayTracingShaderGroupCreateInfoNV',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_imageless_framebuffer.RenderPassAttachmentBeginInfo',
-- 'Vulkan.Core10.CommandBufferBuilding.RenderPassBeginInfo',
-- 'Vulkan.Core10.Pass.RenderPassCreateInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.RenderPassCreateInfo2',
-- 'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_maintenance2.RenderPassInputAttachmentAspectCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.RenderPassMultiviewCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.RenderPassSampleLocationsBeginInfoEXT',
-- 'Vulkan.Extensions.VK_QCOM_render_pass_transform.RenderPassTransformBeginInfoQCOM',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.RenderingAttachmentInfo',
-- 'Vulkan.Extensions.VK_KHR_dynamic_rendering.RenderingFragmentDensityMapAttachmentInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_dynamic_rendering.RenderingFragmentShadingRateAttachmentInfoKHR',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.RenderingInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_copy_commands2.ResolveImageInfo2',
-- 'Vulkan.Extensions.VK_EXT_sample_locations.SampleLocationsInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_border_color_swizzle.SamplerBorderColorComponentMappingCreateInfoEXT',
-- 'Vulkan.Core10.Sampler.SamplerCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_custom_border_color.SamplerCustomBorderColorCreateInfoEXT',
-- 'Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax.SamplerReductionModeCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionImageFormatProperties',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionInfo',
-- 'Vulkan.Extensions.VK_QNX_screen_surface.ScreenSurfaceCreateInfoQNX',
-- 'Vulkan.Core10.QueueSemaphore.SemaphoreCreateInfo',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_fd.SemaphoreGetFdInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_external_semaphore_win32.SemaphoreGetWin32HandleInfoKHR',
-- 'Vulkan.Extensions.VK_FUCHSIA_external_semaphore.SemaphoreGetZirconHandleInfoFUCHSIA',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.SemaphoreSignalInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.SemaphoreSubmitInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.SemaphoreTypeCreateInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.SemaphoreWaitInfo',
-- 'Vulkan.Core10.Shader.ShaderModuleCreateInfo',
-- 'Vulkan.Extensions.VK_EXT_validation_cache.ShaderModuleValidationCacheCreateInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_shared_presentable_image.SharedPresentSurfaceCapabilitiesKHR',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.SparseImageFormatProperties2',
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_memory_requirements2.SparseImageMemoryRequirements2',
-- 'Vulkan.Extensions.VK_GGP_stream_descriptor_surface.StreamDescriptorSurfaceCreateInfoGGP',
-- 'Vulkan.Core10.Queue.SubmitInfo',
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.SubmitInfo2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassBeginInfo',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassDependency2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassDescription2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.SubpassDescriptionDepthStencilResolve',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassEndInfo',
-- 'Vulkan.Extensions.VK_QCOM_fragment_density_map_offset.SubpassFragmentDensityMapOffsetEndInfoQCOM',
-- 'Vulkan.Extensions.VK_HUAWEI_subpass_shading.SubpassShadingPipelineCreateInfoHUAWEI',
-- 'Vulkan.Extensions.VK_EXT_display_surface_counter.SurfaceCapabilities2EXT',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceCapabilities2KHR',
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceCapabilitiesFullScreenExclusiveEXT',
-- 'Vulkan.Extensions.VK_KHR_get_surface_capabilities2.SurfaceFormat2KHR',
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_full_screen_exclusive.SurfaceFullScreenExclusiveWin32InfoEXT',
-- 'Vulkan.Extensions.VK_KHR_surface_protected_capabilities.SurfaceProtectedCapabilitiesKHR',
-- 'Vulkan.Extensions.VK_EXT_display_control.SwapchainCounterCreateInfoEXT',
-- 'Vulkan.Extensions.VK_KHR_swapchain.SwapchainCreateInfoKHR',
-- 'Vulkan.Extensions.VK_AMD_display_native_hdr.SwapchainDisplayNativeHdrCreateInfoAMD',
-- 'Vulkan.Extensions.VK_FUCHSIA_buffer_collection.SysmemColorSpaceFUCHSIA',
-- 'Vulkan.Extensions.VK_AMD_texture_gather_bias_lod.TextureLODGatherFormatPropertiesAMD',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_timeline_semaphore.TimelineSemaphoreSubmitInfo',
-- 'Vulkan.Extensions.VK_EXT_validation_cache.ValidationCacheCreateInfoEXT',
-- 'Vulkan.Extensions.VK_EXT_validation_features.ValidationFeaturesEXT',
-- 'Vulkan.Extensions.VK_EXT_validation_flags.ValidationFlagsEXT',
-- 'Vulkan.Extensions.VK_EXT_vertex_input_dynamic_state.VertexInputAttributeDescription2EXT',
-- 'Vulkan.Extensions.VK_EXT_vertex_input_dynamic_state.VertexInputBindingDescription2EXT',
-- 'Vulkan.Extensions.VK_NN_vi_surface.ViSurfaceCreateInfoNN',
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoBeginCodingInfoKHR VkVideoBeginCodingInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoBindMemoryKHR VkVideoBindMemoryKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoCapabilitiesKHR VkVideoCapabilitiesKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoCodingControlInfoKHR VkVideoCodingControlInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264CapabilitiesEXT VkVideoDecodeH264CapabilitiesEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264DpbSlotInfoEXT VkVideoDecodeH264DpbSlotInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264MvcEXT VkVideoDecodeH264MvcEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264PictureInfoEXT VkVideoDecodeH264PictureInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264ProfileEXT VkVideoDecodeH264ProfileEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264SessionCreateInfoEXT VkVideoDecodeH264SessionCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264SessionParametersAddInfoEXT VkVideoDecodeH264SessionParametersAddInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH264SessionParametersCreateInfoEXT VkVideoDecodeH264SessionParametersCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265CapabilitiesEXT VkVideoDecodeH265CapabilitiesEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265DpbSlotInfoEXT VkVideoDecodeH265DpbSlotInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265PictureInfoEXT VkVideoDecodeH265PictureInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265ProfileEXT VkVideoDecodeH265ProfileEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265SessionCreateInfoEXT VkVideoDecodeH265SessionCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265SessionParametersAddInfoEXT VkVideoDecodeH265SessionParametersAddInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeH265SessionParametersCreateInfoEXT VkVideoDecodeH265SessionParametersCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoDecodeInfoKHR VkVideoDecodeInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264CapabilitiesEXT VkVideoEncodeH264CapabilitiesEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264DpbSlotInfoEXT VkVideoEncodeH264DpbSlotInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264EmitPictureParametersEXT VkVideoEncodeH264EmitPictureParametersEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264NaluSliceEXT VkVideoEncodeH264NaluSliceEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264ProfileEXT VkVideoEncodeH264ProfileEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264RateControlInfoEXT VkVideoEncodeH264RateControlInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264RateControlLayerInfoEXT VkVideoEncodeH264RateControlLayerInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264SessionCreateInfoEXT VkVideoEncodeH264SessionCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264SessionParametersAddInfoEXT VkVideoEncodeH264SessionParametersAddInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264SessionParametersCreateInfoEXT VkVideoEncodeH264SessionParametersCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH264VclFrameInfoEXT VkVideoEncodeH264VclFrameInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265CapabilitiesEXT VkVideoEncodeH265CapabilitiesEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265DpbSlotInfoEXT VkVideoEncodeH265DpbSlotInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265EmitPictureParametersEXT VkVideoEncodeH265EmitPictureParametersEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265NaluSliceSegmentEXT VkVideoEncodeH265NaluSliceSegmentEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265ProfileEXT VkVideoEncodeH265ProfileEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265RateControlInfoEXT VkVideoEncodeH265RateControlInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265RateControlLayerInfoEXT VkVideoEncodeH265RateControlLayerInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265ReferenceListsEXT VkVideoEncodeH265ReferenceListsEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265SessionCreateInfoEXT VkVideoEncodeH265SessionCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265SessionParametersAddInfoEXT VkVideoEncodeH265SessionParametersAddInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265SessionParametersCreateInfoEXT VkVideoEncodeH265SessionParametersCreateInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeH265VclFrameInfoEXT VkVideoEncodeH265VclFrameInfoEXT>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeInfoKHR VkVideoEncodeInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeRateControlInfoKHR VkVideoEncodeRateControlInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEncodeRateControlLayerInfoKHR VkVideoEncodeRateControlLayerInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoEndCodingInfoKHR VkVideoEndCodingInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoFormatPropertiesKHR VkVideoFormatPropertiesKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoGetMemoryPropertiesKHR VkVideoGetMemoryPropertiesKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoPictureResourceKHR VkVideoPictureResourceKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoProfileKHR VkVideoProfileKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoProfilesKHR VkVideoProfilesKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoQueueFamilyProperties2KHR VkVideoQueueFamilyProperties2KHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoReferenceSlotKHR VkVideoReferenceSlotKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoSessionCreateInfoKHR VkVideoSessionCreateInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoSessionParametersCreateInfoKHR VkVideoSessionParametersCreateInfoKHR>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkVideoSessionParametersUpdateInfoKHR VkVideoSessionParametersUpdateInfoKHR>,
-- 'Vulkan.Extensions.VK_KHR_wayland_surface.WaylandSurfaceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_win32_keyed_mutex.Win32KeyedMutexAcquireReleaseInfoKHR',
-- 'Vulkan.Extensions.VK_NV_win32_keyed_mutex.Win32KeyedMutexAcquireReleaseInfoNV',
-- 'Vulkan.Extensions.VK_KHR_win32_surface.Win32SurfaceCreateInfoKHR',
-- 'Vulkan.Core10.DescriptorSet.WriteDescriptorSet',
-- 'Vulkan.Extensions.VK_KHR_acceleration_structure.WriteDescriptorSetAccelerationStructureKHR',
-- 'Vulkan.Extensions.VK_NV_ray_tracing.WriteDescriptorSetAccelerationStructureNV',
-- 'Vulkan.Core13.Promoted_From_VK_EXT_inline_uniform_block.WriteDescriptorSetInlineUniformBlock',
-- 'Vulkan.Extensions.VK_KHR_xcb_surface.XcbSurfaceCreateInfoKHR',
-- 'Vulkan.Extensions.VK_KHR_xlib_surface.XlibSurfaceCreateInfoKHR'
newtype StructureType = StructureType Int32
deriving newtype (Eq, Ord, Storable, Zero)
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_APPLICATION_INFO"
pattern STRUCTURE_TYPE_APPLICATION_INFO = StructureType 0
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO"
pattern STRUCTURE_TYPE_INSTANCE_CREATE_INFO = StructureType 1
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO"
pattern STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = StructureType 2
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO"
pattern STRUCTURE_TYPE_DEVICE_CREATE_INFO = StructureType 3
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBMIT_INFO"
pattern STRUCTURE_TYPE_SUBMIT_INFO = StructureType 4
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = StructureType 5
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE"
pattern STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = StructureType 6
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_SPARSE_INFO"
pattern STRUCTURE_TYPE_BIND_SPARSE_INFO = StructureType 7
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FENCE_CREATE_INFO"
pattern STRUCTURE_TYPE_FENCE_CREATE_INFO = StructureType 8
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO"
pattern STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = StructureType 9
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EVENT_CREATE_INFO"
pattern STRUCTURE_TYPE_EVENT_CREATE_INFO = StructureType 10
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO"
pattern STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = StructureType 11
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO"
pattern STRUCTURE_TYPE_BUFFER_CREATE_INFO = StructureType 12
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO"
pattern STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = StructureType 13
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO"
pattern STRUCTURE_TYPE_IMAGE_CREATE_INFO = StructureType 14
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO"
pattern STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = StructureType 15
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO"
pattern STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = StructureType 16
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = StructureType 17
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = StructureType 18
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = StructureType 19
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = StructureType 20
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = StructureType 21
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = StructureType 22
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = StructureType 23
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = StructureType 24
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = StructureType 25
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = StructureType 26
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = StructureType 27
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO"
pattern STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = StructureType 28
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO"
pattern STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = StructureType 29
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = StructureType 30
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO"
pattern STRUCTURE_TYPE_SAMPLER_CREATE_INFO = StructureType 31
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = StructureType 32
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = StructureType 33
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = StructureType 34
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET"
pattern STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = StructureType 35
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET"
pattern STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = StructureType 36
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO"
pattern STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = StructureType 37
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO"
pattern STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = StructureType 38
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO"
pattern STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = StructureType 39
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = StructureType 40
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = StructureType 41
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = StructureType 42
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO"
pattern STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = StructureType 43
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER"
pattern STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = StructureType 44
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER"
pattern STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = StructureType 45
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_BARRIER"
pattern STRUCTURE_TYPE_MEMORY_BARRIER = StructureType 46
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO"
pattern STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = StructureType 47
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"
pattern STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = StructureType 48
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = StructureType 1000430000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM"
pattern STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = StructureType 1000425002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = StructureType 1000425001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = StructureType 1000425000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = StructureType 1000412000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = StructureType 1000411001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = StructureType 1000411000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT = StructureType 1000392001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT = StructureType 1000392000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT = StructureType 1000391001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT = StructureType 1000391000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT = StructureType 1000381001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT = StructureType 1000381000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX"
pattern STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX = StructureType 1000378000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT = StructureType 1000377000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV = StructureType 1000371001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV"
pattern STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV = StructureType 1000371000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI = StructureType 1000370000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI = StructureType 1000369002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI = StructureType 1000369001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI"
pattern STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI = StructureType 1000369000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA = StructureType 1000366009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA"
pattern STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA = StructureType 1000366008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA = StructureType 1000366007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA = StructureType 1000366006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA = StructureType 1000366005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA = StructureType 1000366004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA = StructureType 1000366003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA = StructureType 1000366002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA = StructureType 1000366001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA = StructureType 1000366000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA = StructureType 1000365001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA = StructureType 1000365000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA = StructureType 1000364002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA"
pattern STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA = StructureType 1000364001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA = StructureType 1000364000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = StructureType 1000356000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = StructureType 1000355001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = StructureType 1000355000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT = StructureType 1000353000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT"
pattern STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT = StructureType 1000352002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT"
pattern STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = StructureType 1000352001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = StructureType 1000352000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE"
pattern STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = StructureType 1000351002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = StructureType 1000351000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT = StructureType 1000346000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT = StructureType 1000344000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM = StructureType 1000342000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = StructureType 1000340000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR = StructureType 1000336000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM"
pattern STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM = StructureType 1000333000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT = StructureType 1000332001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT = StructureType 1000332000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT = StructureType 1000330000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV = StructureType 1000327002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV = StructureType 1000327001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV = StructureType 1000327000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV = StructureType 1000326002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV = StructureType 1000326001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV = StructureType 1000326000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR = StructureType 1000323000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV"
pattern STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = StructureType 1000314009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV"
pattern STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = StructureType 1000314008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = StructureType 1000300001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = StructureType 1000300000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = StructureType 1000294001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRESENT_ID_KHR"
pattern STRUCTURE_TYPE_PRESENT_ID_KHR = StructureType 1000294000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR = StructureType 1000290000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT = StructureType 1000287002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT = StructureType 1000287001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT = StructureType 1000287000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT = StructureType 1000286001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT = StructureType 1000286000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT"
pattern STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT = StructureType 1000284002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT = StructureType 1000284001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT = StructureType 1000284000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM"
pattern STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = StructureType 1000282001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = StructureType 1000282000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT = StructureType 1000281000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV = StructureType 1000278001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV = StructureType 1000278000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV = StructureType 1000277007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV"
pattern STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV = StructureType 1000277006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV"
pattern STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV = StructureType 1000277005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV = StructureType 1000277004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV"
pattern STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV = StructureType 1000277003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV = StructureType 1000277002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV = StructureType 1000277001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV = StructureType 1000277000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = StructureType 1000273000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR"
pattern STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = StructureType 1000269005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR"
pattern STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = StructureType 1000269004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR"
pattern STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR = StructureType 1000269003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR = StructureType 1000269002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR"
pattern STRUCTURE_TYPE_PIPELINE_INFO_KHR = StructureType 1000269001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR = StructureType 1000269000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT = StructureType 1000267000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT = StructureType 1000265000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT = StructureType 1000260000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT = StructureType 1000259002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT = StructureType 1000259001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT = StructureType 1000259000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT = StructureType 1000256000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT"
pattern STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT = StructureType 1000255001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT"
pattern STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT = StructureType 1000255002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT"
pattern STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT = StructureType 1000255000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT = StructureType 1000254002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT = StructureType 1000254001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT = StructureType 1000254000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT = StructureType 1000252000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT = StructureType 1000251000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV"
pattern STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV = StructureType 1000250002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV = StructureType 1000250001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV = StructureType 1000250000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV = StructureType 1000249002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV"
pattern STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV = StructureType 1000249001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = StructureType 1000249000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR = StructureType 1000248000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT"
pattern STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = StructureType 1000247000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = StructureType 1000244002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT = StructureType 1000244000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV = StructureType 1000240000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR"
pattern STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR = StructureType 1000239000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT"
pattern STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT = StructureType 1000238001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT = StructureType 1000238000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT = StructureType 1000237000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT = StructureType 1000234000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD = StructureType 1000229000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD = StructureType 1000227000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR = StructureType 1000226004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR = StructureType 1000226003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = StructureType 1000226002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = StructureType 1000226001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"
pattern STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = StructureType 1000226000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = StructureType 1000218002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = StructureType 1000218001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = StructureType 1000218000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = StructureType 1000217000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA"
pattern STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = StructureType 1000214000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD"
pattern STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD = StructureType 1000213001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD"
pattern STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD = StructureType 1000213000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = StructureType 1000212000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL"
pattern STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL = StructureType 1000210005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL"
pattern STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL = StructureType 1000210004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL"
pattern STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL = StructureType 1000210003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL"
pattern STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL = StructureType 1000210002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL"
pattern STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL = StructureType 1000210001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL"
pattern STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL = StructureType 1000210000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL = StructureType 1000209000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV"
pattern STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = StructureType 1000206001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV"
pattern STRUCTURE_TYPE_CHECKPOINT_DATA_NV = StructureType 1000206000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = StructureType 1000205002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = StructureType 1000205000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = StructureType 1000204000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = StructureType 1000203000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = StructureType 1000202001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = StructureType 1000202000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = StructureType 1000201000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP"
pattern STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP = StructureType 1000191000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = StructureType 1000190002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = StructureType 1000190001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = StructureType 1000190000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD"
pattern STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = StructureType 1000189000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = StructureType 1000388001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR = StructureType 1000388000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR = StructureType 1000174000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = StructureType 1000185000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT"
pattern STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = StructureType 1000184000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD"
pattern STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = StructureType 1000183000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = StructureType 1000181000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = StructureType 1000178002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = StructureType 1000178001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = StructureType 1000178000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT = StructureType 1000170001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT = StructureType 1000170000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = StructureType 1000166001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV = StructureType 1000166000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV = StructureType 1000165012
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV = StructureType 1000165011
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV = StructureType 1000165009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV = StructureType 1000165008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV"
pattern STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV = StructureType 1000165007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV"
pattern STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV = StructureType 1000165006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV"
pattern STRUCTURE_TYPE_GEOMETRY_AABB_NV = StructureType 1000165005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV"
pattern STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV = StructureType 1000165004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_GEOMETRY_NV"
pattern STRUCTURE_TYPE_GEOMETRY_NV = StructureType 1000165003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV = StructureType 1000165001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV = StructureType 1000165000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV = StructureType 1000164005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV = StructureType 1000164002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV = StructureType 1000164001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV = StructureType 1000164000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR = StructureType 1000163001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR = StructureType 1000163000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = StructureType 1000160001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = StructureType 1000160000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT"
pattern STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT = StructureType 1000158006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = StructureType 1000158005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = StructureType 1000158004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = StructureType 1000158003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = StructureType 1000158002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT"
pattern STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = StructureType 1000158000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV = StructureType 1000154001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV = StructureType 1000154000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = StructureType 1000152000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR = StructureType 1000348013
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR = StructureType 1000150018
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR = StructureType 1000150016
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR = StructureType 1000150015
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR = StructureType 1000347001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR = StructureType 1000347000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR = StructureType 1000150020
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR = StructureType 1000150017
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR = StructureType 1000150014
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR = StructureType 1000150013
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR"
pattern STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR = StructureType 1000150012
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR"
pattern STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR = StructureType 1000150011
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR"
pattern STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR = StructureType 1000150010
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR = StructureType 1000150009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR = StructureType 1000150006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR = StructureType 1000150005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR = StructureType 1000150004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR = StructureType 1000150003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR = StructureType 1000150002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR"
pattern STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR = StructureType 1000150000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR"
pattern STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR = StructureType 1000150007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = StructureType 1000149000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = StructureType 1000148002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT = StructureType 1000148001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT = StructureType 1000148000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT = StructureType 1000143004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT = StructureType 1000143003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = StructureType 1000143002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT"
pattern STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = StructureType 1000143001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT"
pattern STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = StructureType 1000143000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID"
pattern STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID = StructureType 1000129006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID"
pattern STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = StructureType 1000129005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"
pattern STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = StructureType 1000129004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID"
pattern STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = StructureType 1000129003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID"
pattern STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID = StructureType 1000129002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID"
pattern STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID = StructureType 1000129001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID"
pattern STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID = StructureType 1000129000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT = StructureType 1000128004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT"
pattern STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT = StructureType 1000128003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT"
pattern STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT = StructureType 1000128002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT = StructureType 1000128001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT = StructureType 1000128000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK"
pattern STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = StructureType 1000123000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK"
pattern STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = StructureType 1000122000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR"
pattern STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR = StructureType 1000121004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR"
pattern STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR = StructureType 1000121003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR"
pattern STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR = StructureType 1000121002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR"
pattern STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR = StructureType 1000121001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR"
pattern STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR = StructureType 1000121000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR"
pattern STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = StructureType 1000119002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR"
pattern STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = StructureType 1000119001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = StructureType 1000119000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR"
pattern STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = StructureType 1000116006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR"
pattern STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = StructureType 1000116005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR"
pattern STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = StructureType 1000116004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR"
pattern STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = StructureType 1000116003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR = StructureType 1000116002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR = StructureType 1000116001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR = StructureType 1000116000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR"
pattern STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = StructureType 1000115001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = StructureType 1000115000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = StructureType 1000114002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = StructureType 1000114001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = StructureType 1000114000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR"
pattern STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = StructureType 1000111000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_HDR_METADATA_EXT"
pattern STRUCTURE_TYPE_HDR_METADATA_EXT = StructureType 1000105000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = StructureType 1000102001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = StructureType 1000102000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT = StructureType 1000101001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT = StructureType 1000101000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = StructureType 1000099001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = StructureType 1000099000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = StructureType 1000098000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX = StructureType 1000097000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE"
pattern STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = StructureType 1000092000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = StructureType 1000091003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT"
pattern STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = StructureType 1000091002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT"
pattern STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = StructureType 1000091001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT"
pattern STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = StructureType 1000091000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT"
pattern STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT = StructureType 1000090000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = StructureType 1000087000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR"
pattern STRUCTURE_TYPE_PRESENT_REGIONS_KHR = StructureType 1000084000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT"
pattern STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT = StructureType 1000081002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT = StructureType 1000081001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT = StructureType 1000081000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = StructureType 1000080000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR"
pattern STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR = StructureType 1000079001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR = StructureType 1000079000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR = StructureType 1000078003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR"
pattern STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR = StructureType 1000078002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = StructureType 1000078001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR = StructureType 1000078000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR"
pattern STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR = StructureType 1000075000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR"
pattern STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR = StructureType 1000074002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR = StructureType 1000074001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR = StructureType 1000074000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR = StructureType 1000073003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR"
pattern STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = StructureType 1000073002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = StructureType 1000073001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = StructureType 1000073000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = StructureType 1000067001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT"
pattern STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = StructureType 1000067000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN"
pattern STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = StructureType 1000062000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT"
pattern STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = StructureType 1000061000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = StructureType 1000060012
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR"
pattern STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = StructureType 1000060011
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR"
pattern STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = StructureType 1000060010
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR"
pattern STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = StructureType 1000060009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = StructureType 1000060008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR"
pattern STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = StructureType 1000060007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV"
pattern STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = StructureType 1000058000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV"
pattern STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = StructureType 1000057001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV"
pattern STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = StructureType 1000057000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV"
pattern STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = StructureType 1000056001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = StructureType 1000056000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = StructureType 1000050000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP"
pattern STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP = StructureType 1000049000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX"
pattern STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX = StructureType 1000044009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD"
pattern STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = StructureType 1000044008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT"
pattern STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = StructureType 1000044007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"
pattern STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = StructureType 1000044006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD"
pattern STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = StructureType 1000041000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX"
pattern STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = StructureType 1000030001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX"
pattern STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = StructureType 1000030000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX"
pattern STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX = StructureType 1000029002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX"
pattern STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX = StructureType 1000029001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX"
pattern STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX = StructureType 1000029000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = StructureType 1000028002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = StructureType 1000028001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = StructureType 1000028000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV"
pattern STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = StructureType 1000026002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = StructureType 1000026001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV"
pattern STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = StructureType 1000026000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = StructureType 1000022002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = StructureType 1000022001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = StructureType 1000022000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"
pattern STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = StructureType 1000018000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT"
pattern STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = StructureType 1000011000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = StructureType 1000009000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = StructureType 1000008000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = StructureType 1000006000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = StructureType 1000005000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = StructureType 1000004000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR"
pattern STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR = StructureType 1000003000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = StructureType 1000002001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = StructureType 1000002000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRESENT_INFO_KHR"
pattern STRUCTURE_TYPE_PRESENT_INFO_KHR = StructureType 1000001001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR"
pattern STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = StructureType 1000001000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS"
pattern STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS = StructureType 1000413003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS"
pattern STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS = StructureType 1000413002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES = StructureType 1000413001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES = StructureType 1000413000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3"
pattern STRUCTURE_TYPE_FORMAT_PROPERTIES_3 = StructureType 1000360000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES = StructureType 1000281001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES = StructureType 1000280001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES = StructureType 1000280000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO = StructureType 1000044004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES = StructureType 1000044003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO = StructureType 1000044002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO"
pattern STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO = StructureType 1000044001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDERING_INFO"
pattern STRUCTURE_TYPE_RENDERING_INFO = StructureType 1000044000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = StructureType 1000066000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO = StructureType 1000138003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK"
pattern STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK = StructureType 1000138002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES = StructureType 1000138001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES = StructureType 1000138000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES = StructureType 1000225002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO = StructureType 1000225001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES = StructureType 1000225000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2"
pattern STRUCTURE_TYPE_IMAGE_RESOLVE_2 = StructureType 1000337010
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2"
pattern STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 = StructureType 1000337009
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_BLIT_2"
pattern STRUCTURE_TYPE_IMAGE_BLIT_2 = StructureType 1000337008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_COPY_2"
pattern STRUCTURE_TYPE_IMAGE_COPY_2 = StructureType 1000337007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_COPY_2"
pattern STRUCTURE_TYPE_BUFFER_COPY_2 = StructureType 1000337006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2"
pattern STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 = StructureType 1000337005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2"
pattern STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 = StructureType 1000337004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2"
pattern STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 = StructureType 1000337003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2"
pattern STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 = StructureType 1000337002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2"
pattern STRUCTURE_TYPE_COPY_IMAGE_INFO_2 = StructureType 1000337001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2"
pattern STRUCTURE_TYPE_COPY_BUFFER_INFO_2 = StructureType 1000337000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES = StructureType 1000335000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES = StructureType 1000325000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES = StructureType 1000314007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO"
pattern STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO = StructureType 1000314006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO"
pattern STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO = StructureType 1000314005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBMIT_INFO_2"
pattern STRUCTURE_TYPE_SUBMIT_INFO_2 = StructureType 1000314004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEPENDENCY_INFO"
pattern STRUCTURE_TYPE_DEPENDENCY_INFO = StructureType 1000314003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2"
pattern STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 = StructureType 1000314002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2"
pattern STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 = StructureType 1000314001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_BARRIER_2"
pattern STRUCTURE_TYPE_MEMORY_BARRIER_2 = StructureType 1000314000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES = StructureType 1000297000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO"
pattern STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO = StructureType 1000295002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO"
pattern STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO = StructureType 1000295001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES = StructureType 1000295000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES = StructureType 1000276000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES = StructureType 1000245000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES = StructureType 1000215000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO = StructureType 1000192000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES = StructureType 54
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES = StructureType 53
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO"
pattern STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO = StructureType 1000257004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO = StructureType 1000257003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO"
pattern STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO = StructureType 1000257002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO"
pattern STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO = StructureType 1000244001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES = StructureType 1000257000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO"
pattern STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO = StructureType 1000207005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO"
pattern STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO = StructureType 1000207004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO"
pattern STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO = StructureType 1000207003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO"
pattern STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO = StructureType 1000207002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES = StructureType 1000207001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES = StructureType 1000207000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES = StructureType 1000261000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT"
pattern STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT = StructureType 1000241002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT"
pattern STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT = StructureType 1000241001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES = StructureType 1000241000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES = StructureType 1000175000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES = StructureType 1000253000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO"
pattern STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO = StructureType 1000108003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO"
pattern STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO = StructureType 1000108002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO"
pattern STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO = StructureType 1000108001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES = StructureType 1000108000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES = StructureType 1000211000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO"
pattern STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO = StructureType 1000130001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES = StructureType 1000130000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO"
pattern STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO = StructureType 1000246000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES = StructureType 1000221000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE"
pattern STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE = StructureType 1000199001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES = StructureType 1000199000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT = StructureType 1000161004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO = StructureType 1000161003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES = StructureType 1000161002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES = StructureType 1000161001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO = StructureType 1000161000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES = StructureType 1000197000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES = StructureType 1000082000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES = StructureType 1000180000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES = StructureType 1000196000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES = StructureType 1000177000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_END_INFO"
pattern STRUCTURE_TYPE_SUBPASS_END_INFO = StructureType 1000109006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO"
pattern STRUCTURE_TYPE_SUBPASS_BEGIN_INFO = StructureType 1000109005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2"
pattern STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 = StructureType 1000109004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2"
pattern STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 = StructureType 1000109003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2"
pattern STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 = StructureType 1000109002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2"
pattern STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 = StructureType 1000109001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2"
pattern STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 = StructureType 1000109000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO"
pattern STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO = StructureType 1000147000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES = StructureType 52
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES = StructureType 51
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES = StructureType 50
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES = StructureType 49
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES = StructureType 1000063000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT"
pattern STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = StructureType 1000168001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = StructureType 1000168000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES"
pattern STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = StructureType 1000076001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = StructureType 1000076000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO"
pattern STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = StructureType 1000077000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO"
pattern STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = StructureType 1000113000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES"
pattern STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = StructureType 1000112001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = StructureType 1000112000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = StructureType 1000072002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO"
pattern STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = StructureType 1000072001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO"
pattern STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = StructureType 1000072000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = StructureType 1000071004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES"
pattern STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = StructureType 1000071003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = StructureType 1000071002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES"
pattern STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = StructureType 1000071001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = StructureType 1000071000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO"
pattern STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = StructureType 1000085000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES"
pattern STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = StructureType 1000156005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = StructureType 1000156004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO"
pattern STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = StructureType 1000156003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO"
pattern STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = StructureType 1000156002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO"
pattern STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = StructureType 1000156001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO"
pattern STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = StructureType 1000156000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2"
pattern STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = StructureType 1000145003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = StructureType 1000145002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = StructureType 1000145001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO"
pattern STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = StructureType 1000145000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = StructureType 1000120000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = StructureType 1000053002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = StructureType 1000053001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO"
pattern STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = StructureType 1000053000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO"
pattern STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = StructureType 1000117003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO"
pattern STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = StructureType 1000117002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO"
pattern STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = StructureType 1000117001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = StructureType 1000117000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = StructureType 1000059008
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2"
pattern STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = StructureType 1000059007
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = StructureType 1000059006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2"
pattern STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = StructureType 1000059005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = StructureType 1000059004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2"
pattern STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = StructureType 1000059003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2"
pattern STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = StructureType 1000059002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = StructureType 1000059001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = StructureType 1000059000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2"
pattern STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = StructureType 1000146004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2"
pattern STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = StructureType 1000146003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2"
pattern STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = StructureType 1000146002
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2"
pattern STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = StructureType 1000146001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2"
pattern STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = StructureType 1000146000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO"
pattern STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = StructureType 1000070001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = StructureType 1000070000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO"
pattern STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = StructureType 1000060014
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO"
pattern STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = StructureType 1000060013
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO"
pattern STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = StructureType 1000060006
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO"
pattern STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = StructureType 1000060005
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO"
pattern STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = StructureType 1000060004
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO"
pattern STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = StructureType 1000060003
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO"
pattern STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = StructureType 1000060000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO"
pattern STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = StructureType 1000127001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS"
pattern STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = StructureType 1000127000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = StructureType 1000083000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO"
pattern STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = StructureType 1000157001
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO"
pattern STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = StructureType 1000157000
-- No documentation found for Nested "VkStructureType" "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES"
pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = StructureType 1000094000
{-# complete STRUCTURE_TYPE_APPLICATION_INFO,
STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
STRUCTURE_TYPE_DEVICE_CREATE_INFO,
STRUCTURE_TYPE_SUBMIT_INFO,
STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
STRUCTURE_TYPE_BIND_SPARSE_INFO,
STRUCTURE_TYPE_FENCE_CREATE_INFO,
STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO,
STRUCTURE_TYPE_EVENT_CREATE_INFO,
STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
STRUCTURE_TYPE_BUFFER_CREATE_INFO,
STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO,
STRUCTURE_TYPE_IMAGE_CREATE_INFO,
STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
STRUCTURE_TYPE_COPY_DESCRIPTOR_SET,
STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO,
STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
STRUCTURE_TYPE_MEMORY_BARRIER,
STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO,
STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV,
STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT,
STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT,
STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT,
STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT,
STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV,
STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI,
STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI,
STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA,
STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA,
STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA,
STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA,
STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA,
STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA,
STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA,
STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA,
STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA,
STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA,
STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA,
STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA,
STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA,
STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA,
STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT,
STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT,
STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT,
STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE,
STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR,
STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV,
STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR,
STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV,
STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV,
STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR,
STRUCTURE_TYPE_PRESENT_ID_KHR,
STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT,
STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT,
STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT,
STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT,
STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM,
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT,
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV,
STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV,
STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV,
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV,
STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV,
STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV,
STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT,
STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR,
STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR,
STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR,
STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR,
STRUCTURE_TYPE_PIPELINE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT,
STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT,
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT,
STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT,
STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT,
STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV,
STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV,
STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR,
STRUCTURE_TYPE_VALIDATION_FEATURES_EXT,
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV,
STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR,
STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR,
STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR,
STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR,
STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT,
STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT,
STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA,
STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD,
STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT,
STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL,
STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL,
STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL,
STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL,
STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL,
STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL,
STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV,
STRUCTURE_TYPE_CHECKPOINT_DATA_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV,
STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT,
STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT,
STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD,
STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR,
STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD,
STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT,
STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT,
STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT,
STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT,
STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT,
STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV,
STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV,
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV,
STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV,
STRUCTURE_TYPE_GEOMETRY_AABB_NV,
STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV,
STRUCTURE_TYPE_GEOMETRY_NV,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV,
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR,
STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT,
STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT,
STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT,
STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT,
STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT,
STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT,
STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV,
STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR,
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR,
STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR,
STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR,
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR,
STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR,
STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR,
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR,
STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT,
STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT,
STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT,
STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT,
STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID,
STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID,
STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID,
STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID,
STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID,
STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID,
STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID,
STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT,
STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT,
STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT,
STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK,
STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK,
STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR,
STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR,
STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR,
STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR,
STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR,
STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR,
STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR,
STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR,
STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR,
STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR,
STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR,
STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR,
STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR,
STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR,
STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR,
STRUCTURE_TYPE_HDR_METADATA_EXT,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT,
STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX,
STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE,
STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT,
STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT,
STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT,
STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT,
STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT,
STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV,
STRUCTURE_TYPE_PRESENT_REGIONS_KHR,
STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT,
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR,
STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR,
STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR,
STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR,
STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR,
STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR,
STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR,
STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR,
STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR,
STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT,
STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT,
STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN,
STRUCTURE_TYPE_VALIDATION_FLAGS_EXT,
STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR,
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR,
STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR,
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR,
STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR,
STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR,
STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV,
STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV,
STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV,
STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV,
STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV,
STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV,
STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP,
STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX,
STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD,
STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT,
STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR,
STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD,
STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX,
STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX,
STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX,
STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX,
STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT,
STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV,
STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV,
STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV,
STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT,
STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT,
STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT,
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD,
STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR,
STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR,
STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR,
STRUCTURE_TYPE_PRESENT_INFO_KHR,
STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS,
STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES,
STRUCTURE_TYPE_FORMAT_PROPERTIES_3,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES,
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES,
STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO,
STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO,
STRUCTURE_TYPE_RENDERING_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES,
STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO,
STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK,
STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES,
STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES,
STRUCTURE_TYPE_IMAGE_RESOLVE_2,
STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2,
STRUCTURE_TYPE_IMAGE_BLIT_2,
STRUCTURE_TYPE_IMAGE_COPY_2,
STRUCTURE_TYPE_BUFFER_COPY_2,
STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2,
STRUCTURE_TYPE_BLIT_IMAGE_INFO_2,
STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2,
STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2,
STRUCTURE_TYPE_COPY_IMAGE_INFO_2,
STRUCTURE_TYPE_COPY_BUFFER_INFO_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES,
STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO,
STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO,
STRUCTURE_TYPE_SUBMIT_INFO_2,
STRUCTURE_TYPE_DEPENDENCY_INFO,
STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2,
STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2,
STRUCTURE_TYPE_MEMORY_BARRIER_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES,
STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO,
STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES,
STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES,
STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO,
STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO,
STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO,
STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES,
STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO,
STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO,
STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO,
STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES,
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT,
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES,
STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO,
STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO,
STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES,
STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES,
STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES,
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES,
STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT,
STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES,
STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES,
STRUCTURE_TYPE_SUBPASS_END_INFO,
STRUCTURE_TYPE_SUBPASS_BEGIN_INFO,
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2,
STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2,
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2,
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2,
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2,
STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES,
STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO,
STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO,
STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO,
STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO,
STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES,
STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO,
STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO,
STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO,
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO,
STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO,
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO,
STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO,
STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES,
STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO,
STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO,
STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO,
STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2,
STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2,
STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2,
STRUCTURE_TYPE_FORMAT_PROPERTIES_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2,
STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2,
STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2,
STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES,
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO,
STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO,
STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO,
STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO,
STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO,
STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO,
STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO,
STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS,
STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES,
STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO,
STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES :: StructureType #-}
conNameStructureType :: String
conNameStructureType = "StructureType"
enumPrefixStructureType :: String
enumPrefixStructureType = "STRUCTURE_TYPE_"
showTableStructureType :: [(StructureType, String)]
showTableStructureType =
[ (STRUCTURE_TYPE_APPLICATION_INFO , "APPLICATION_INFO")
, (STRUCTURE_TYPE_INSTANCE_CREATE_INFO , "INSTANCE_CREATE_INFO")
, (STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO , "DEVICE_QUEUE_CREATE_INFO")
, (STRUCTURE_TYPE_DEVICE_CREATE_INFO , "DEVICE_CREATE_INFO")
, (STRUCTURE_TYPE_SUBMIT_INFO , "SUBMIT_INFO")
, (STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO , "MEMORY_ALLOCATE_INFO")
, (STRUCTURE_TYPE_MAPPED_MEMORY_RANGE , "MAPPED_MEMORY_RANGE")
, (STRUCTURE_TYPE_BIND_SPARSE_INFO , "BIND_SPARSE_INFO")
, (STRUCTURE_TYPE_FENCE_CREATE_INFO , "FENCE_CREATE_INFO")
, (STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO , "SEMAPHORE_CREATE_INFO")
, (STRUCTURE_TYPE_EVENT_CREATE_INFO , "EVENT_CREATE_INFO")
, (STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO , "QUERY_POOL_CREATE_INFO")
, (STRUCTURE_TYPE_BUFFER_CREATE_INFO , "BUFFER_CREATE_INFO")
, (STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO , "BUFFER_VIEW_CREATE_INFO")
, (STRUCTURE_TYPE_IMAGE_CREATE_INFO , "IMAGE_CREATE_INFO")
, (STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO , "IMAGE_VIEW_CREATE_INFO")
, (STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO , "SHADER_MODULE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO , "PIPELINE_CACHE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO , "PIPELINE_SHADER_STAGE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO , "PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, "PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO , "PIPELINE_TESSELLATION_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO , "PIPELINE_VIEWPORT_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO , "PIPELINE_RASTERIZATION_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO , "PIPELINE_MULTISAMPLE_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO , "PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO , "PIPELINE_COLOR_BLEND_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO , "PIPELINE_DYNAMIC_STATE_CREATE_INFO")
, (STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO , "GRAPHICS_PIPELINE_CREATE_INFO")
, (STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO , "COMPUTE_PIPELINE_CREATE_INFO")
, (STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO , "PIPELINE_LAYOUT_CREATE_INFO")
, (STRUCTURE_TYPE_SAMPLER_CREATE_INFO , "SAMPLER_CREATE_INFO")
, (STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO , "DESCRIPTOR_SET_LAYOUT_CREATE_INFO")
, (STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO , "DESCRIPTOR_POOL_CREATE_INFO")
, (STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO , "DESCRIPTOR_SET_ALLOCATE_INFO")
, (STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET , "WRITE_DESCRIPTOR_SET")
, (STRUCTURE_TYPE_COPY_DESCRIPTOR_SET , "COPY_DESCRIPTOR_SET")
, (STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO , "FRAMEBUFFER_CREATE_INFO")
, (STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO , "RENDER_PASS_CREATE_INFO")
, (STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO , "COMMAND_POOL_CREATE_INFO")
, (STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO , "COMMAND_BUFFER_ALLOCATE_INFO")
, (STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO , "COMMAND_BUFFER_INHERITANCE_INFO")
, (STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO , "COMMAND_BUFFER_BEGIN_INFO")
, (STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO , "RENDER_PASS_BEGIN_INFO")
, (STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER , "BUFFER_MEMORY_BARRIER")
, (STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER , "IMAGE_MEMORY_BARRIER")
, (STRUCTURE_TYPE_MEMORY_BARRIER , "MEMORY_BARRIER")
, (STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO , "LOADER_INSTANCE_CREATE_INFO")
, (STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO , "LOADER_DEVICE_CREATE_INFO")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV
, "PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV"
)
, ( STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM
, "SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT
, "PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT
, "SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT
, "PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT , "PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT , "PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT")
, (STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT , "IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT, "PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT")
, (STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT , "PIPELINE_COLOR_WRITE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT, "PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT")
, (STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX , "SCREEN_SURFACE_CREATE_INFO_QNX")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT
, "PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV
, "PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV"
)
, (STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV , "MEMORY_GET_REMOTE_ADDRESS_INFO_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI, "PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI
, "PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI, "PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI")
, (STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI , "SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI")
, (STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA , "BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA")
, (STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA , "SYSMEM_COLOR_SPACE_FUCHSIA")
, (STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA , "IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA")
, (STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA , "IMAGE_CONSTRAINTS_INFO_FUCHSIA")
, (STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA , "BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA , "BUFFER_CONSTRAINTS_INFO_FUCHSIA")
, (STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA , "BUFFER_COLLECTION_PROPERTIES_FUCHSIA")
, (STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA , "BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA , "IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA")
, (STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA , "BUFFER_COLLECTION_CREATE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA , "SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA , "IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA , "MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA , "MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA")
, (STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA , "IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT
, "PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT
, "PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT, "PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT , "PHYSICAL_DEVICE_DRM_PROPERTIES_EXT")
, (STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT , "VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT")
, (STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT , "VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT
, "PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT"
)
, (STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE, "MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE
, "PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE"
)
, (STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT , "DIRECTFB_SURFACE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT, "PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM
, "PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT, "PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR
, "PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR"
)
, (STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM, "COPY_COMMAND_TRANSFORM_INFO_QCOM")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT
, "PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT"
)
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV, "ACCELERATION_STRUCTURE_MOTION_INFO_NV")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV
, "PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV"
)
, ( STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV
, "ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV"
)
, ( STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV
, "PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV
, "PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV
, "PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR
, "PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR"
)
, (STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV , "CHECKPOINT_DATA_2_NV")
, (STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV , "QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV")
, (STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV, "DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV, "PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR , "PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR")
, (STRUCTURE_TYPE_PRESENT_ID_KHR , "PRESENT_ID_KHR")
, (STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR , "PIPELINE_LIBRARY_CREATE_INFO_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT
, "PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT
, "PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT"
)
, (STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT, "SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT, "PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT , "PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT")
, (STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT , "DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT")
, (STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT, "DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT
, "PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT"
)
, (STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM, "RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM")
, ( STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM
, "COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT
, "PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV
, "COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV
, "PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV
, "PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV"
)
, (STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV, "GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV")
, (STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV , "GENERATED_COMMANDS_INFO_NV")
, (STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV , "INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV")
, (STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV , "INDIRECT_COMMANDS_LAYOUT_TOKEN_NV")
, (STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV, "GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV")
, (STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV , "GRAPHICS_SHADER_GROUP_CREATE_INFO_NV")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV
, "PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT
, "PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT"
)
, (STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR, "PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR")
, (STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR , "PIPELINE_EXECUTABLE_STATISTIC_KHR")
, (STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR , "PIPELINE_EXECUTABLE_INFO_KHR")
, (STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR , "PIPELINE_EXECUTABLE_PROPERTIES_KHR")
, (STRUCTURE_TYPE_PIPELINE_INFO_KHR , "PIPELINE_INFO_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR
, "PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT
, "PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT, "PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT
, "PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT
, "PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT
, "PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT, "PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT")
, (STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT , "HEADLESS_SURFACE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT , "SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT")
, (STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT , "SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT")
, (STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT , "SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT, "PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT")
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT
, "PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT , "PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT, "PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT
, "PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT"
)
, (STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV, "FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV")
, ( STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV
, "PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV
, "PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV
, "PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV"
)
, (STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV , "COOPERATIVE_MATRIX_PROPERTIES_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV, "PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR , "PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR")
, (STRUCTURE_TYPE_VALIDATION_FEATURES_EXT , "VALIDATION_FEATURES_EXT")
, (STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT , "BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT
, "PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV
, "PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV"
)
, (STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR , "SURFACE_PROTECTED_CAPABILITIES_KHR")
, (STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT , "MEMORY_PRIORITY_ALLOCATE_INFO_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT, "PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT, "PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT
, "PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD, "PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD, "PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR , "PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR
, "PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR
, "PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR"
)
, ( STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR
, "PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR"
)
, (STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR, "FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR")
, ( STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT
, "RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT
, "PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT"
)
, (STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT , "METAL_SURFACE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA , "IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA")
, (STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD , "SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD")
, (STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD , "DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT , "PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT")
, (STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL , "PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL")
, (STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL , "PERFORMANCE_OVERRIDE_INFO_INTEL")
, (STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL , "PERFORMANCE_STREAM_MARKER_INFO_INTEL")
, (STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL , "PERFORMANCE_MARKER_INFO_INTEL")
, (STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL , "INITIALIZE_PERFORMANCE_API_INFO_INTEL")
, (STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL, "QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL
, "PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL"
)
, (STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV , "QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV")
, (STRUCTURE_TYPE_CHECKPOINT_DATA_NV , "CHECKPOINT_DATA_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV, "PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV")
, ( STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV
, "PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV
, "PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV
, "PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV, "PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV , "PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV
, "PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV"
)
, (STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, "PRESENT_FRAME_TOKEN_GGP")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT
, "PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT
, "PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT
, "PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT"
)
, (STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD, "DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD")
, (STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR , "QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR
, "PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR"
)
, (STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR, "DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD , "PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD")
, (STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT , "CALIBRATED_TIMESTAMP_INFO_EXT")
, (STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD , "PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR , "PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT
, "PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT"
)
, (STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT , "MEMORY_HOST_POINTER_PROPERTIES_EXT")
, (STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT, "IMPORT_MEMORY_HOST_POINTER_INFO_EXT")
, ( STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT
, "FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT
, "PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT"
)
, ( STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV
, "PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV
, "PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV"
)
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV , "ACCELERATION_STRUCTURE_INFO_NV")
, (STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV , "RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV, "PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV")
, ( STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV
, "ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV"
)
, (STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, "WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV")
, (STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV, "BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV")
, (STRUCTURE_TYPE_GEOMETRY_AABB_NV , "GEOMETRY_AABB_NV")
, (STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV , "GEOMETRY_TRIANGLES_NV")
, (STRUCTURE_TYPE_GEOMETRY_NV , "GEOMETRY_NV")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV, "ACCELERATION_STRUCTURE_CREATE_INFO_NV")
, (STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV , "RAY_TRACING_PIPELINE_CREATE_INFO_NV")
, ( STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV
, "PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV
, "PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV, "PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV")
, ( STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV
, "PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR
, "PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR, "PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR")
, (STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT , "SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT , "VALIDATION_CACHE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT , "DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT")
, (STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT , "IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT")
, ( STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT
, "IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT"
)
, (STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT, "IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT
, "PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT"
)
, (STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT, "DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV
, "PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV, "PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV")
, ( STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV
, "PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR , "PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR")
, (STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR, "RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR , "RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR , "RAY_TRACING_PIPELINE_CREATE_INFO_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR
, "PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR
, "PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR"
)
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR, "ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR , "ACCELERATION_STRUCTURE_CREATE_INFO_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR
, "PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR
, "PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR"
)
, (STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, "COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR")
, (STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, "COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR")
, (STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR , "COPY_ACCELERATION_STRUCTURE_INFO_KHR")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR , "ACCELERATION_STRUCTURE_VERSION_INFO_KHR")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR , "ACCELERATION_STRUCTURE_GEOMETRY_KHR")
, ( STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR
, "ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR"
)
, ( STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR
, "ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR"
)
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR , "ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR , "ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR")
, (STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR , "ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR")
, (STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR, "WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR")
, (STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV, "PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV")
, ( STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT
, "PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT
, "PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT
, "PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT"
)
, (STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT , "MULTISAMPLE_PROPERTIES_EXT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT, "PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT")
, (STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT, "PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT , "RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT")
, (STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT , "SAMPLE_LOCATIONS_INFO_EXT")
, ( STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID
, "ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID"
)
, (STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID , "EXTERNAL_FORMAT_ANDROID")
, (STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, "MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID")
, (STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID , "IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID")
, ( STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID
, "ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID"
)
, (STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, "ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID")
, (STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID , "ANDROID_HARDWARE_BUFFER_USAGE_ANDROID")
, (STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT , "DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT , "DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT")
, (STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT , "DEBUG_UTILS_LABEL_EXT")
, (STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT , "DEBUG_UTILS_OBJECT_TAG_INFO_EXT")
, (STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT , "DEBUG_UTILS_OBJECT_NAME_INFO_EXT")
, (STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK , "MACOS_SURFACE_CREATE_INFO_MVK")
, (STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK , "IOS_SURFACE_CREATE_INFO_MVK")
, (STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR , "DISPLAY_PLANE_CAPABILITIES_2_KHR")
, (STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR , "DISPLAY_PLANE_INFO_2_KHR")
, (STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR , "DISPLAY_MODE_PROPERTIES_2_KHR")
, (STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR , "DISPLAY_PLANE_PROPERTIES_2_KHR")
, (STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR , "DISPLAY_PROPERTIES_2_KHR")
, (STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR , "SURFACE_FORMAT_2_KHR")
, (STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR , "SURFACE_CAPABILITIES_2_KHR")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR , "PHYSICAL_DEVICE_SURFACE_INFO_2_KHR")
, (STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR , "PERFORMANCE_COUNTER_DESCRIPTION_KHR")
, (STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR , "PERFORMANCE_COUNTER_KHR")
, (STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR , "ACQUIRE_PROFILING_LOCK_INFO_KHR")
, (STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR , "PERFORMANCE_QUERY_SUBMIT_INFO_KHR")
, (STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR , "QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR
, "PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR, "PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR")
, (STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR , "FENCE_GET_FD_INFO_KHR")
, (STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR , "IMPORT_FENCE_FD_INFO_KHR")
, (STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR , "FENCE_GET_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR , "EXPORT_FENCE_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR , "IMPORT_FENCE_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR , "SHARED_PRESENT_SURFACE_CAPABILITIES_KHR")
, (STRUCTURE_TYPE_HDR_METADATA_EXT , "HDR_METADATA_EXT")
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT
, "PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT, "PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT")
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT
, "PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT
, "PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT"
)
, ( STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT
, "PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT
, "PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT"
)
, (STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, "PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX
, "PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX"
)
, (STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE , "PRESENT_TIMES_INFO_GOOGLE")
, (STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT, "SWAPCHAIN_COUNTER_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT , "DISPLAY_EVENT_INFO_EXT")
, (STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT , "DEVICE_EVENT_INFO_EXT")
, (STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT , "DISPLAY_POWER_INFO_EXT")
, (STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT , "SURFACE_CAPABILITIES_2_EXT")
, ( STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV
, "PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV"
)
, (STRUCTURE_TYPE_PRESENT_REGIONS_KHR , "PRESENT_REGIONS_KHR")
, (STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT, "CONDITIONAL_RENDERING_BEGIN_INFO_EXT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT
, "PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT"
)
, ( STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT
, "COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, "PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR")
, (STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR , "SEMAPHORE_GET_FD_INFO_KHR")
, (STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR , "IMPORT_SEMAPHORE_FD_INFO_KHR")
, (STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR , "SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR , "D3D12_FENCE_SUBMIT_INFO_KHR")
, (STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR , "EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR , "IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR , "WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR")
, (STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR , "MEMORY_GET_FD_INFO_KHR")
, (STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR , "MEMORY_FD_PROPERTIES_KHR")
, (STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR , "IMPORT_MEMORY_FD_INFO_KHR")
, (STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR , "MEMORY_GET_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR , "MEMORY_WIN32_HANDLE_PROPERTIES_KHR")
, (STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR , "EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR , "IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT , "PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT")
, (STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT , "IMAGE_VIEW_ASTC_DECODE_MODE_EXT")
, (STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN , "VI_SURFACE_CREATE_INFO_NN")
, (STRUCTURE_TYPE_VALIDATION_FLAGS_EXT , "VALIDATION_FLAGS_EXT")
, (STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR , "DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR , "DEVICE_GROUP_PRESENT_INFO_KHR")
, (STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR , "ACQUIRE_NEXT_IMAGE_INFO_KHR")
, (STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR , "BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR")
, (STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR , "IMAGE_SWAPCHAIN_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR , "DEVICE_GROUP_PRESENT_CAPABILITIES_KHR")
, (STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV , "WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV")
, (STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV , "EXPORT_MEMORY_WIN32_HANDLE_INFO_NV")
, (STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV , "IMPORT_MEMORY_WIN32_HANDLE_INFO_NV")
, (STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV , "EXPORT_MEMORY_ALLOCATE_INFO_NV")
, (STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV , "EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV
, "PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV"
)
, (STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP, "STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP")
, (STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX , "MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX")
, (STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD , "ATTACHMENT_SAMPLE_COUNT_INFO_AMD")
, ( STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT
, "RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT"
)
, ( STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR
, "RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR"
)
, (STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD, "TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD")
, (STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX , "IMAGE_VIEW_ADDRESS_PROPERTIES_NVX")
, (STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX , "IMAGE_VIEW_HANDLE_INFO_NVX")
, (STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX , "CU_LAUNCH_INFO_NVX")
, (STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX , "CU_FUNCTION_CREATE_INFO_NVX")
, (STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX , "CU_MODULE_CREATE_INFO_NVX")
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT
, "PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT
, "PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, "PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT")
, (STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV , "DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV")
, (STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV , "DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV")
, (STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV , "DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV")
, (STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT , "DEBUG_MARKER_MARKER_INFO_EXT")
, (STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT , "DEBUG_MARKER_OBJECT_TAG_INFO_EXT")
, (STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT , "DEBUG_MARKER_OBJECT_NAME_INFO_EXT")
, ( STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD
, "PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD"
)
, (STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT , "DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT")
, (STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR , "WIN32_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR , "ANDROID_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR , "WAYLAND_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR , "XCB_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR , "XLIB_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR , "DISPLAY_PRESENT_INFO_KHR")
, (STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR , "DISPLAY_SURFACE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR , "DISPLAY_MODE_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_PRESENT_INFO_KHR , "PRESENT_INFO_KHR")
, (STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR , "SWAPCHAIN_CREATE_INFO_KHR")
, (STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS , "DEVICE_IMAGE_MEMORY_REQUIREMENTS")
, (STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS , "DEVICE_BUFFER_MEMORY_REQUIREMENTS")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, "PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES , "PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES")
, (STRUCTURE_TYPE_FORMAT_PROPERTIES_3 , "FORMAT_PROPERTIES_3")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES
, "PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES
, "PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES
, "PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES"
)
, (STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO , "COMMAND_BUFFER_INHERITANCE_RENDERING_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, "PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES")
, (STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO , "PIPELINE_RENDERING_CREATE_INFO")
, (STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO , "RENDERING_ATTACHMENT_INFO")
, (STRUCTURE_TYPE_RENDERING_INFO , "RENDERING_INFO")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES
, "PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES"
)
, ( STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO
, "DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO"
)
, (STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK , "WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES, "PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES , "PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES , "PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES")
, ( STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO
, "PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES
, "PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES"
)
, (STRUCTURE_TYPE_IMAGE_RESOLVE_2 , "IMAGE_RESOLVE_2")
, (STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 , "BUFFER_IMAGE_COPY_2")
, (STRUCTURE_TYPE_IMAGE_BLIT_2 , "IMAGE_BLIT_2")
, (STRUCTURE_TYPE_IMAGE_COPY_2 , "IMAGE_COPY_2")
, (STRUCTURE_TYPE_BUFFER_COPY_2 , "BUFFER_COPY_2")
, (STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 , "RESOLVE_IMAGE_INFO_2")
, (STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 , "BLIT_IMAGE_INFO_2")
, (STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 , "COPY_IMAGE_TO_BUFFER_INFO_2")
, (STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 , "COPY_BUFFER_TO_IMAGE_INFO_2")
, (STRUCTURE_TYPE_COPY_IMAGE_INFO_2 , "COPY_IMAGE_INFO_2")
, (STRUCTURE_TYPE_COPY_BUFFER_INFO_2 , "COPY_BUFFER_INFO_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES, "PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES
, "PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES, "PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES")
, (STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO , "COMMAND_BUFFER_SUBMIT_INFO")
, (STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO , "SEMAPHORE_SUBMIT_INFO")
, (STRUCTURE_TYPE_SUBMIT_INFO_2 , "SUBMIT_INFO_2")
, (STRUCTURE_TYPE_DEPENDENCY_INFO , "DEPENDENCY_INFO")
, (STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 , "IMAGE_MEMORY_BARRIER_2")
, (STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 , "BUFFER_MEMORY_BARRIER_2")
, (STRUCTURE_TYPE_MEMORY_BARRIER_2 , "MEMORY_BARRIER_2")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES
, "PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES"
)
, (STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO , "PRIVATE_DATA_SLOT_CREATE_INFO")
, (STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO , "DEVICE_PRIVATE_DATA_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES, "PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES
, "PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, "PHYSICAL_DEVICE_TOOL_PROPERTIES")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES
, "PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES"
)
, (STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO , "PIPELINE_CREATION_FEEDBACK_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES , "PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES , "PHYSICAL_DEVICE_VULKAN_1_3_FEATURES")
, (STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO , "DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO")
, (STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO , "MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO")
, (STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO , "BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO")
, (STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO , "BUFFER_DEVICE_ADDRESS_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, "PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES")
, (STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO , "SEMAPHORE_SIGNAL_INFO")
, (STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO , "SEMAPHORE_WAIT_INFO")
, (STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO , "TIMELINE_SEMAPHORE_SUBMIT_INFO")
, (STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO , "SEMAPHORE_TYPE_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES , "PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES , "PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES , "PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES")
, (STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT , "ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT")
, (STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT , "ATTACHMENT_REFERENCE_STENCIL_LAYOUT")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES
, "PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES
, "PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES
, "PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES"
)
, (STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO , "RENDER_PASS_ATTACHMENT_BEGIN_INFO")
, (STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO , "FRAMEBUFFER_ATTACHMENT_IMAGE_INFO")
, (STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO , "FRAMEBUFFER_ATTACHMENTS_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES, "PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES , "PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES")
, (STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO , "SAMPLER_REDUCTION_MODE_CREATE_INFO")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES
, "PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES"
)
, (STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO , "IMAGE_STENCIL_USAGE_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES, "PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES")
, (STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE , "SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE")
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES
, "PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES"
)
, ( STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT
, "DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT"
)
, ( STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO
, "DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO"
)
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, "PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES , "PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES")
, (STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, "DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES , "PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES , "PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES , "PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES , "PHYSICAL_DEVICE_DRIVER_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES , "PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES")
, (STRUCTURE_TYPE_SUBPASS_END_INFO , "SUBPASS_END_INFO")
, (STRUCTURE_TYPE_SUBPASS_BEGIN_INFO , "SUBPASS_BEGIN_INFO")
, (STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 , "RENDER_PASS_CREATE_INFO_2")
, (STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 , "SUBPASS_DEPENDENCY_2")
, (STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 , "SUBPASS_DESCRIPTION_2")
, (STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 , "ATTACHMENT_REFERENCE_2")
, (STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 , "ATTACHMENT_DESCRIPTION_2")
, (STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO , "IMAGE_FORMAT_LIST_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES , "PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES , "PHYSICAL_DEVICE_VULKAN_1_2_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES , "PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES , "PHYSICAL_DEVICE_VULKAN_1_1_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, "PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES")
, (STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT , "DESCRIPTOR_SET_LAYOUT_SUPPORT")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES , "PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES")
, (STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES , "EXTERNAL_SEMAPHORE_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO , "PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO")
, (STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO , "EXPORT_SEMAPHORE_CREATE_INFO")
, (STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO , "EXPORT_FENCE_CREATE_INFO")
, (STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES , "EXTERNAL_FENCE_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO , "PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO")
, (STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO , "EXPORT_MEMORY_ALLOCATE_INFO")
, (STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO , "EXTERNAL_MEMORY_IMAGE_CREATE_INFO")
, (STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO , "EXTERNAL_MEMORY_BUFFER_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES , "PHYSICAL_DEVICE_ID_PROPERTIES")
, (STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES , "EXTERNAL_BUFFER_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO , "PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO")
, (STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES , "EXTERNAL_IMAGE_FORMAT_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO , "PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO")
, (STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO , "DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO")
, ( STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES
, "SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES"
)
, ( STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES
, "PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES"
)
, (STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO , "IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO")
, (STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO , "BIND_IMAGE_PLANE_MEMORY_INFO")
, (STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO , "SAMPLER_YCBCR_CONVERSION_INFO")
, (STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO , "SAMPLER_YCBCR_CONVERSION_CREATE_INFO")
, (STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 , "DEVICE_QUEUE_INFO_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES, "PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES , "PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES")
, (STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO , "PROTECTED_SUBMIT_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES , "PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES , "PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES , "PHYSICAL_DEVICE_MULTIVIEW_FEATURES")
, (STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO , "RENDER_PASS_MULTIVIEW_CREATE_INFO")
, ( STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO
, "PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO"
)
, (STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO , "IMAGE_VIEW_USAGE_CREATE_INFO")
, (STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, "RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES , "PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 , "PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2")
, (STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 , "SPARSE_IMAGE_FORMAT_PROPERTIES_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 , "PHYSICAL_DEVICE_MEMORY_PROPERTIES_2")
, (STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 , "QUEUE_FAMILY_PROPERTIES_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 , "PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2")
, (STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 , "IMAGE_FORMAT_PROPERTIES_2")
, (STRUCTURE_TYPE_FORMAT_PROPERTIES_2 , "FORMAT_PROPERTIES_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 , "PHYSICAL_DEVICE_PROPERTIES_2")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 , "PHYSICAL_DEVICE_FEATURES_2")
, (STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 , "SPARSE_IMAGE_MEMORY_REQUIREMENTS_2")
, (STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 , "MEMORY_REQUIREMENTS_2")
, (STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 , "IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2")
, (STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 , "IMAGE_MEMORY_REQUIREMENTS_INFO_2")
, (STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 , "BUFFER_MEMORY_REQUIREMENTS_INFO_2")
, (STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO , "DEVICE_GROUP_DEVICE_CREATE_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES , "PHYSICAL_DEVICE_GROUP_PROPERTIES")
, (STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO , "BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO")
, (STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO , "BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO")
, (STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO , "DEVICE_GROUP_BIND_SPARSE_INFO")
, (STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO , "DEVICE_GROUP_SUBMIT_INFO")
, (STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO , "DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO")
, (STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO , "DEVICE_GROUP_RENDER_PASS_BEGIN_INFO")
, (STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO , "MEMORY_ALLOCATE_FLAGS_INFO")
, (STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO , "MEMORY_DEDICATED_ALLOCATE_INFO")
, (STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS , "MEMORY_DEDICATED_REQUIREMENTS")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES , "PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES")
, (STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO , "BIND_IMAGE_MEMORY_INFO")
, (STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO , "BIND_BUFFER_MEMORY_INFO")
, (STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES , "PHYSICAL_DEVICE_SUBGROUP_PROPERTIES")
]
instance Show StructureType where
showsPrec = enumShowsPrec enumPrefixStructureType
showTableStructureType
conNameStructureType
(\(StructureType x) -> x)
(showsPrec 11)
instance Read StructureType where
readPrec = enumReadPrec enumPrefixStructureType showTableStructureType conNameStructureType StructureType
|
expipiplus1/vulkan
|
src/Vulkan/Core10/Enums/StructureType.hs
|
bsd-3-clause
| 343,250
| 1
| 10
| 62,719
| 13,965
| 8,744
| 5,221
| -1
| -1
|
module Compiler.Translate
( trProgram
) where
import Compiler.Util
import qualified Data.List as L
import qualified Data.Map.Lazy as M
import qualified Data.Set as S
import qualified Data.Text as T
import LLVM.AST
import LLVM.AST.CallingConvention
import qualified LLVM.AST.Constant as Const
import qualified LLVM.AST.Global as Gbl
import qualified LLVM.AST.IntegerPredicate as P
import LLVM.AST.Type
import qualified Language.MiniStg as STG
-- | translate localbindings to mallocs.
-- (treat all let-binds as recursive)
-- allocate space for binders first
-- and then fill in all the arguments.
trLocalBinds :: S.Set T.Text -> M.Map STG.Var STG.LambdaForm -> (S.Set T.Text, [Named Instruction])
trLocalBinds outerRef binds =
(localRef, concatMap (uncurry trPreBind) kvps ++ concatMap (uncurry (trFillBind localRef)) kvps)
where
kvps = M.assocs binds
localRef = S.map (\(STG.Var v) -> v) (M.keysSet binds) `S.union` outerRef
-- | fill arguments in thunks
trFillBind :: S.Set T.Text -> STG.Var -> STG.LambdaForm -> [Named Instruction]
trFillBind localRef (STG.Var bndr) (STG.LambdaForm [] _ [] expr) =
let bndrname = T.unpack bndr
allocname = Name $ bndrname ++ "_al"
in case expr of
STG.Let {} -> error "Syntax Error: Let expression in local binding not lifted"
STG.Case _ _ -> error "Syntax Error: Case expression in local binding not lifted"
-- ^ complex expressions are not allowed in local bindings
STG.AppF (STG.Var f) as ->
let addrname = bndrname ++ "_ad0"
in (Name addrname :=
IntToPtr {operand0 = LocalReference int allocname, type' = intptr, metadata = []}) :
trFunc (Name addrname) f (L.length as) ++
concat (zipWith (trArg bndrname localRef) as [1 ..])
STG.AppC (STG.Constr c) as ->
let addrname = bndrname ++ "_ad0"
in (Name addrname :=
IntToPtr {operand0 = LocalReference int allocname, type' = intptr, metadata = []}) :
Do
Store
{ volatile = False
, address = LocalReference intptr $ Name addrname
, value = ConstantOperand $ trConstr c (L.length as)
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
} :
concat (zipWith (trArg bndrname localRef) as [1 ..])
STG.AppP {} -> error "Syntax error: primitive operation in local binding not supported"
STG.LitE _ -> []
where
trFunc :: Name -> T.Text -> Int -> [Named Instruction]
trFunc ad f ll =
let l = fromIntegral ll
in if l > 3
then error "Syntax Error: Arguments more than 3 not supported"
else let fname = Name $ T.unpack f
temp = Name $ T.unpack f ++ "_ptr"
temp1 = Name $ T.unpack f ++ "_ptr1"
tagged = Name $ T.unpack f ++ "_tagged"
in [ temp :=
BitCast (ConstantOperand $ Const.GlobalReference intintfunc fname) intptr []
, temp1 := PtrToInt (LocalReference intptr temp) int []
, tagged :=
Add
False
False
(LocalReference int temp1)
(ConstantOperand $ Const.Int 64 (l * 2 + funcTag))
[]
, Do
Store
{ volatile = False
, address = LocalReference intptr ad
, value = LocalReference int tagged
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
]
trConstr :: T.Text -> Int -> Const.Constant
trConstr c l =
let s = T.unpack c
in if L.length s > 10
then error "Syntax Error: Constructor name longer than 10 not supported"
else if l > 3
then error "Syntax Error: Arguments more than 3 not supported"
else let hashcode = encConstr s (fromIntegral l)
in Const.Int 64 hashcode
trArg :: String -> S.Set T.Text -> STG.Atom -> Integer -> [Named Instruction]
trArg basename ref a i =
let allocname = Name $ basename ++ "_al"
calcname = Name $ basename ++ "_arg" ++ show i
addr = Name $ basename ++ "_ad" ++ show i
in [ calcname :=
Add
False
False
(LocalReference int allocname)
(ConstantOperand (Const.Int 64 (i * 8)))
[]
, addr := IntToPtr (LocalReference int calcname) intptr []
, Do $
Store
{ volatile = False
, address = LocalReference intptr addr
, value =
case a of
STG.AtomLit (STG.Literal l) -> ConstantOperand $ trLit l
STG.AtomVar (STG.Var v) ->
let vname = Name $ T.unpack v
in if S.member v ref
then LocalReference int vname
else error
"Error: Global reference in local binding arguments not supported"
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
]
trFillBind _ _ _ = error "Syntax Error: Lambda expression in local binding not lifted"
-- ^ lambda expressions should be lifted to top bindings
-- | allocate heap space for thunks created by every single local binding
trPreBind :: STG.Var -> STG.LambdaForm -> [Named Instruction]
trPreBind (STG.Var bndr) (STG.LambdaForm [] _ [] expr) =
let bndrname = T.unpack bndr
in case expr of
STG.Let {} -> error "Syntax Error: Let expression in local binding not lifted"
STG.Case _ _ -> error "Syntax Error: Case expression in local binding not lifted"
-- ^ complex expressions are not allowed in local bindings
STG.AppF _ as ->
let memsize = fromIntegral $ (L.length as + 1) * 8
in crtThunk bndrname memsize unevalFuncTag
STG.AppC _ as ->
let memsize = fromIntegral $ (L.length as + 1) * 8
in crtThunk bndrname memsize evalConTag
STG.AppP {} -> error "Syntax error: primitive operation in local binding not supported"
STG.LitE (STG.Literal l) ->
[ Name bndrname :=
Add
False
False
(ConstantOperand (trLit l))
(ConstantOperand (Const.Int 64 evalLitTag))
[]
]
where
callMalloc :: Integer -> Instruction
-- ^ call the external malloc function to allcate space
callMalloc sz =
Call
{ tailCallKind = Nothing
, callingConvention = C
, returnAttributes = []
, function = Right (ConstantOperand (Const.GlobalReference intintfunc (Name "malloc")))
, arguments = [(ConstantOperand $ Const.Int 64 sz, [])]
, functionAttributes = []
, metadata = []
}
crtThunk :: String -> Integer -> Integer -> [Named Instruction]
crtThunk n s t =
let refname = Name n
allocname = Name $ n ++ "_al"
in [ allocname := callMalloc s
, refname :=
Add
{ nsw = False
, nuw = False
, operand0 = LocalReference int allocname
, operand1 = ConstantOperand $ Const.Int 64 t
, metadata = []
}
]
trPreBind _ _ = error "Syntax Error: Lambda expression in local binding not lifted"
-- ^ lambda expressions should be lifted to top bindings
-- | translate literal number into constants
trLit :: Integer -> Const.Constant
-- ^ a literal number is stored as 3 digits shifted
trLit l = Const.Shl False False (Const.Int 64 l) (Const.Int 64 3)
-- | tranlate an top-level binding into a function,
-- which is in responsibility to update a thunk
-- into a construction or a literal
trTopBind :: STG.Var -> STG.LambdaForm -> Definition
trTopBind (STG.Var v) (STG.LambdaForm [] _ [] expr)
| T.unpack v == "main" =
trTopBind (STG.Var (T.pack "__main")) (STG.LambdaForm [] STG.Update [] expr)
trTopBind (STG.Var f) (STG.LambdaForm fvs _ bndrs expr) =
GlobalDefinition
Gbl.functionDefaults
{ Gbl.name = fname
, Gbl.parameters = ([Parameter int (Name "ptr") []], False)
, Gbl.returnType = int
, Gbl.basicBlocks =
BasicBlock (Name "entry") (initfetch ++ fetches) (Do (Br (Name "layer1") [])) :
trBody 1 initRef expr
, Gbl.alignment = 8
}
where
fname :: Name
fname = Name $ T.unpack f
as :: [T.Text]
as = map (\(STG.Var n) -> n) (fvs ++ bndrs)
fetches :: [Named Instruction]
fetches = concat (zipWith fetcharg as [1 ..])
initfetch :: [Named Instruction]
initfetch =
[ Name "ptr_trim" :=
LShr
{ exact = False
, operand0 = LocalReference int (Name "ptr")
, operand1 = ConstantOperand (Const.Int 64 3)
, metadata = []
}
, Name "ptr_base" :=
Shl False False (LocalReference int (Name "ptr_trim")) (ConstantOperand (Const.Int 64 3)) []
, Name "ptr_addr0" := IntToPtr (LocalReference int (Name "ptr_base")) intptr []
, Name "ptr_data" :=
Load
{ volatile = False
, address = LocalReference intptr (Name "ptr_addr0")
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
, Name "ptr_tag" :=
And (LocalReference int (Name "ptr_data")) (ConstantOperand (Const.Int 64 7)) []
]
fetcharg :: T.Text -> Integer -> [Named Instruction]
fetcharg v i =
let n = T.unpack v
in if n == "_"
then []
else [ Name ("ptr_arg" ++ show i) :=
Add
False
False
(LocalReference int (Name "ptr_base"))
(ConstantOperand (Const.Int 64 (i * 8)))
[]
, Name ("ptr_ad" ++ show i) :=
IntToPtr (LocalReference int (Name ("ptr_arg" ++ show i))) intptr []
, Name n :=
Load
{ volatile = False
, address = LocalReference intptr (Name ("ptr_ad" ++ show i))
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
]
initRef :: S.Set T.Text
initRef =
foldr
(\n s ->
if T.unpack n == "_"
then s
else S.insert n s)
S.empty
as
-- | translate a functions body instructions
trBody :: Integer -> S.Set T.Text -> STG.Expr -> [BasicBlock]
trBody i ref (STG.Let _ (STG.Binds bd) innerExpr) =
let (innerRef, instrs) = trLocalBinds ref bd
in BasicBlock (Name ("layer" ++ show i)) instrs (Do $ Br (Name ("layer" ++ show (i + 1))) []) :
trBody (i + 1) innerRef innerExpr
trBody i ref (STG.Case (STG.AppF (STG.Var v) []) (STG.Alts STG.NoNonDefaultAlts (STG.DefaultNotBound e))) =
case e of
STG.Let {} -> error "Error: Complicated alternatives not supported"
STG.Case {} -> error "Error: Complicated alternatives not supported"
_ -> trUpdateV i ("layer" ++ show i) ("layer" ++ show (i + 1)) (T.unpack v) ++ trBody i ref e
trBody _ _ STG.Case {} = error "Syntax Error: complicated case evaluation not supported"
trBody i ref e@STG.AppC {} =
[ BasicBlock
(Name ("layer" ++ show i))
(trPreBind (STG.Var $ T.pack "retval") (STG.LambdaForm [] STG.Update [] e) ++
trFillBind ref (STG.Var $ T.pack "retval") (STG.LambdaForm [] STG.Update [] e) ++
[replaceThunk "ptr_addr0" "retval"])
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i ref e@STG.LitE {} =
[ BasicBlock
(Name ("layer" ++ show i))
(trPreBind (STG.Var $ T.pack "retval") (STG.LambdaForm [] STG.Update [] e) ++
trFillBind ref (STG.Var $ T.pack "retval") (STG.LambdaForm [] STG.Update [] e) ++
[replaceThunk "ptr_addr0" "retval"])
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i ref e@(STG.AppF (STG.Var f) _) =
[ BasicBlock
(Name ("layer" ++ show i))
(trPreBind (STG.Var $ T.pack ("__temp" ++ show i)) (STG.LambdaForm [] STG.Update [] e) ++
trFillBind ref (STG.Var $ T.pack ("__temp" ++ show i)) (STG.LambdaForm [] STG.Update [] e) ++
trUpdateAppF (T.unpack f) ("__temp" ++ show i) "retval" ++
[replaceThunk "ptr_addr0" "retval"])
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i _ (STG.AppP op (STG.AtomLit (STG.Literal xl)) (STG.AtomLit (STG.Literal yl))) =
let o = trOp op
in [ BasicBlock
(Name ("layer" ++ show i))
[ Name "__val" := o (ConstantOperand (Const.Int 64 xl)) (ConstantOperand (Const.Int 64 yl))
, Name "retval" :=
Shl False False (LocalReference int (Name "__val")) (ConstantOperand (Const.Int 64 3)) []
, replaceThunk "ptr_addr0" "retval"
]
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i ref (STG.AppP op (STG.AtomLit (STG.Literal xl)) (STG.AtomVar (STG.Var y)))
| S.member y ref =
let o = trOp op
in trUpdateV i ("layer" ++ show i) "exit" (T.unpack y) ++
[ BasicBlock
(Name "exit")
[ Name (T.unpack y ++ "__prim") :=
LShr
False
(LocalReference int (Name (T.unpack y ++ "__updated")))
(ConstantOperand $ Const.Int 64 3)
[]
, Name "__val" :=
o
(ConstantOperand (Const.Int 64 xl))
(LocalReference int (Name (T.unpack y ++ "__prim")))
, Name "retval" :=
Shl
False
False
(LocalReference int (Name "__val"))
(ConstantOperand (Const.Int 64 3))
[]
, replaceThunk "ptr_addr0" "retval"
]
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i ref (STG.AppP op (STG.AtomVar (STG.Var x)) (STG.AtomLit (STG.Literal yl)))
| S.member x ref =
let o = trOp op
in trUpdateV i ("layer" ++ show i) "exit" (T.unpack x) ++
[ BasicBlock
(Name "exit")
[ Name (T.unpack x ++ "__prim") :=
LShr
False
(LocalReference int (Name (T.unpack x ++ "__updated")))
(ConstantOperand $ Const.Int 64 3)
[]
, Name "__val" :=
o
(LocalReference int (Name (T.unpack x ++ "__prim")))
(ConstantOperand (Const.Int 64 yl))
, Name "retval" :=
Shl
False
False
(LocalReference int (Name "__val"))
(ConstantOperand (Const.Int 64 3))
[]
, replaceThunk "ptr_addr0" "retval"
]
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody i ref (STG.AppP op (STG.AtomVar (STG.Var x)) (STG.AtomVar (STG.Var y)))
| S.member x ref && S.member y ref =
let o = trOp op
in trUpdateV i ("layer" ++ show i) ("layer" ++ show (i + 1)) (T.unpack x) ++
trUpdateV (i + 1) ("layer" ++ show (i + 1)) "exit" (T.unpack y) ++
[ BasicBlock
(Name "exit")
[ Name (T.unpack x ++ "__prim") :=
LShr
False
(LocalReference int (Name (T.unpack x ++ "__updated")))
(ConstantOperand $ Const.Int 64 3)
[]
, Name (T.unpack y ++ "__prim") :=
LShr
False
(LocalReference int (Name (T.unpack y ++ "__updated")))
(ConstantOperand $ Const.Int 64 3)
[]
, Name "__val" :=
o
(LocalReference int (Name (T.unpack x ++ "__prim")))
(LocalReference int (Name (T.unpack y ++ "__prim")))
, Name "retval" :=
Shl
False
False
(LocalReference int (Name "__val"))
(ConstantOperand (Const.Int 64 3))
[]
, replaceThunk "ptr_addr0" "retval"
]
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
]
trBody _ _ STG.AppP {} = error "Error: Global thunk not supported"
replaceThunk :: String -> String -> Named Instruction
replaceThunk addr val =
Do
Store
{ volatile = False
, address = LocalReference intptr (Name addr)
, value = LocalReference int (Name val)
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
trUpdateAppF :: String -> String -> String -> [Named Instruction]
trUpdateAppF func thk ret =
[ Name ret :=
Call
{ tailCallKind = Nothing
, callingConvention = C
, returnAttributes = []
, function = Right (ConstantOperand (Const.GlobalReference intintfunc (Name func)))
, arguments = [(LocalReference int (Name thk), [])]
, functionAttributes = []
, metadata = []
}
]
trUpdateV :: Integer -> String -> String -> String -> [BasicBlock]
trUpdateV i entrylabel exitlabel v =
let vn = v ++ "_" ++ show i
in [ BasicBlock
(Name entrylabel)
[ Name (vn ++ "_tag") :=
And (LocalReference int (Name v)) (ConstantOperand (Const.Int 64 1)) []
, Name (vn ++ "_pred") :=
ICmp
P.EQ
(LocalReference int (Name (vn ++ "_tag")))
(ConstantOperand (Const.Int 64 1))
[]
]
(Do $
CondBr
(LocalReference i1 (Name (vn ++ "_pred")))
(Name ("fetch" ++ show i))
(Name ("upd" ++ show i))
[])
, BasicBlock
(Name ("fetch" ++ show i))
[ Name (vn ++ "_prim") :=
LShr False (LocalReference int (Name v)) (ConstantOperand (Const.Int 64 3)) []
, Name (vn ++ "_addr") :=
Shl
False
False
(LocalReference int (Name (vn ++ "_prim")))
(ConstantOperand (Const.Int 64 3))
[]
, Name (vn ++ "_ptr") := IntToPtr (LocalReference int (Name (vn ++ "_addr"))) intptr []
, Name (vn ++ "_hd") :=
Load
{ volatile = False
, address = LocalReference intptr (Name (vn ++ "_ptr"))
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
, Name (vn ++ "_st") :=
And (LocalReference int (Name (vn ++ "_hd"))) (ConstantOperand (Const.Int 64 1)) []
, Name (vn ++ "_pred") :=
ICmp P.EQ (LocalReference int (Name (vn ++ "_st"))) (ConstantOperand (Const.Int 64 1)) []
]
(Do $
CondBr
(LocalReference i1 (Name (vn ++ "_pred")))
(Name ("eval" ++ show i))
(Name ("upd" ++ show i))
[])
, BasicBlock
(Name ("eval" ++ show i))
[ Name (vn ++ "_func_prim") :=
LShr
False
(LocalReference int (Name (vn ++ "_hd")))
(ConstantOperand (Const.Int 64 3))
[]
, Name (vn ++ "_func_addr") :=
Shl
False
False
(LocalReference int (Name (vn ++ "_func_prim")))
(ConstantOperand (Const.Int 64 3))
[]
, Name (vn ++ "_func_addr1") :=
IntToPtr (LocalReference int (Name (vn ++ "_func_addr"))) intptr []
, Name (vn ++ "_func") :=
BitCast (LocalReference intptr (Name (vn ++ "_func_addr1"))) intintfunc []
, Name (vn ++ "_eval") :=
Call
{ tailCallKind = Nothing
, callingConvention = C
, returnAttributes = []
, function = Right $ LocalReference intintfunc (Name (vn ++ "_func"))
, arguments = [(LocalReference int (Name v), [])]
, functionAttributes = []
, metadata = []
}
, replaceThunk v (vn ++ "_eval")
]
(Do $ Br (Name ("upd" ++ show i)) [])
, BasicBlock
(Name ("upd" ++ show i))
[ Name (v ++ "__updated") :=
Phi
int
[ (LocalReference int (Name v), Name entrylabel)
, (LocalReference int (Name (vn ++ "_hd")), Name ("fetch" ++ show i))
, (LocalReference int (Name (vn ++ "_eval")), Name ("eval" ++ show i))
]
[]
]
(Do $ Br (Name exitlabel) [])
]
trOp :: STG.PrimOp -> Operand -> Operand -> Instruction
trOp STG.Add = \x y -> Add False False x y []
trOp STG.Sub = \x y -> Sub False False x y []
trOp STG.Mul = \x y -> Sub False False x y []
trOp STG.Div = \x y -> SDiv False x y []
trOp STG.Mod = \x y -> SRem x y []
trOp _ = error "Error: Primitive function not supported"
trProgram :: STG.Program -> [Definition]
trProgram (STG.Program (STG.Binds m)) = trMain : map (uncurry trTopBind) (M.assocs m)
trMain :: Definition
trMain =
GlobalDefinition
functionDefaults
{Gbl.name = Name "main", Gbl.returnType = int, Gbl.alignment = 8, Gbl.basicBlocks = [body]}
where
body =
BasicBlock
(Name "entry")
[ Name "ptr" := Alloca int Nothing 8 []
, Name "addr" := PtrToInt (LocalReference intptr (Name "ptr")) int []
, Name "a" :=
BitCast (ConstantOperand $ Const.GlobalReference intintfunc (Name "__main")) intptr []
, Name "callee_cast" := PtrToInt (LocalReference intptr (Name "a")) int []
, Name "thunk" :=
Add
False
False
(LocalReference int (Name "callee_cast"))
(ConstantOperand (Const.Int 64 1))
[]
, Do
Store
{ volatile = False
, address = LocalReference intptr (Name "ptr")
, value = LocalReference int (Name "thunk")
, maybeAtomicity = Nothing
, alignment = 8
, metadata = []
}
, Name "val" :=
Call
{ tailCallKind = Nothing
, callingConvention = C
, returnAttributes = []
, function = Right (ConstantOperand $ Const.GlobalReference intintfunc (Name "__main"))
, arguments = [(LocalReference int (Name "addr"), [])]
, functionAttributes = []
, metadata = []
}
, Name "retval" :=
LShr False (LocalReference int (Name "val")) (ConstantOperand (Const.Int 64 3)) []
]
(Do $ Ret (Just (LocalReference int (Name "retval"))) [])
-- | declare the malloc function
declMalloc :: Definition
declMalloc =
GlobalDefinition
functionDefaults
{ Gbl.returnType = int
, Gbl.name = Name "malloc"
, Gbl.parameters = ([Parameter int (Name "ptr") []], False)
, Gbl.alignment = 8
}
|
Neuromancer42/ministgwasm
|
src/Compiler/Translate.hs
|
bsd-3-clause
| 23,013
| 0
| 22
| 8,116
| 7,833
| 4,022
| 3,811
| 521
| 11
|
module Main
where
--import Lib
main :: IO ()
main = someFunc
someFunc :: IO ()
someFunc =
putStrLn "someFunc2"
|
fsharpcorner/99-Problems-in-Haskell
|
app/Main.hs
|
bsd-3-clause
| 117
| 2
| 6
| 26
| 40
| 22
| 18
| 6
| 1
|
{-# LANGUAGE NoImplicitPrelude #-}
-- |
-- Module: $HEADER$
-- Description: Proxy helper functions for Functor
-- Copyright: (c) 2014 Peter Trsko
-- License: BSD3
--
-- Maintainer: peter.trsko@gmail.com
-- Stability: experimental
-- Portability: NoImplicitPrelude
--
-- Proxy helper functions for 'Functor'.
module Data.Proxy.Functor
(
inFunctorAsProxyTypeOf
, aFunctor
, aFunctorOf
)
where
import Data.Function (const)
import Data.Functor (Functor)
import Data.Proxy (Proxy(Proxy))
-- | Restrict a type wrapped in a 'Functor' to type of a 'Proxy'.
inFunctorAsProxyTypeOf :: Functor f => f a -> Proxy a -> f a
inFunctorAsProxyTypeOf = const
{-# INLINE inFunctorAsProxyTypeOf #-}
-- | Type proxy for a 'Functor'. This can be used to force functor restriction
-- on something.
--
-- @
-- \\x -> x `Data.Proxy.asProxyTypeOf` 'functorProxy'
-- :: 'Functor' f => f a -> f a
-- @
aFunctor :: Functor f => Proxy (f a)
aFunctor = Proxy
{-# INLINE aFunctor #-}
-- | Type proxy for a 'Functor' where value wrapped inside is restricted by
-- its own type proxy.
--
-- @
-- 'functorProxyOf' 'Data.Proxy.Int.int'
-- :: 'Functor' f => 'Proxy' (f 'Data.Int.Int')
-- @
aFunctorOf :: Functor f => Proxy a -> Proxy (f a)
aFunctorOf Proxy = Proxy
{-# INLINE aFunctorOf #-}
|
trskop/type-proxies
|
src/Data/Proxy/Functor.hs
|
bsd-3-clause
| 1,312
| 0
| 9
| 261
| 178
| 109
| 69
| 18
| 1
|
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
-- TODO:
-- better interface
-- have error messages in the right order
-- have a message for plain failures as well / remove failure in recoveries
-- Optimize profile info (no more Ints)
module Parser.Incremental (Process,
recoverWith, symbol, eof, lookNext, testNext, run,
mkProcess, profile, pushSyms, pushEof, evalL, evalR, feedZ,
Parser(Look, Enter, Yuck), countWidth, fullLog, LogEntry(..),
evalL'
) where
import Control.Arrow (first, second, (***))
import Control.Applicative (Alternative ((<|>), empty))
import Data.Tree (Tree (Node))
data a :< b = (:<) {top :: a, _rest :: b}
infixr :<
-- | Parser specification
data Parser s a where
Pure :: a -> Parser s a
Appl :: Parser s (b -> a) -> Parser s b -> Parser s a
Bind :: Parser s a -> (a -> Parser s b) -> Parser s b
Look :: Parser s a -> (s -> Parser s a) -> Parser s a
Shif :: Parser s a -> Parser s a
Empt :: Parser s a
Disj :: Parser s a -> Parser s a -> Parser s a
Yuck :: Parser s a -> Parser s a
Enter :: String -> Parser s a -> Parser s a
-- | Parser process
data Steps s a where
Val :: a -> Steps s r -> Steps s (a :< r)
App :: Steps s ((b -> a) :< (b :< r)) -> Steps s (a :< r)
Done :: Steps s ()
Shift :: Steps s a -> Steps s a
Sh' :: Steps s a -> Steps s a
Sus :: Steps s a -> (s -> Steps s a) -> Steps s a
Best :: Ordering -> Profile -> Steps s a -> Steps s a -> Steps s a
Dislike :: Steps s a -> Steps s a
Log :: String -> Steps s a -> Steps s a
Fail :: Steps s a
-- profile !! s = number of Dislikes found to do s Shifts
data Profile = PSusp | PFail | PRes Int | !Int :> Profile
deriving Show
mapSucc :: Profile -> Profile
mapSucc PSusp = PSusp
mapSucc PFail = PFail
mapSucc (PRes x) = PRes (succ x)
mapSucc (x :> xs) = succ x :> mapSucc xs
-- Map lookahead to maximum dislike difference we accept. When looking much further,
-- we are more prone to discard smaller differences. It's essential that this drops below 0 when
-- its argument increases, so that we can discard things with dislikes using only
-- finite lookahead.
dislikeThreshold :: Int -> Int
dislikeThreshold n
| n < 5 = 0
| otherwise = -1 -- we looked 5 tokens ahead, and still have no clue who is the best. Pick at random.
-- | Compute the combination of two profiles, as well as which one is the best.
better :: Int -> Profile -> Profile -> (Ordering, Profile)
better _ PFail p = (GT, p) -- avoid failure
better _ p PFail = (LT, p)
better _ PSusp _ = (EQ, PSusp) -- could not decide before suspension => leave undecided.
better _ _ PSusp = (EQ, PSusp)
better _ (PRes x) (PRes y) = if x <= y then (LT, PRes x) else (GT, PRes y) -- two results, just pick the best.
better lk xs@(PRes x) (y:>ys) = if x == 0 || y-x > dislikeThreshold lk then (LT, xs) else min x y +> better (lk+1) xs ys
better lk (y:>ys) xs@(PRes x) = if x == 0 || y-x > dislikeThreshold lk then (GT, xs) else min x y +> better (lk+1) ys xs
better lk (x:>xs) (y:>ys)
| x == 0 && y == 0 = recur -- never drop things with no error: this ensures to find a correct parse if it exists.
| x - y > threshold = (GT, y:>ys)
| y - x > threshold = (LT, x:>xs) -- if at any point something is too disliked, drop it.
| otherwise = recur
where threshold = dislikeThreshold lk
recur = min x y +> better (lk + 1) xs ys
(+>) :: Int -> (t, Profile) -> (t, Profile)
x +> ~(ordering, xs) = (ordering, x :> xs)
data LogEntry = LLog String | LEmpty | LDislike | LShift
| LDone | LFail | LSusp | LS String
deriving Show
rightLog :: Steps s r -> Tree LogEntry
rightLog (Val _ p) = rightLog p
rightLog (App p) = rightLog p
rightLog (Shift p) = Node LShift [rightLog p]
rightLog (Done) = Node LDone []
rightLog (Fail) = Node LFail []
rightLog (Dislike p) = Node LDislike [rightLog p]
rightLog (Log msg p) = Node (LLog msg) [rightLog p]
rightLog (Sus _ _) = Node LSusp []
rightLog (Best _ _ l r) = Node LEmpty (rightLog l:[rightLog r])
rightLog (Sh' _) = error "Sh' should be hidden by Sus"
profile :: Steps s r -> Profile
profile (Val _ p) = profile p
profile (App p) = profile p
profile (Shift p) = 0 :> profile p
profile (Done) = PRes 0 -- success with zero dislikes
profile (Fail) = PFail
profile (Dislike p) = mapSucc (profile p)
profile (Log _ p) = profile p
profile (Sus _ _) = PSusp
profile (Best _ pr _ _) = pr
profile (Sh' _) = error "Sh' should be hidden by Sus"
instance Show (Steps s r) where
show (Val _ p) = 'v' : show p
show (App p) = '*' : show p
show (Done) = "1"
show (Shift p) = '>' : show p
show (Sh' p) = '\'' : show p
show (Dislike p) = '?' : show p
show (Log msg p) = "[" ++ msg ++ "]" ++ show p
show (Fail) = "0"
show (Sus _ _) = "..."
show (Best _ _ p q) = "(" ++ show p ++ ")" ++ show q
countWidth :: Zip s r -> Int
countWidth (Zip _ _ r) = countWidth' r
where countWidth' :: Steps s r -> Int
countWidth' r' = case r' of
(Best _ _ p q) -> countWidth' p + countWidth' q
(Val _ p) -> countWidth' p
(App p) -> countWidth' p
(Done) -> 1
(Shift p) -> countWidth' p
(Sh' p) -> countWidth' p
(Dislike p) -> countWidth' p
(Log _ p) -> countWidth' p
(Fail) -> 1
(Sus _ _) -> 1
instance Show (RPolish i o) where
show (RPush _ p) = show p ++ "^"
show (RApp p) = show p ++ "@"
show (RStop) = "!"
apply :: forall t t1 a. ((t -> a) :< (t :< t1)) -> a :< t1
apply ~(f:< ~(a:<r)) = f a :< r
-- | Right-eval a fully defined process (ie. one that has no Sus)
evalR' :: Steps s r -> (r, [String])
evalR' Done = ((), [])
evalR' (Val a r) = first (a :<) (evalR' r)
evalR' (App s) = first apply (evalR' s)
evalR' (Shift v) = evalR' v
evalR' (Dislike v) = evalR' v
evalR' (Log err v) = second (err:) (evalR' v)
evalR' (Fail) = error "evalR: No parse!"
evalR' (Sus _ _) = error "evalR: Not fully evaluated!"
evalR' (Sh' _) = error "evalR: Sh' should be hidden by Sus"
evalR' (Best choice _ p q) = case choice of
LT -> evalR' p
GT -> evalR' q
EQ -> error $ "evalR: Ambiguous parse: " ++ show p ++ " ~~~ " ++ show q
instance Functor (Parser s) where
fmap f = (pure f <*>)
instance Applicative (Parser s) where
(<*>) = Appl
pure = Pure
instance Alternative (Parser s) where
(<|>) = Disj
empty = Empt
instance Monad (Parser s) where
(>>=) = Bind
return = pure
fail _message = Empt
toQ :: Parser s a -> forall h r. ((h,a) -> Steps s r) -> h -> Steps s r
toQ (Look a f) = \k h -> Sus (toQ a k h) (\s -> toQ (f s) k h)
toQ (p `Appl` q) = \k -> toQ p $ toQ q $ \((h, b2a), b) -> k (h, b2a b)
toQ (Pure a) = \k h -> k (h, a)
toQ (Disj p q) = \k h -> iBest (toQ p k h) (toQ q k h)
toQ (Bind p a2q) = \k -> toQ p (\(h,a) -> toQ (a2q a) k h)
toQ Empt = \_k _h -> Fail
toQ (Yuck p) = \k h -> Dislike $ toQ p k h
toQ (Enter err p) = \k h -> Log err $ toQ p k h
toQ (Shif p) = \k h -> Sh' $ toQ p k h
toP :: Parser s a -> forall r. Steps s r -> Steps s (a :< r)
toP (Look a f) = \fut -> Sus (toP a fut) (\s -> toP (f s) fut)
toP (Appl f x) = App . toP f . toP x
toP (Pure x) = Val x
toP Empt = const Fail
toP (Disj a b) = \fut -> iBest (toP a fut) (toP b fut)
toP (Bind p a2q) = \fut -> toQ p (\(_,a) -> toP (a2q a) fut) ()
toP (Yuck p) = Dislike . toP p
toP (Enter err p) = Log err . toP p
toP (Shif p) = Sh' . toP p
-- | Intelligent, caching best.
iBest :: Steps s a -> Steps s a -> Steps s a
iBest p q = let ~(choice, pr) = better 0 (profile p) (profile q) in Best choice pr p q
symbol :: forall s. (s -> Bool) -> Parser s s
symbol f = Look empty $ \s -> if f s then Shif $ pure s else empty
eof :: forall s. Parser s ()
eof = Look (pure ()) (const empty)
-- | Push a chunk of symbols or eof in the process. This forces some suspensions.
feed :: Maybe [s] -> Steps s r -> Steps s r
feed (Just []) p = p -- nothing more left to feed
feed ss p = case p of
(Sus nil cons) -> case ss of
Just [] -> p -- no more info, stop feeding
Nothing -> feed Nothing nil -- finish
Just (s:_) -> feed ss (cons s)
(Shift p') -> Shift (feed ss p')
(Sh' p') -> Shift (feed (fmap (drop 1) ss) p')
(Dislike p') -> Dislike (feed ss p')
(Log err p') -> Log err (feed ss p')
(Val x p') -> Val x (feed ss p')
(App p') -> App (feed ss p')
Done -> Done
Fail -> Fail
Best _ _ p' q' -> iBest (feed ss p') (feed ss q')
-- TODO: it would be nice to be able to reuse the profile here.
feedZ :: Maybe [s] -> Zip s r -> Zip s r
feedZ x = onRight (feed x)
-- Move the zipper to right, and simplify if something is pushed in
-- the left part.
evalL :: forall s output. Zip s output -> Zip s output
evalL (Zip errs0 l0 r0) = help errs0 l0 r0
where
help :: [String] -> RPolish mid output -> Steps s mid -> Zip s output
help errs l rhs = case rhs of
(Val a r) -> help errs (simplify (RPush a l)) r
(App r) -> help errs (RApp l) r
(Shift p) -> help errs l p
(Log err p) -> help (err:errs) l p
(Dislike p) -> help errs l p
(Best choice _ p q) -> case choice of
LT -> help errs l p
GT -> help errs l q
EQ -> reZip errs l rhs -- don't know where to go: don't speculate on evaluating either branch.
_ -> reZip errs l rhs
reZip :: [String] -> RPolish mid output -> Steps s mid -> Zip s output
reZip errs l r = l `seq` Zip errs l r
evalL' :: Zip s output -> Zip s output
evalL' (Zip errs0 l0 r0) = Zip errs0 l0 (simplRhs r0)
where simplRhs :: Steps s a ->Steps s a
simplRhs rhs = case rhs of
(Val a r) -> Val a (simplRhs r)
(App r) -> App (simplRhs r)
(Shift p) -> Shift (simplRhs p)
(Log err p) -> Log err $ simplRhs p
(Dislike p) -> Dislike $ simplRhs p
(Best choice _ p q) -> case choice of
LT -> simplRhs p
GT -> simplRhs q
EQ -> iBest (simplRhs p) (simplRhs q)
x -> x
-- | Push some symbols.
pushSyms :: forall s r. [s] -> Zip s r -> Zip s r
pushSyms x = feedZ (Just x)
-- | Push eof
pushEof :: forall s r. Zip s r -> Zip s r
pushEof = feedZ Nothing
-- | Make a parser into a process.
mkProcess :: forall s a. Parser s a -> Process s a
mkProcess p = Zip [] RStop (toP p Done)
-- | Run a process (in case you do not need the incremental interface)
run :: Process s a -> [s] -> (a, [String])
run p input = evalR $ pushEof $ pushSyms input p
testNext :: (Maybe s -> Bool) -> Parser s ()
testNext f = Look (if f Nothing then ok else empty) (\s ->
if f $ Just s then ok else empty)
where ok = pure ()
lookNext :: Parser s (Maybe s)
lookNext = Look (pure Nothing) (pure . Just)
-- | Parse the same thing as the argument, but will be used only as
-- backup. ie, it will be used only if disjuncted with a failing
-- parser.
recoverWith :: Parser s a -> Parser s a
recoverWith = Enter "recoverWith" . Yuck
----------------------------------------------------
--------------------------------
-- The zipper for efficient evaluation:
-- Arbitrary expressions in Reverse Polish notation.
-- This can also be seen as an automaton that transforms a stack.
-- RPolish is indexed by the types in the stack consumed by the automaton (input),
-- and the stack produced (output)
data RPolish input output where
RPush :: a -> RPolish (a :< rest) output -> RPolish rest output
RApp :: RPolish (b :< rest) output -> RPolish ((a -> b) :< a :< rest) output
RStop :: RPolish rest rest
-- Evaluate the output of an RP automaton, given an input stack
evalRP :: RPolish input output -> input -> output
evalRP RStop acc = acc
evalRP (RPush v r) acc = evalRP r (v :< acc)
evalRP (RApp r) ~(f :< ~(a :< rest)) = evalRP r (f a :< rest)
-- execute the automaton as far as possible
simplify :: RPolish s output -> RPolish s output
simplify (RPush x (RPush f (RApp r))) = simplify (RPush (f x) r)
simplify x = x
evalR :: Zip token (a :< rest) -> (a, [String])
evalR (Zip errs l r) = ((top . evalRP l) *** (errs ++)) (evalR' r)
-- Gluing a Polish expression and an RP automaton.
-- This can also be seen as a zipper of Polish expressions.
data Zip s output where
Zip :: [String] -> RPolish mid output -> Steps s mid -> Zip s output
-- note that the Stack produced by the Polish expression matches
-- the stack consumed by the RP automaton.
fullLog :: Zip s output -> ([String],Tree LogEntry)
fullLog (Zip msg _ rhs) = (reverse msg, rightLog rhs)
instance Show (Zip s output) where
show (Zip errs l r) = show l ++ "<>" ++ show r ++ ", errs = " ++ show errs
onRight :: (forall r. Steps s r -> Steps s r) -> Zip s a -> Zip s a
onRight f (Zip errs x y) = Zip errs x (f y)
type Process token result = Zip token (result :< ())
|
siddhanathan/yi
|
yi-core/src/Parser/Incremental.hs
|
gpl-2.0
| 13,785
| 6
| 15
| 4,315
| 5,694
| 2,913
| 2,781
| 262
| 12
|
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.RDS.DeleteDBInstance
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- The DeleteDBInstance action deletes a previously provisioned DB
-- instance. A successful response from the web service indicates the
-- request was received correctly. When you delete a DB instance, all
-- automated backups for that instance are deleted and cannot be recovered.
-- Manual DB snapshots of the DB instance to be deleted are not deleted.
--
-- If a final DB snapshot is requested the status of the RDS instance will
-- be \"deleting\" until the DB snapshot is created. The API action
-- 'DescribeDBInstance' is used to monitor the status of this operation.
-- The action cannot be canceled or reverted once submitted.
--
-- Note that when a DB instance is in a failure state and has a status of
-- \'failed\', \'incompatible-restore\', or \'incompatible-network\', it
-- can only be deleted when the SkipFinalSnapshot parameter is set to
-- \"true\".
--
-- /See:/ <http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBInstance.html AWS API Reference> for DeleteDBInstance.
module Network.AWS.RDS.DeleteDBInstance
(
-- * Creating a Request
deleteDBInstance
, DeleteDBInstance
-- * Request Lenses
, ddiFinalDBSnapshotIdentifier
, ddiSkipFinalSnapshot
, ddiDBInstanceIdentifier
-- * Destructuring the Response
, deleteDBInstanceResponse
, DeleteDBInstanceResponse
-- * Response Lenses
, ddirsDBInstance
, ddirsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
-- |
--
-- /See:/ 'deleteDBInstance' smart constructor.
data DeleteDBInstance = DeleteDBInstance'
{ _ddiFinalDBSnapshotIdentifier :: !(Maybe Text)
, _ddiSkipFinalSnapshot :: !(Maybe Bool)
, _ddiDBInstanceIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'DeleteDBInstance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ddiFinalDBSnapshotIdentifier'
--
-- * 'ddiSkipFinalSnapshot'
--
-- * 'ddiDBInstanceIdentifier'
deleteDBInstance
:: Text -- ^ 'ddiDBInstanceIdentifier'
-> DeleteDBInstance
deleteDBInstance pDBInstanceIdentifier_ =
DeleteDBInstance'
{ _ddiFinalDBSnapshotIdentifier = Nothing
, _ddiSkipFinalSnapshot = Nothing
, _ddiDBInstanceIdentifier = pDBInstanceIdentifier_
}
-- | The DBSnapshotIdentifier of the new DBSnapshot created when
-- SkipFinalSnapshot is set to 'false'.
--
-- Specifying this parameter and also setting the SkipFinalShapshot
-- parameter to true results in an error.
--
-- Constraints:
--
-- - Must be 1 to 255 alphanumeric characters
-- - First character must be a letter
-- - Cannot end with a hyphen or contain two consecutive hyphens
-- - Cannot be specified when deleting a Read Replica.
ddiFinalDBSnapshotIdentifier :: Lens' DeleteDBInstance (Maybe Text)
ddiFinalDBSnapshotIdentifier = lens _ddiFinalDBSnapshotIdentifier (\ s a -> s{_ddiFinalDBSnapshotIdentifier = a});
-- | Determines whether a final DB snapshot is created before the DB instance
-- is deleted. If 'true' is specified, no DBSnapshot is created. If 'false'
-- is specified, a DB snapshot is created before the DB instance is
-- deleted.
--
-- Note that when a DB instance is in a failure state and has a status of
-- \'failed\', \'incompatible-restore\', or \'incompatible-network\', it
-- can only be deleted when the SkipFinalSnapshot parameter is set to
-- \"true\".
--
-- Specify 'true' when deleting a Read Replica.
--
-- The FinalDBSnapshotIdentifier parameter must be specified if
-- SkipFinalSnapshot is 'false'.
--
-- Default: 'false'
ddiSkipFinalSnapshot :: Lens' DeleteDBInstance (Maybe Bool)
ddiSkipFinalSnapshot = lens _ddiSkipFinalSnapshot (\ s a -> s{_ddiSkipFinalSnapshot = a});
-- | The DB instance identifier for the DB instance to be deleted. This
-- parameter isn\'t case-sensitive.
--
-- Constraints:
--
-- - Must contain from 1 to 63 alphanumeric characters or hyphens
-- - First character must be a letter
-- - Cannot end with a hyphen or contain two consecutive hyphens
ddiDBInstanceIdentifier :: Lens' DeleteDBInstance Text
ddiDBInstanceIdentifier = lens _ddiDBInstanceIdentifier (\ s a -> s{_ddiDBInstanceIdentifier = a});
instance AWSRequest DeleteDBInstance where
type Rs DeleteDBInstance = DeleteDBInstanceResponse
request = postQuery rDS
response
= receiveXMLWrapper "DeleteDBInstanceResult"
(\ s h x ->
DeleteDBInstanceResponse' <$>
(x .@? "DBInstance") <*> (pure (fromEnum s)))
instance ToHeaders DeleteDBInstance where
toHeaders = const mempty
instance ToPath DeleteDBInstance where
toPath = const "/"
instance ToQuery DeleteDBInstance where
toQuery DeleteDBInstance'{..}
= mconcat
["Action" =: ("DeleteDBInstance" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"FinalDBSnapshotIdentifier" =:
_ddiFinalDBSnapshotIdentifier,
"SkipFinalSnapshot" =: _ddiSkipFinalSnapshot,
"DBInstanceIdentifier" =: _ddiDBInstanceIdentifier]
-- | /See:/ 'deleteDBInstanceResponse' smart constructor.
data DeleteDBInstanceResponse = DeleteDBInstanceResponse'
{ _ddirsDBInstance :: !(Maybe DBInstance)
, _ddirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'DeleteDBInstanceResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ddirsDBInstance'
--
-- * 'ddirsResponseStatus'
deleteDBInstanceResponse
:: Int -- ^ 'ddirsResponseStatus'
-> DeleteDBInstanceResponse
deleteDBInstanceResponse pResponseStatus_ =
DeleteDBInstanceResponse'
{ _ddirsDBInstance = Nothing
, _ddirsResponseStatus = pResponseStatus_
}
-- | Undocumented member.
ddirsDBInstance :: Lens' DeleteDBInstanceResponse (Maybe DBInstance)
ddirsDBInstance = lens _ddirsDBInstance (\ s a -> s{_ddirsDBInstance = a});
-- | The response status code.
ddirsResponseStatus :: Lens' DeleteDBInstanceResponse Int
ddirsResponseStatus = lens _ddirsResponseStatus (\ s a -> s{_ddirsResponseStatus = a});
|
fmapfmapfmap/amazonka
|
amazonka-rds/gen/Network/AWS/RDS/DeleteDBInstance.hs
|
mpl-2.0
| 7,078
| 0
| 13
| 1,346
| 752
| 467
| 285
| 89
| 1
|
module Network.Haskoin.Wallet.Client (clientMain) where
import System.FilePath ((</>))
import System.Directory (createDirectoryIfMissing)
import System.Posix.Directory (changeWorkingDirectory)
import System.Posix.Files
( setFileMode
, setFileCreationMask
, unionFileModes
, ownerModes
, groupModes
, otherModes
, fileExist
)
import System.Environment (getArgs, lookupEnv)
import System.Info (os)
import System.Console.GetOpt
( getOpt
, usageInfo
, OptDescr (Option)
, ArgDescr (NoArg, ReqArg)
, ArgOrder (Permute)
)
import Control.Monad (when, forM_)
import Control.Monad.Trans (liftIO)
import qualified Control.Monad.Reader as R (runReaderT)
import Data.Default (def)
import Data.FileEmbed (embedFile)
import qualified Data.Text as T (pack, unpack)
import Data.Yaml (decodeFileEither)
import Data.String.Conversions (cs)
import Network.Haskoin.Constants
import Network.Haskoin.Wallet.Settings
import Network.Haskoin.Wallet.Client.Commands
import Network.Haskoin.Wallet.Types
import System.FilePath.Posix (isAbsolute)
usageHeader :: String
usageHeader = "Usage: hw [<options>] <command> [<args>]"
cmdHelp :: [String]
cmdHelp = lines $ cs $ $(embedFile "config/help")
warningMsg :: String
warningMsg = unwords
[ "!!!", "This software is experimental."
, "Use only small amounts of Bitcoins.", "!!!"
]
usage :: [String]
usage = warningMsg : usageInfo usageHeader options : cmdHelp
options :: [OptDescr (Config -> Config)]
options =
[ Option "k" ["keyring"]
(ReqArg (\s cfg -> cfg { configKeyRing = T.pack s }) "NAME") $
"Default: " ++ T.unpack (configKeyRing def)
, Option "c" ["count"]
(ReqArg (\s cfg -> cfg { configCount = read s }) "INT") $
"Items per page. Default: " ++ show (configCount def)
, Option "m" ["minconf"]
(ReqArg (\s cfg -> cfg { configMinConf = read s }) "INT") $
"Minimum confirmations. Default: "
++ show (configMinConf def)
, Option "f" ["fee"]
(ReqArg (\s cfg -> cfg { configFee = read s }) "INT") $
"Fee per kilobyte. Default: " ++ show (configFee def)
, Option "R" ["rcptfee"]
(NoArg $ \cfg -> cfg { configRcptFee = True }) $
"Recipient pays fee. Default: " ++ show (configRcptFee def)
, Option "S" ["nosig"]
(NoArg $ \cfg -> cfg { configSignTx = False }) $
"Do not sign. Default: " ++ show (not $ configSignTx def)
, Option "i" ["internal"]
(NoArg $ \cfg -> cfg { configAddrType = AddressInternal }) $
"Internal addresses. Default: "
++ show (configAddrType def == AddressInternal)
, Option "o" ["offline"]
(NoArg $ \cfg -> cfg { configOffline = True }) $
"Offline balance. Default: " ++ show (configOffline def)
, Option "r" ["revpage"]
(NoArg $ \cfg -> cfg { configReversePaging = True }) $
"Reverse paging. Default: "
++ show (configReversePaging def)
, Option "p" ["pass"]
(ReqArg (\s cfg -> cfg { configPass = Just $ T.pack s }) "PASS")
"Mnemonic passphrase"
, Option "j" ["json"]
(NoArg $ \cfg -> cfg { configFormat = OutputJSON })
"Output JSON"
, Option "y" ["yaml"]
(NoArg $ \cfg -> cfg { configFormat = OutputYAML })
"Output YAML"
, Option "s" ["socket"]
(ReqArg (\s cfg -> cfg { configConnect = s }) "URI") $
"Server socket. Default: " ++ configConnect def
, Option "d" ["detach"]
(NoArg $ \cfg -> cfg { configDetach = True }) $
"Detach server. Default: " ++ show (configDetach def)
, Option "t" ["testnet"]
(NoArg $ \cfg -> cfg { configTestnet = True }) "Testnet3 network"
, Option "g" ["config"]
(ReqArg (\s cfg -> cfg { configFile = s }) "FILE") $
"Config file. Default: " ++ configFile def
, Option "w" ["workdir"]
(ReqArg (\s cfg -> cfg { configDir = s }) "DIR")
"Working directory. OS-dependent default"
, Option "v" ["verbose"]
(NoArg $ \cfg -> cfg { configVerbose = True }) "Verbose output"
]
-- Create and change current working directory
setWorkDir :: Config -> IO ()
setWorkDir cfg = do
let workDir = configDir cfg </> networkName
_ <- setFileCreationMask $ otherModes `unionFileModes` groupModes
createDirectoryIfMissing True workDir
setFileMode workDir ownerModes
changeWorkingDirectory workDir
-- Build application configuration
getConfig :: [Config -> Config] -> IO Config
getConfig fs = do
-- Create initial configuration from defaults and command-line arguments
let initCfg = foldr ($) def fs
-- If working directory set in initial configuration, use it
dir <- case configDir initCfg of "" -> appDir
d -> return d
-- Make configuration file relative to working directory
let cfgFile = if isAbsolute (configFile initCfg)
then configFile initCfg
else dir </> configFile initCfg
-- Get configuration from file, if it exists
e <- fileExist cfgFile
if e then do
cfgE <- decodeFileEither cfgFile
case cfgE of
Left x -> error $ show x
-- Override settings from file using command-line
Right cfg -> return $ fixConfigDir (foldr ($) cfg fs) dir
else return $ fixConfigDir initCfg dir
where
-- If working directory not set, use default
fixConfigDir cfg dir = case configDir cfg of "" -> cfg{ configDir = dir }
_ -> cfg
clientMain :: IO ()
clientMain = getArgs >>= \args -> case getOpt Permute options args of
(fs, commands, []) -> do
cfg <- getConfig fs
when (configTestnet cfg) switchToTestnet3
setWorkDir cfg
dispatchCommand cfg commands
(_, _, msgs) -> forM_ (msgs ++ usage) putStrLn
dispatchCommand :: Config -> [String] -> IO ()
dispatchCommand cfg args = flip R.runReaderT cfg $ case args of
["start"] -> cmdStart
["stop"] -> cmdStop
"newkeyring" : mnemonic -> cmdNewKeyRing mnemonic
["keyring"] -> cmdKeyRing
["keyrings"] -> cmdKeyRings
"newacc" : [name] -> cmdNewAcc name
"newms" : name : m : n : ks -> cmdNewMS False name m n ks
"newread" : [name, key] -> cmdNewRead name key
"newreadms" : name : m : n : ks -> cmdNewMS True name m n ks
"addkeys" : name : ks -> cmdAddKeys name ks
"setgap" : [name, gap] -> cmdSetGap name gap
"account" : [name] -> cmdAccount name
["accounts"] -> cmdAccounts
"list" : name : page -> cmdList name page
"unused" : [name] -> cmdUnused name
"label" : [name, index, label] -> cmdLabel name index label
"txs" : name : page -> cmdTxs name page
"addrtxs" : name : index : page -> cmdAddrTxs name index page
"genaddrs" : [name, i] -> cmdGenAddrs name i
"send" : [name, add, amnt] -> cmdSend name add amnt
"sendmany" : name : xs -> cmdSendMany name xs
"import" : [name, tx] -> cmdImport name tx
"sign" : [name, txid] -> cmdSign name txid
"gettx" : [name, txid] -> cmdGetTx name txid
"balance" : [name] -> cmdBalance name
"getoffline" : [name, txid] -> cmdGetOffline name txid
"signoffline" : [name, tx, dat] -> cmdSignOffline name tx dat
"rescan" : rescantime -> cmdRescan rescantime
"decodetx" : [tx] -> cmdDecodeTx tx
["status"] -> cmdStatus
["version"] -> cmdVersion
["help"] -> liftIO $ forM_ usage putStrLn
[] -> liftIO $ forM_ usage putStrLn
_ -> liftIO $ forM_ ("Invalid command" : usage) putStrLn
appDir :: IO FilePath
appDir = case os of "mingw" -> windows
"mingw32" -> windows
"mingw64" -> windows
"darwin" -> osx
"linux" -> unix
_ -> unix
where
windows = do
localAppData <- lookupEnv "LOCALAPPDATA"
dirM <- case localAppData of
Nothing -> lookupEnv "APPDATA"
Just l -> return $ Just l
case dirM of
Just d -> return $ d </> "Haskoin Wallet"
Nothing -> return "."
osx = do
homeM <- lookupEnv "HOME"
case homeM of
Just home -> return $ home </> "Library"
</> "Application Support"
</> "Haskoin Wallet"
Nothing -> return "."
unix = do
homeM <- lookupEnv "HOME"
case homeM of
Just home -> return $ home </> ".hw"
Nothing -> return "."
|
tphyahoo/haskoin
|
haskoin-wallet/Network/Haskoin/Wallet/Client.hs
|
unlicense
| 9,222
| 0
| 16
| 3,090
| 2,611
| 1,384
| 1,227
| -1
| -1
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="hi-IN">
<title>SOAP Scanner | ZAP Extension</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm"/>
</maps>
<view>
<name>TOC</name>
<label>Contents</label>
<type>org.zaproxy.zap.extension.help.ZapTocView</type>
<data>toc.xml</data>
</view>
<view>
<name>Index</name>
<label>Index</label>
<type>javax.help.IndexView</type>
<data>index.xml</data>
</view>
<view>
<name>Search</name>
<label>Search</label>
<type>javax.help.SearchView</type>
<data engine="com.sun.java.help.search.DefaultSearchEngine">
JavaHelpSearch
</data>
</view>
<view>
<name>Favorites</name>
<label>Favorites</label>
<type>javax.help.FavoritesView</type>
</view>
</helpset>
|
veggiespam/zap-extensions
|
addOns/soap/src/main/javahelp/org/zaproxy/zap/extension/soap/resources/help_hi_IN/helpset_hi_IN.hs
|
apache-2.0
| 974
| 80
| 66
| 160
| 415
| 210
| 205
| -1
| -1
|
{-# LANGUAGE Haskell98 #-}
{-# LINE 1 "src/Numeric/Compat.hs" #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
module Numeric.Compat (
module Base
, showFFloatAlt
, showGFloatAlt
) where
import Numeric as Base
|
phischu/fragnix
|
tests/packages/scotty/Numeric.Compat.hs
|
bsd-3-clause
| 258
| 0
| 4
| 82
| 26
| 19
| 7
| 8
| 0
|
{-# LANGUAGE MultiParamTypeClasses #-}
{-|
Module : Idris.ASTUtils
Description : This implements just a few basic lens-like concepts to ease state updates. Similar to fclabels in approach, just without the extra dependency.
Copyright :
License : BSD3
Maintainer : The Idris Community.
This implements just a few basic lens-like concepts to ease state updates.
Similar to fclabels in approach, just without the extra dependency.
We don't include an explicit export list
because everything here is meant to be exported.
Short synopsis:
---------------
@
f :: Idris ()
f = do
-- these two steps:
detaggable <- fgetState (opt_detaggable . ist_optimisation typeName)
fputState (opt_detaggable . ist_optimisation typeName) (not detaggable)
-- are equivalent to:
fmodifyState (opt_detaggable . ist_optimisation typeName) not
-- of course, the long accessor can be put in a variable;
-- everything is first-class
let detag n = opt_detaggable . ist_optimisation n
fputState (detag n1) True
fputState (detag n2) False
-- Note that all these operations handle missing items consistently
-- and transparently, as prescribed by the default values included
-- in the definitions of the ist_* functions.
--
-- Especially, it's no longer necessary to have initial values of
-- data structures copied (possibly inconsistently) all over the compiler.
@
-}
module Idris.ASTUtils(
Field(), cg_usedpos, ctxt_lookup, fgetState, fmodifyState
, fputState, idris_fixities, ist_callgraph, ist_optimisation
, known_interfaces, known_terms, opt_detaggable, opt_inaccessible
, opt_forceable, opts_idrisCmdline, repl_definitions
) where
import Idris.AbsSyntaxTree
import Idris.Core.Evaluate
import Idris.Core.TT
import Idris.Options
import Prelude hiding (id, (.))
import Control.Applicative
import Control.Category
import Control.Monad.State.Class
import Data.Maybe
data Field rec fld = Field
{ fget :: rec -> fld
, fset :: fld -> rec -> rec
}
fmodify :: Field rec fld -> (fld -> fld) -> rec -> rec
fmodify field f x = fset field (f $ fget field x) x
instance Category Field where
id = Field id const
Field g2 s2 . Field g1 s1 = Field (g2 . g1) (\v2 x1 -> s1 (s2 v2 $ g1 x1) x1)
fgetState :: MonadState s m => Field s a -> m a
fgetState field = gets $ fget field
fputState :: MonadState s m => Field s a -> a -> m ()
fputState field x = fmodifyState field (const x)
fmodifyState :: MonadState s m => Field s a -> (a -> a) -> m ()
fmodifyState field f = modify $ fmodify field f
-- | Exact-name context lookup; uses Nothing for deleted values
-- (read+write!).
--
-- Reading a non-existing value yields Nothing,
-- writing Nothing deletes the value (if it existed).
ctxt_lookup :: Name -> Field (Ctxt a) (Maybe a)
ctxt_lookup n = Field
{ fget = lookupCtxtExact n
, fset = \newVal -> case newVal of
Just x -> addDef n x
Nothing -> deleteDefExact n
}
-- Maybe-lens with a default value.
maybe_default :: a -> Field (Maybe a) a
maybe_default dflt = Field (fromMaybe dflt) (const . Just)
-----------------------------------
-- Individual records and fields --
-----------------------------------
--
-- These could probably be generated; let's use lazy addition for now.
--
-- OptInfo
----------
-- | the optimisation record for the given (exact) name
ist_optimisation :: Name -> Field IState OptInfo
ist_optimisation n =
maybe_default Optimise
{ inaccessible = []
, detaggable = False
, forceable = []
}
. ctxt_lookup n
. Field idris_optimisation (\v ist -> ist{ idris_optimisation = v })
-- | two fields of the optimisation record
opt_inaccessible :: Field OptInfo [(Int, Name)]
opt_inaccessible = Field inaccessible (\v opt -> opt{ inaccessible = v })
opt_detaggable :: Field OptInfo Bool
opt_detaggable = Field detaggable (\v opt -> opt{ detaggable = v })
opt_forceable :: Field OptInfo [Int]
opt_forceable = Field forceable (\v opt -> opt{ forceable = v })
-- | callgraph record for the given (exact) name
ist_callgraph :: Name -> Field IState CGInfo
ist_callgraph n =
maybe_default CGInfo
{ calls = [], allCalls = Nothing, scg = [], usedpos = []
}
. ctxt_lookup n
. Field idris_callgraph (\v ist -> ist{ idris_callgraph = v })
cg_usedpos :: Field CGInfo [(Int, [UsageReason])]
cg_usedpos = Field usedpos (\v cg -> cg{ usedpos = v })
-- | Commandline flags
opts_idrisCmdline :: Field IState [Opt]
opts_idrisCmdline =
Field opt_cmdline (\v opts -> opts{ opt_cmdline = v })
. Field idris_options (\v ist -> ist{ idris_options = v })
-- | TT Context
--
-- This has a terrible name, but I'm not sure of a better one that
-- isn't confusingly close to tt_ctxt
known_terms :: Field IState (Ctxt (Def, RigCount, Injectivity, Accessibility, Totality, MetaInformation))
known_terms = Field (definitions . tt_ctxt)
(\v state -> state {tt_ctxt = (tt_ctxt state) {definitions = v}})
known_interfaces :: Field IState (Ctxt InterfaceInfo)
known_interfaces = Field idris_interfaces (\v state -> state {idris_interfaces = idris_interfaces state})
-- | Names defined at the repl
repl_definitions :: Field IState [Name]
repl_definitions = Field idris_repl_defs (\v state -> state {idris_repl_defs = v})
-- | Fixity declarations in an IState
idris_fixities :: Field IState [FixDecl]
idris_fixities = Field idris_infixes (\v state -> state {idris_infixes = v})
|
Heather/Idris-dev
|
src/Idris/ASTUtils.hs
|
bsd-3-clause
| 5,503
| 0
| 12
| 1,122
| 1,228
| 681
| 547
| 75
| 2
|
module SameNameOnlyConstructorUsed where
import Language.Haskell.Exts (Module (Module))
foo = Module
|
serokell/importify
|
test/test-data/haskell-src-exts@constructors/04-SameNameOnlyConstructorUsed.hs
|
mit
| 103
| 0
| 6
| 12
| 24
| 16
| 8
| 3
| 1
|
{-# LANGUAGE PatternGuards #-}
module Distribution.Client
( -- * Command line handling
validateHackageURI
, validatePackageIds
-- * Fetching info from source and destination servers
, PkgIndexInfo(..)
, downloadIndex
, readNewIndex
-- * HTTP utilities
, HttpSession
, uriHostName
, httpSession
, requestGET'
, requestPUT
, (<//>)
, provideAuthInfo
-- * TODO: Exported although they appear unusued
, extractURICredentials
, removeURICredentials
, getETag
, downloadFile'
, requestGET
, requestPUTFile
, requestPOST
, checkStatus
) where
import Network.HTTP
import Network.Browser
import Network.URI (URI(..), URIAuth(..), parseURI)
import Distribution.Client.UploadLog as UploadLog (read, Entry(..))
import Distribution.Server.Users.Types (UserId(..), UserName(UserName))
import Distribution.Server.Util.Index as PackageIndex (read)
import Distribution.Server.Util.Merge
import Distribution.Server.Util.Parse (unpackUTF8)
import Distribution.Package
import Distribution.Version
import Distribution.Verbosity
import Distribution.Simple.Utils
import Distribution.Text
import Data.List
import Data.Maybe
import Control.Applicative
import Control.Exception
import Data.Time
import Data.Time.Clock.POSIX
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BS
import qualified Distribution.Server.Util.GZip as GZip
import qualified Codec.Archive.Tar as Tar
import qualified Codec.Archive.Tar.Entry as Tar
import Control.Monad.Trans
import System.IO
import System.IO.Error
import System.FilePath
import System.Directory
import qualified System.FilePath.Posix as Posix
-------------------------
-- Command line handling
-------------------------
validateHackageURI :: String -> Either String URI
validateHackageURI str = case parseURI str of
Nothing -> Left ("invalid URL " ++ str)
Just uri
| uriScheme uri /= "http:" -> Left ("only http URLs are supported " ++ str)
| isNothing (uriAuthority uri) -> Left ("server name required in URL " ++ str)
| otherwise -> Right uri
validatePackageIds :: [String] -> Either String [PackageId]
validatePackageIds pkgstrs =
case theErrors of
theError : _ ->
Left $ "'" ++ theError ++ "' is not a valid package name or id"
_ -> Right pkgs
where
pkgstrs' = [ (pkgstr, simpleParse pkgstr) | pkgstr <- pkgstrs ]
pkgs = [ pkgid | (_, Just pkgid) <- pkgstrs' ]
theErrors = [ pkgstr | (pkgstr, Nothing) <- pkgstrs' ]
----------------------------------------------------
-- Fetching info from source and destination servers
----------------------------------------------------
data PkgIndexInfo = PkgIndexInfo
PackageId
(Maybe UTCTime) -- Upload time
(Maybe UserName) -- Name of uploader
(Maybe UserId) -- Id of uploader
deriving Show
downloadIndex :: URI -> FilePath -> HttpSession [PkgIndexInfo]
downloadIndex uri | isOldHackageURI uri = downloadOldIndex uri
| otherwise = downloadNewIndex uri
where
isOldHackageURI :: URI -> Bool
isOldHackageURI uri
| Just auth <- uriAuthority uri = uriRegName auth == "hackage.haskell.org"
| otherwise = False
downloadOldIndex :: URI -> FilePath -> HttpSession [PkgIndexInfo]
downloadOldIndex uri cacheDir = do
downloadFile indexURI indexFile
downloadFile logURI logFile
liftIO $ do
pkgids <- withFile indexFile ReadMode $ \hnd -> do
content <- BS.hGetContents hnd
case PackageIndex.read (\pkgid _ -> pkgid) (GZip.decompressNamed indexFile content) of
Right pkgs -> return pkgs
Left theError ->
die $ "Error parsing index at " ++ show uri ++ ": " ++ theError
theLog <- withFile logFile ReadMode $ \hnd -> do
content <- hGetContents hnd
case UploadLog.read content of
Right theLog -> return theLog
Left theError ->
die $ "Error parsing log at " ++ show uri ++ ": " ++ theError
return (mergeLogInfo pkgids theLog)
where
indexURI = uri <//> "packages" </> "archive" </> "00-index.tar.gz"
indexFile = cacheDir </> "00-index.tar.gz"
logURI = uri <//> "packages" </> "archive" </> "log"
logFile = cacheDir </> "log"
mergeLogInfo pkgids theLog =
catMaybes
. map selectDetails
$ mergeBy (\pkgid entry -> compare pkgid (entryPkgId entry))
(sort pkgids)
( map (maximumBy (comparing entryTime))
. groupBy (equating entryPkgId)
. sortBy (comparing entryPkgId)
$ theLog )
selectDetails (OnlyInRight _) = Nothing
selectDetails (OnlyInLeft pkgid) =
Just $ PkgIndexInfo pkgid Nothing Nothing Nothing
selectDetails (InBoth pkgid (UploadLog.Entry time uname _)) =
Just $ PkgIndexInfo pkgid (Just time) (Just uname) Nothing
entryPkgId (Entry _ _ pkgid) = pkgid
entryTime (Entry time _ _) = time
downloadNewIndex :: URI -> FilePath -> HttpSession [PkgIndexInfo]
downloadNewIndex uri cacheDir = do
downloadFile indexURI indexFile
readNewIndex cacheDir
where
indexURI = uri <//> "packages/00-index.tar.gz"
indexFile = cacheDir </> "00-index.tar.gz"
readNewIndex :: FilePath -> HttpSession [PkgIndexInfo]
readNewIndex cacheDir = do
liftIO $ withFile indexFile ReadMode $ \hnd -> do
content <- BS.hGetContents hnd
case PackageIndex.read selectDetails (GZip.decompressNamed indexFile content) of
Left theError ->
error ("Error parsing index at " ++ show indexFile ++ ": "
++ theError)
Right pkgs -> return pkgs
where
indexFile = cacheDir </> "00-index.tar.gz"
selectDetails :: PackageId -> Tar.Entry -> PkgIndexInfo
selectDetails pkgid entry =
PkgIndexInfo
pkgid
(Just time)
(if null username then Nothing else Just (UserName username))
(if userid == 0 then Nothing else Just (UserId userid))
where
time = epochTimeToUTC (Tar.entryTime entry)
username = Tar.ownerName (Tar.entryOwnership entry)
userid = Tar.ownerId (Tar.entryOwnership entry)
epochTimeToUTC :: Tar.EpochTime -> UTCTime
epochTimeToUTC = posixSecondsToUTCTime . realToFrac
-------------------------
-- HTTP utilities
-------------------------
infixr 5 <//>
(<//>) :: URI -> FilePath -> URI
uri <//> path = uri { uriPath = Posix.addTrailingPathSeparator (uriPath uri)
Posix.</> path }
extractURICredentials :: URI -> Maybe (String, String)
extractURICredentials uri
| Just authority <- uriAuthority uri
, (username, ':':passwd0) <- break (==':') (uriUserInfo authority)
, let passwd = takeWhile (/='@') passwd0
, not (null username)
, not (null passwd)
= Just (username, passwd)
extractURICredentials _ = Nothing
removeURICredentials :: URI -> URI
removeURICredentials uri = uri { uriAuthority = fmap (\auth -> auth { uriUserInfo = "" }) (uriAuthority uri) }
provideAuthInfo :: URI -> Maybe (String, String) -> URI -> String -> IO (Maybe (String, String))
provideAuthInfo for_uri credentials = \uri _realm -> do
if uriHostName uri == uriHostName for_uri then return credentials
else return Nothing
uriHostName :: URI -> Maybe String
uriHostName = fmap uriRegName . uriAuthority
type HttpSession a = BrowserAction (HandleStream ByteString) a
httpSession :: Verbosity -> String -> Version -> HttpSession a -> IO a
httpSession verbosity agent version action =
browse $ do
setUserAgent (agent ++ "/" ++ display version)
setErrHandler die
setOutHandler (debug verbosity)
setAllowBasicAuth True
setCheckForProxy True
action
downloadFile :: URI -> FilePath -> HttpSession ()
downloadFile uri file = do
out $ "downloading " ++ show uri ++ " to " ++ file
let etagFile = file <.> "etag"
metag <- liftIO $ catchJustDoesNotExistError
(Just <$> readFile etagFile)
(\_ -> return Nothing)
case metag of
Just etag -> do
let headers = [mkHeader HdrIfNoneMatch (quote etag)]
(_, rsp) <- request (Request uri GET headers BS.empty)
case rspCode rsp of
(3,0,4) -> out $ file ++ " unchanged with ETag " ++ etag
(2,0,0) -> liftIO $ writeDowloadedFileAndEtag rsp
_ -> err (showFailure uri rsp)
Nothing -> do
(_, rsp) <- request (Request uri GET [] BS.empty)
case rspCode rsp of
(2,0,0) -> liftIO $ writeDowloadedFileAndEtag rsp
_ -> err (showFailure uri rsp)
where
writeDowloadedFileAndEtag rsp = do
BS.writeFile file (rspBody rsp)
setETag file (unquote <$> findHeader HdrETag rsp)
getETag :: FilePath -> IO (Maybe String)
getETag file =
catchJustDoesNotExistError
(Just <$> readFile (file </> ".etag"))
(\_ -> return Nothing)
setETag :: FilePath -> Maybe String -> IO ()
setETag file Nothing = catchJustDoesNotExistError
(removeFile (file <.> "etag"))
(\_ -> return ())
setETag file (Just etag) = writeFile (file <.> "etag") etag
catchJustDoesNotExistError :: IO a -> (IOError -> IO a) -> IO a
catchJustDoesNotExistError =
catchJust (\e -> if isDoesNotExistError e then Just e else Nothing)
quote :: String -> String
quote s = '"' : s ++ ['"']
unquote :: String -> String
unquote ('"':s) = go s
where
go [] = []
go ('"':[]) = []
go (c:cs) = c : go cs
unquote s = s
-- AAARG! total lack of exception handling in HTTP monad!
downloadFile' :: URI -> FilePath -> HttpSession Bool
downloadFile' uri file = do
out $ "downloading " ++ show uri ++ " to " ++ file
mcontent <- requestGET' uri
case mcontent of
Nothing -> do out $ "404 " ++ show uri
return False
Just content -> do liftIO $ BS.writeFile file content
return True
requestGET :: URI -> HttpSession ByteString
requestGET uri = do
(_, rsp) <- request (Request uri GET headers BS.empty)
checkStatus uri rsp
return (rspBody rsp)
where
headers = []
-- Really annoying!
requestGET' :: URI -> HttpSession (Maybe ByteString)
requestGET' uri = do
(_, rsp) <- request (Request uri GET headers BS.empty)
case rspCode rsp of
(4,0,4) -> return Nothing
_ -> do checkStatus uri rsp
return (Just (rspBody rsp))
where
headers = []
requestPUTFile :: URI -> String -> Maybe String -> FilePath -> HttpSession ()
requestPUTFile uri mime_type mEncoding file = do
content <- liftIO $ BS.readFile file
requestPUT uri mime_type mEncoding content
requestPOST, requestPUT :: URI -> String -> Maybe String -> ByteString -> HttpSession ()
requestPOST = requestPOSTPUT POST
requestPUT = requestPOSTPUT PUT
requestPOSTPUT :: RequestMethod -> URI -> String -> Maybe String -> ByteString -> HttpSession ()
requestPOSTPUT meth uri mimetype mEncoding body = do
(_, rsp) <- request (Request uri meth headers body)
checkStatus uri rsp
where
headers = [ Header HdrContentLength (show (BS.length body))
, Header HdrContentType mimetype ]
++ case mEncoding of
Nothing -> []
Just encoding -> [ Header HdrContentEncoding encoding ]
checkStatus :: URI -> Response ByteString -> HttpSession ()
checkStatus uri rsp = case rspCode rsp of
-- 200 OK
(2,0,0) -> return ()
-- 201 Created
(2,0,1) -> return ()
-- 201 Created
(2,0,2) -> return ()
-- 204 No Content
(2,0,4) -> return ()
-- 400 Bad Request
(4,0,0) -> liftIO (warn normal (showFailure uri rsp)) >> return ()
-- Other
_code -> err (showFailure uri rsp)
showFailure :: URI -> Response ByteString -> String
showFailure uri rsp =
show (rspCode rsp) ++ " " ++ rspReason rsp ++ show uri
++ case lookupHeader HdrContentType (rspHeaders rsp) of
Just mimetype | "text/plain" `isPrefixOf` mimetype
-> '\n' : (unpackUTF8 . rspBody $ rsp)
_ -> ""
|
mpickering/hackage-server
|
Distribution/Client.hs
|
bsd-3-clause
| 12,323
| 0
| 21
| 3,194
| 3,710
| 1,897
| 1,813
| 277
| 6
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
<helpset version="2.0" xml:lang="sq-AL">
<title>AdvFuzzer Add-On</title>
<maps>
<homeID>top</homeID>
<mapref location="map.jhm"/>
</maps>
<view>
<name>TOC</name>
<label>Contents</label>
<type>org.zaproxy.zap.extension.help.ZapTocView</type>
<data>toc.xml</data>
</view>
<view>
<name>Index</name>
<label>Index</label>
<type>javax.help.IndexView</type>
<data>index.xml</data>
</view>
<view>
<name>Search</name>
<label>Search</label>
<type>javax.help.SearchView</type>
<data engine="com.sun.java.help.search.DefaultSearchEngine">
JavaHelpSearch
</data>
</view>
<view>
<name>Favorites</name>
<label>Favorites</label>
<type>javax.help.FavoritesView</type>
</view>
</helpset>
|
kingthorin/zap-extensions
|
addOns/fuzz/src/main/javahelp/org/zaproxy/zap/extension/fuzz/resources/help_sq_AL/helpset_sq_AL.hs
|
apache-2.0
| 961
| 77
| 67
| 156
| 411
| 208
| 203
| -1
| -1
|
module MultiOccur2 where
idid = id $ id
|
kmate/HaRe
|
old/testing/introNewDef/MultiOccur2.hs
|
bsd-3-clause
| 48
| 0
| 5
| 16
| 13
| 8
| 5
| 2
| 1
|
-- Type inference for literals.
module TiLit where
import BaseSyntaxStruct
--import HasBaseStruct
--import TiPrelude
import TI
import MUtils
{-
instance (TypeId i,ValueId i,Fresh i,
--HasBaseStruct e (EI i e' p ds t c),
HasLit e,
HasTypeApp i e)
=> TypeCheck i HsLiteral (Typed i e) where
tc = tcLit
-}
-- Overloaded literals:
tcLit r s l =
case l of
HsInt _ -> instPrel_srcloc s "fromInteger" `tapp` tl
HsFrac _ -> instPrel_srcloc s "fromRational" `tapp` tl
_ -> tl
where
tl = emap r # tcLit0 l
-- Non-overloaded literals:
tcLit0 lit = do t <- tLit lit
lit >: t
-- Types of non-overloaded literals:
tLit lit =
case lit of
HsInt _ -> prelTy "Integer"
HsChar _ -> prelTy "Char"
HsString _ -> prelTy "String"
HsFrac _ -> prelTy "Rational"
-- + extensions...
|
forste/haReFork
|
tools/base/TI/TiLit.hs
|
bsd-3-clause
| 849
| 0
| 9
| 229
| 185
| 93
| 92
| 18
| 4
|
module Main where
import Build_doctests (deps)
import Control.Applicative
import Control.Monad
import Data.List
import System.Directory
import System.FilePath
import Test.DocTest
main ::
IO ()
main =
getSources >>= \sources -> doctest $
"-isrc"
: "-idist/build/autogen"
: "-optP-include"
: "-optPdist/build/autogen/cabal_macros.h"
: "-hide-all-packages"
: map ("-package="++) deps ++ sources
getSources :: IO [FilePath]
getSources = filter (isSuffixOf ".hs") <$> go "src"
where
go dir = do
(dirs, files) <- getFilesAndDirectories dir
(files ++) . concat <$> mapM go dirs
getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath])
getFilesAndDirectories dir = do
c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir
(,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c
|
tonymorris/system-command
|
test/doctests.hs
|
bsd-3-clause
| 871
| 0
| 13
| 164
| 277
| 148
| 129
| 27
| 1
|
{-# LANGUAGE DatatypeContexts #-}
-- Killed GHC 5.02.3
-- Confusion about whether the wrapper for a data constructor
-- with a "stupid context" includes the stupid context or not
-- Core lint catches it, but it seg-faults if it runs
module Main where
data Color = Red
| Black
deriving Show
data Ord k => Tree k d = None
| Node{color::Color,
key::k,
item::d,
left::(Tree k d),
right::(Tree k d)}
deriving Show
insert k i t = (insert2 t) {color=Black}
where insert2 None = Node{color=Red,
key=k,
item=i,
left=None,
right=None}
main = print (insert 1 2 None)
|
ezyang/ghc
|
testsuite/tests/typecheck/should_run/tcrun029.hs
|
bsd-3-clause
| 878
| 0
| 10
| 418
| 178
| 107
| 71
| 19
| 1
|
{-# LANGUAGE Safe, Unsafe, Trustworthy #-}
-- | Basic test to see that incompatible flags give a nice error
-- message and ghc do not panic (see issue #11580).
module SafeFlags30 where
f :: Int
f = 1
|
olsner/ghc
|
testsuite/tests/safeHaskell/flags/SafeFlags30.hs
|
bsd-3-clause
| 201
| 0
| 4
| 39
| 17
| 12
| 5
| 4
| 1
|
{-# LANGUAGE RankNTypes #-}
-- A test for rank-3 types
module ShouldCompile where
data Fork a = ForkC a a
mapFork :: forall a1 a2 . (a1 -> a2) -> (Fork a1 -> Fork a2)
mapFork mapA (ForkC a1 a2) = ForkC (mapA a1) (mapA a2)
data SequF s a = EmptyF | ZeroF (s (Fork a)) | OneF a (s (Fork a))
newtype HFix h a = HIn (h (HFix h) a)
type Sequ = HFix SequF
mapSequF :: forall s1 s2 . (forall b1 b2 . (b1 -> b2) -> (s1 b1 -> s2 b2))
-> (forall a1 a2 . (a1 -> a2) -> (SequF s1 a1 -> SequF s2 a2))
mapSequF mapS mapA EmptyF = EmptyF
mapSequF mapS mapA (ZeroF as) = ZeroF (mapS (mapFork mapA) as)
mapSequF mapS mapA (OneF a as)= OneF (mapA a) (mapS (mapFork mapA) as)
mapHFix :: forall h1 h2 . (forall f1 f2 . (forall c1 c2 . (c1 -> c2) -> (f1 c1 -> f2 c2))
-> (forall b1 b2 . (b1 -> b2) -> (h1 f1 b1 -> h2 f2 b2)))
-> (forall a1 a2 . (a1 -> a2) -> (HFix h1 a1 -> HFix h2 a2))
mapHFix mapH mapA (HIn v) = HIn (mapH (mapHFix mapH) mapA v)
mapSequ :: forall a1 a2 . (a1 -> a2) -> (Sequ a1 -> Sequ a2)
mapSequ = mapHFix mapSequF
|
ezyang/ghc
|
testsuite/tests/typecheck/should_compile/tc151.hs
|
bsd-3-clause
| 1,186
| 0
| 15
| 400
| 558
| 300
| 258
| 19
| 1
|
{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable #-}
module Main(main,f) where
import Data.List (isPrefixOf)
import Data.Dynamic
import Control.Exception as E
data Failure = Failure
deriving (Show, Typeable)
instance Exception Failure
test = (E.throw Failure >> return ())
`E.catch`
(\(x::Failure) -> return ())
main :: IO ()
main = print =<< test
f :: Bool -> Bool -> Bool
f True = error "urk"
-- f False = \y -> y
{-
Uderlying cause: we call
catch# thing handler
and expect that (thing state-token) will
- either diverge/throw an exception
- or return (# x,y #)
But it does neither: it returns a PAP, because
thing = \p q. blah
In particular, 'thing = lvl_sxo' is
lvl_sxc :: IO Any
lvl_sxc = error "urk"
lvl_sxo :: IO ()
= lvl_sxc >> return ()
-- inline (>>) --
= (\(eta::S#). case lvl_sxc |> g1 eta of ...) |> g2
where
g1 :: IO Any ~ S# -> (# S#, Any #)
g2 :: S# -> (# S#, () #) -> IO ()
-- case-of-bottomming function --
= (\ (eta::S#). lvl_sxc |> g1 |> ug3) |> g2
where
ug3(unsafe) :: S# -> (S#, Any) ~ (# S#, () #)
This is all fine. But it's crucial that lvl_sxc actually diverges.
Do not eta-expand it to
lvl_sxc :: IO Any
lvl_sxc = \eta. error "urk" |> ug4
where
ug4(unsafe) :: S# -> (# S#, Any #) ~ IO Any
In contrast, if we had
case x of
True -> \a -> 3
False -> error "urk"
we can, and must, eta-expand the error
-}
|
ghc-android/ghc
|
testsuite/tests/simplCore/should_run/T3959.hs
|
bsd-3-clause
| 1,488
| 0
| 9
| 414
| 155
| 87
| 68
| 15
| 1
|
{-# LANGUAGE Trustworthy, NoImplicitPrelude #-}
{-# OPTIONS_GHC -fpackage-trust #-}
-- make sure importing a safe-infered module brings in the
-- pkg trust requirements correctly.
module Check06 ( main' ) where
import safe Check06_A
main' =
let n = mainM 1
in n
|
ghc-android/ghc
|
testsuite/tests/safeHaskell/check/Check06.hs
|
bsd-3-clause
| 274
| 1
| 9
| 54
| 36
| 22
| 14
| 7
| 1
|
{-# LANGUAGE CPP #-}
module Application (app) where
import Prelude ()
import BasicPrelude
import Data.Foldable (for_)
import Control.Concurrent
import Control.Concurrent.STM
import Control.Monad.Trans.State (StateT, runStateT, get, put, modify)
import Control.Error (hush, runEitherT, EitherT(..), left, note, readZ, rightZ, fmapLT, eitherT, hoistEither, throwT, MaybeT(..), maybeT)
import Control.Exception (SomeException(..), AsyncException(ThreadKilled, UserInterrupt))
import Filesystem (getAppConfigDirectory, createTree, isFile)
import Data.Time (getCurrentTime, diffUTCTime, NominalDiffTime, UTCTime)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import UnexceptionalIO (UnexceptionalIO, runUnexceptionalIO)
import qualified UnexceptionalIO
import qualified Data.Text as T
import qualified Data.Map as Map
import System.Log.Logger
import Network.Xmpp
import Network.Xmpp.IM
import Network.DNS.Resolver (defaultResolvConf, ResolvConf(..), FileOrNumericHost(..))
import qualified Filesystem.Path.CurrentOS as FilePath
import qualified Data.UUID.V4 as UUID
import qualified Database.SQLite.Simple as SQLite
import Types
import Nick
import Ping
import Disco
import DelayedDelivery
import MUC
import qualified Accounts
import qualified Messages
import qualified Conversations
import UIMODULE (emit)
import HUBMODULE
forkCatch :: (MonadIO m) => String -> IO () -> m ThreadId
forkCatch descr io = liftIO $ forkIO (io `catch` (\e@(SomeException _) ->
case fromException e of
Just ThreadKilled -> throwIO e
Just UserInterrupt -> throwIO e
_ -> do
emit $ Error $ descr ++ ": " ++ T.unpack (show e)
throwIO e
))
jidForUi :: Jid -> Text
jidForUi jid | (l,d,r) <- jidToTexts jid =
fromMaybe empty l ++ T.pack "@" ++ d ++ T.pack "/" ++ fromMaybe empty r
jidFromUi :: Text -> Maybe Jid
jidFromUi tjid
| T.null tjid = Nothing
| T.last tjid == '/' = jidFromUi $ T.init tjid
| otherwise = jidFromText tjid
updateHub :: (MonadIO m) => SQLite.Connection -> TChan HubRequest -> Bool -> Jid -> Jid -> m ()
updateHub db hubChan notify ajid otherSide = liftIO $ do
now <- getCurrentTime
meta <- Conversations.getConversationMeta db False ajid otherSide
let nick = fromMaybe (jidToText otherSide) $ Conversations.nickname . Conversations.conversation <$> meta
let message = fromMaybe empty $ Conversations.lastMessage <$> meta
let lastRecv = fromMaybe now $ Conversations.lastReceived <$> meta
let unread = fromMaybe 0 $ Conversations.unread <$> meta
let total = fromMaybe 0 $ Conversations.total <$> meta
atomically $ writeTChan hubChan $ UpdateInboxItem notify $ InboxItem
(jidToText $ toBare ajid) (jidToText otherSide)
nick message lastRecv unread total
authSession :: Jid -> Text -> (Session -> XmppFailure -> IO ()) -> [Plugin] -> IO (Either XmppFailure Session)
authSession jid pass onClosed plugins | isJust user' =
session (T.unpack domain) (Just (sasl, resource)) (def {
onConnectionClosed = onClosed,
plugins = plugins,
keepAlive = Nothing,
sessionStreamConfiguration = def {resolvConf = defaultResolvConf {resolvInfo = RCFilePath "app/native/assets/resolv.conf"}}
})
where
resource = resourcepart jid
domain = domainpart jid
Just user = user'
user' = localpart jid
sasl Secured = [scramSha1 user Nothing pass, plain user Nothing pass]
sasl _ = [scramSha1 user Nothing pass]
authSession _ _ _ _ = return $ Left $ XmppAuthFailure AuthOtherFailure
presenceStatus :: Presence -> Maybe (Status, Maybe Text)
presenceStatus p = case (presenceType p, getIMPresence p) of
(Unavailable, Just (IMP {showStatus = Nothing, status = s})) -> Just (Offline, s)
(Available, Just (IMP {showStatus = Nothing, status = s})) -> Just (Online, s)
(_, Just (IMP {showStatus = Just ss, status = s})) -> Just (SS ss, s)
_ -> Nothing
acceptSubscription :: Jid -> Session -> IO (Either XmppFailure ())
acceptSubscription = sendPresence . presenceSubscribed
presenceStream :: TChan RosterRequest -> TChan JidLockingRequest -> Jid -> Session -> IO ()
presenceStream rosterChan lockingChan accountJid s = forever $ do
-- Does not filter out ourselves or other instances of our account
p <- waitForPresence (const True) s
for_ (NickSet . jidForUi <$> presenceFrom p <*> hush (getNick $ presencePayload p)) emit
for_ (presenceFrom p) (atomically . writeTChan lockingChan . JidUnlock)
case (presenceFrom p, presenceType p) of
(Just f, Subscribe) -> do
subbed <- getRosterSubbed rosterChan f
if subbed then void $ acceptSubscription f s else
emit $ SubscriptionRequest $ jidForUi f
(_, _) -> return ()
case (presenceFrom p, presenceStatus p) of
(_,Nothing) -> return ()
(Nothing,_) -> return ()
(Just f, Just (ss,status)) ->
-- f includes resource
emit $ PresenceSet (jidToText $ toBare accountJid) (jidForUi f) (show ss) (maybe T.empty show status)
messageErrors :: Session -> IO ()
messageErrors s = forever $ do
m <- waitForMessageError (const True) s
for_ (messageErrorID m) (emit . MessageErr . show)
ims :: TChan JidLockingRequest -> TChan HubRequest -> SQLite.Connection -> Jid -> Session -> IO ()
ims lockingChan hubChan db jid s = forever $ do
m <- getMessage s
defaultId <- fmap ((T.pack "noStanzaId-" ++) . show) UUID.nextRandom
-- TODO: handle blank from/id ? Inbound shouldn't have it, but shouldn't crash...
let Just from = messageFrom m
let id = fromMaybe defaultId $ messageID m
unless (messageType m == GroupChat) $
atomically $ writeTChan lockingChan $ JidMaybeLock from
let im = getIM m
let subject = fmap subjectContent $ (listToMaybe . imSubject) =<< im
let body = fmap bodyContent $ (listToMaybe . imBody) =<< im
case (subject, body) of
(Nothing, Nothing) -> return () -- ignore completely empty message
_ -> do
Just conversation <- mapInboundConversation db jid m
let otherJid = Conversations.otherSide conversation
thread <- maybe (newThreadID jid) return (fmap threadID $ imThread =<< im)
case getDelay (messagePayload m) of
(Right (Just (Delay stamp _ _))) -> do
[[dupe]] <- SQLite.query db (SQLite.Query $ T.pack "SELECT COUNT(1) FROM messages WHERE datetime(receivedAt) > datetime(?, '-10 seconds') AND datetime(receivedAt) < datetime(?, '+10 seconds') AND body=?") (stamp, stamp, body)
when (dupe < (1 :: Int)) $ do
eitherT (emit . Error . T.unpack . show) return $
Messages.insert db True $ Messages.Message from jid otherJid thread id (messageType m) Messages.Received (fmap show subject) body stamp
emit $ ChatMessage (jidToText $ toBare jid) (jidForUi otherJid) thread (jidForUi from) id (fromMaybe T.empty subject) (fromMaybe T.empty body)
updateHub db hubChan (messageType m /= GroupChat) (toBare jid) otherJid
_ -> do
receivedAt <- getCurrentTime
eitherT (emit . Error . T.unpack . show) return $
Messages.insert db True $ Messages.Message from jid otherJid thread id (messageType m) Messages.Received (fmap show subject) body receivedAt
emit $ ChatMessage (jidToText $ toBare jid) (jidForUi otherJid) thread (jidForUi from) id (fromMaybe T.empty subject) (fromMaybe T.empty body)
updateHub db hubChan (messageType m /= GroupChat) (toBare jid) otherJid
mapInboundConversation :: SQLite.Connection -> Jid -> Message -> IO (Maybe Conversations.Conversation)
mapInboundConversation db ajid m@(Message {messageFrom = Just from, messageType = GroupChat}) = do
conversation <- maybeT
(Conversations.insert db False defaultConversation >> return defaultConversation)
(return) $
MaybeT $ Conversations.getConversation db True ajid (toBare from)
case subject of
Nothing -> return (Just conversation)
Just s -> let c = conversation { Conversations.nickname = s } in
Conversations.update db c >> return (Just c)
where
subject = fmap subjectContent $ (listToMaybe . imSubject) =<< im
im = getIM m
defaultConversation = Conversations.def ajid from GroupChat
mapInboundConversation db ajid m@(Message {messageFrom = Just from, messageType = messageType}) = do
conversation <- maybeT (do
mc <- Conversations.getConversation db False ajid (toBare from)
case mc of
Just (Conversations.Conversation { Conversations.typ = Conversations.GroupChat }) ->
let
c = defaultConversation {
Conversations.otherSide = from,
Conversations.nickname = fromMaybe empty $ resourcepart from
}
in Conversations.insert db False c >> return c
Just c -> return c
Nothing -> do
Conversations.insert db False defaultConversation
return defaultConversation
) (return) $
MaybeT $ Conversations.getConversation db False ajid from
case nick of
Nothing -> return (Just conversation)
Just s -> let c = conversation { Conversations.nickname = s } in do
emit $ NickSet (jidForUi from) s
Conversations.update db c >> return (Just c)
where
nick = hush $ getNick $ messagePayload m
defaultConversation = Conversations.def ajid from messageType
mapInboundConversation _ _ _ = return Nothing
newThreadID :: Jid -> IO Text
newThreadID jid = do
uuid <- UUID.nextRandom
return $ show uuid ++ jidToText jid
jidOrError :: (MonadIO m) => Text -> (Jid -> m ()) -> m ()
jidOrError txt io =
case jidFromUi txt of
Just jid -> io jid
Nothing -> liftIO $ emit $ Error $ T.unpack txt ++ " is not a valid JID"
jidParse :: Text -> Either String Jid
jidParse txt = note (T.unpack txt ++ " is not a valid JID") (jidFromUi txt)
connErr :: (Show e) => Jid -> e -> String
connErr jid e = "Connection for " ++ T.unpack (jidToText jid) ++ " failed with: " ++ T.unpack (show e)
signals :: TChan JidLockingRequest -> TChan ConnectionRequest -> TChan HubRequest -> SQLite.Connection -> SignalFromUI -> IO ()
signals _ connectionChan _ db (UpdateAccount jidt pass) = do
eitherT (emit . Error . T.unpack . show) return $
jidOrError jidt (Accounts.update db . (`Accounts.Account` pass))
atomically $ writeTChan connectionChan RefreshAccounts
signals _ connectionChan _ db (RemoveAccount jidt) = do
eitherT (emit . Error . T.unpack . show) return $
jidOrError jidt (Accounts.remove db)
atomically $ writeTChan connectionChan RefreshAccounts
signals _ connectionChan _ _ Ready =
atomically $ writeTChan connectionChan RefreshAccounts
signals _ connectionChan _ _ NetworkChanged =
atomically $ writeTChan connectionChan ReconnectAll
signals lockingChan connectionChan hubChan db (SendChat taccountJid totherSide thread typ body) =
eitherT (emit . Error) return $ do
ajid <- hoistEither (jidParse taccountJid)
otherSide <- hoistEither (jidParse totherSide)
typ' <- readZ $ T.unpack typ
s <- liftIO $ syncCall connectionChan (GetSession ajid)
jid' <- liftIO $ syncCall connectionChan (GetFullJid ajid)
jid <- case jid' of
Left XmppNoStream -> return ajid
Left e -> throwT $ T.unpack $ show e
Right jid -> return jid
-- Stanza id
mid <- liftIO $ newThreadID jid
thread' <- if thread == empty then liftIO (newThreadID jid) else return thread
to <- if typ' == GroupChat then return $ toBare otherSide else
liftIO $ syncCall lockingChan (JidGetLocked otherSide)
receivedAt <- liftIO $ getCurrentTime
when (typ' /= GroupChat) $
Conversations.insert db True ((Conversations.def jid otherSide typ') { Conversations.otherSide = otherSide })
fmapLT (T.unpack . show) $
Messages.send db s $ Messages.Message jid to otherSide thread' mid typ' Messages.Pending Nothing (Just body) receivedAt
liftIO $ emit $ ChatMessage (jidToText $ toBare ajid) (jidForUi $ toBare to) thread (jidForUi jid) (show mid) T.empty body
updateHub db hubChan False (toBare ajid) otherSide
signals _ _ hubChan db (ChatActive taccountJid totherSide) =
eitherT (emit . Error) return $ do
ajid <- hoistEither (jidParse taccountJid)
otherSide <- hoistEither (jidParse totherSide)
Messages.updateStatus db otherSide Messages.Received Messages.ReceivedOld
updateHub db hubChan False (toBare ajid) otherSide
signals _ connectionChan _ _ (AcceptSubscription taccountJid jidt) =
eitherT (emit . Error) return $ do
ajid <- hoistEither (jidParse taccountJid)
s <- fmapLT (connErr ajid) $ EitherT $ syncCall connectionChan (GetSession ajid)
liftIO $ void $ acceptSubscription jid s
where
Just jid = jidFromUi jidt
signals _ connectionChan _ db (JoinMUC taccountjid tmucjid) =
case (jidFromUi taccountjid, jidFromUi tmucjid) of
(Nothing, _) -> emit $ Error $ "Invalid account JID when joining MUC: " ++ T.unpack taccountjid
(_, Nothing) -> emit $ Error $ "Invalid MUC JID: " ++ T.unpack tmucjid
(Just accountjid, Just mucjid) -> do
let mucjid' = case jidToTexts mucjid of
(_, _, Just _) -> mucjid
(l, d, Nothing) -> let Just jid = jidFromTexts l d (localpart accountjid) in jid
maybeS <- syncCall connectionChan (GetSession accountjid)
case maybeS of
Left _ -> emit $ Error $ "Not connected"
Right s -> joinMUC db s (toBare accountjid) mucjid'
joinMUC :: SQLite.Connection -> Session -> Jid -> Jid -> IO ()
joinMUC db s ajid mucjid = do
Conversations.insert db True ((Conversations.def ajid mucjid GroupChat) { Conversations.otherSide = mucjid })
eitherT (emit . Error . T.unpack . show) return $ EitherT $
sendPresence (MUC.joinPresence mucjid) s
data RosterRequest = RosterSubbed Jid (TMVar Bool)
rosterServer :: TChan RosterRequest -> Map Jid Item -> IO ()
rosterServer chan = next
where
next roster = atomically (readTChan chan) >>= msg
where
msg (RosterSubbed jid reply) = do
atomically $ putTMVar reply $ case Map.lookup (toBare jid) roster of
Just (Item {riApproved = True}) -> True
Just (Item {riSubscription = From}) -> True
Just (Item {riSubscription = Both}) -> True
_ -> False
next roster
data JidLockingRequest = JidMaybeLock Jid | JidUnlock Jid | JidGetLocked Jid (TMVar Jid)
jidLockingServer :: TChan JidLockingRequest -> IO ()
jidLockingServer chan = next Map.empty
where
next locks = atomically (readTChan chan) >>= msg
where
-- Lock if unlocked or passed jid is the same, unlock otherwise
msg (JidMaybeLock jid) = next $ Map.alter (maybe (Just jid)
(\exist -> if exist == jid then Just jid else Nothing)
) (toBare jid) locks
-- Always unlock
msg (JidUnlock jid) = next $ Map.delete (toBare jid) locks
-- Get the locked JID if there is one, or else the bare JID
msg (JidGetLocked jid reply) = do
let jid' = toBare jid
atomically $ putTMVar reply (fromMaybe jid' $ Map.lookup jid' locks)
next locks
syncCall' :: TChan a -> (TMVar b -> a) -> STM (TMVar b)
syncCall' chan cons = do
reply <- newEmptyTMVar
writeTChan chan (cons reply)
return reply
syncCall :: TChan a -> (TMVar b -> a) -> IO b
syncCall chan cons = atomically (syncCall' chan cons) >>=
atomically . takeTMVar
getRosterSubbed :: TChan RosterRequest -> Jid -> IO Bool
getRosterSubbed chan jid = syncCall chan (RosterSubbed jid)
data ConnectionRequest =
RefreshAccounts |
GetSession Jid (TMVar (Either XmppFailure Session)) |
GetFullJid Jid (TMVar (Either XmppFailure Jid)) |
Reconnect Jid |
DoneClosing Jid |
ReconnectAll |
PingDone Jid NominalDiffTime |
MaybePing
data Connection = Connection {
connectionSession :: Session,
connectionJid :: Jid,
connectionCleanup :: UnexceptionalIO ()
}
afterConnect :: SQLite.Connection -> Connection -> IO (Either XmppFailure (Jid, Roster))
afterConnect db (Connection session jid _) = do
jid' <- fmap (fromMaybe jid) (getJid session)
-- Get roster and emit to UI
roster <- liftIO $ getRoster session
liftIO $ mapM_ (\(_,Item {riJid = j, riName = n}) -> do
Conversations.insert db True (Conversations.Conversation
(toBare jid') j Conversations.Chat Conversations.Hidden
(fromMaybe (fromMaybe (jidToText j) $ localpart j) n)
)
emit $ PresenceSet (jidToText $ toBare jid') (jidForUi j) (T.pack "Offline") T.empty
maybe (return ()) (emit . NickSet (jidForUi j)) n
) $ Map.toList (items roster)
-- Now send presence, so that we get presence from others
result <- (fmap . fmap) (const (jid', roster)) $ sendPresence initialPresence session
-- Re-join MUCs
mapM_ (\(Conversations.Conversation { Conversations.otherSide = jid }) ->
joinMUC db session (toBare jid') jid
) =<< Conversations.getConversations db (toBare jid') Conversations.GroupChat
-- Re-try pending messages
eitherT (emit . Error . T.unpack . show) return $ mapM_ (
Messages.resend db (Right session)
) =<< Messages.getMessages db jid' Messages.Pending
return result
where
initialPresence = withIMPresence (IMP Nothing Nothing (Just 0)) presenceOnline
doReconnect :: SQLite.Connection -> Connection -> IO ()
doReconnect db c@(Connection session _ _) = do
result <- reconnectNow session
case result of
Just _ -> void $ reconnect' session
Nothing -> return ()
result <- afterConnect db c
case result of
Left _ -> doReconnect db c
Right _ -> return ()
maybeConnect :: (MonadIO m) => TChan JidLockingRequest -> TChan ConnectionRequest -> TChan HubRequest-> SQLite.Connection -> Accounts.Account -> Maybe Connection -> m (Either XmppFailure Connection)
maybeConnect lc cc hc db (Accounts.Account jid pass) Nothing = liftIO $ runEitherT $ do
session <- EitherT $ authSession jid pass (\s _ -> doReconnect db $ Connection s jid (return ()))
-- Plugins to check if it's reasonable to ping every time we have the radio on anyway
[(\out -> return $ Plugin'
(\stanza anns -> atomically (writeTChan cc MaybePing) >> return [(stanza, anns)])
(\stanza -> atomically (writeTChan cc MaybePing) >> out stanza)
(const $ return ())
)]
(jid', roster) <- EitherT $ afterConnect db (Connection session jid (return ()))
-- Roster server
rosterChan <- liftIO $ atomically newTChan
rosterThread <- forkCatch ("rosterServer " ++ T.unpack (show jid')) (rosterServer rosterChan (items roster))
-- Stanza handling threads
imThread <- forkCatch ("ims " ++ T.unpack (show jid')) (ims lc hc db jid' session)
errThread <- forkCatch ("messageErrors " ++ T.unpack (show jid')) (messageErrors =<< dupSession session)
pThread <- forkCatch ("presenceStream " ++ T.unpack (show jid')) (presenceStream rosterChan lc jid' =<< dupSession session)
disco <- liftIO $ startDisco (getRosterSubbed rosterChan) [Identity (T.pack "client") (T.pack "handheld") (Just $ T.pack APPNAME) Nothing] session
case disco of
Just disco -> do
pingThread <- forkCatch ("respondToPing " ++ T.unpack (show jid')) (void $ respondToPing (getRosterSubbed rosterChan) disco session)
return $ Connection session jid' (void $ UnexceptionalIO.fromIO $ do -- Ignore exceptions
mapM_ killThread [imThread, errThread, pThread, rosterThread, pingThread]
stopDisco disco
void $ sendPresence presenceOffline session
endSession session
)
Nothing -> do
liftIO $ mapM_ killThread [rosterThread, imThread, errThread, pThread]
left XmppNoStream
maybeConnect _ _ _ _ _ (Just x) = return (Right x)
lookupConnection :: (Functor m, Monad m) => Jid -> StateT (Map Jid ConnectionManagerStateItem) m (Either XmppFailure Connection)
lookupConnection jid =
fmap (fromMaybe (Left XmppNoStream) . fmap cmConnection . Map.lookup (toBare jid)) get
data ConnectionManagerStateItem = CM {
cmConnection :: Either XmppFailure Connection,
cmLastPing :: UTCTime,
cmLastPingR :: NominalDiffTime,
cmClosing :: Bool
}
connectionManager :: TChan ConnectionRequest -> TChan JidLockingRequest -> TChan HubRequest -> SQLite.Connection -> IO ()
connectionManager chan lockingChan hubChan db = void $ runStateT
(forever $ liftIO (atomically $ readTChan chan) >>= msg) empty
where
msg RefreshAccounts = eitherT (emit . Error . T.unpack . show) return $ do
emit AccountsChanged -- Probably, that's why we're here
oldAccounts <- lift get
accounts <- Accounts.get db
when (null accounts) (emit NoAccounts)
-- Add any new accounts, and reconnect any failed accounts
lift . put =<< foldM (\m a@(Accounts.Account jid _) -> do
let oldRef = Map.lookup (toBare jid) oldAccounts
when (isNothing oldRef) (liftIO $ atomically $ writeTChan hubChan (AddHubAccount $ jidToText $ toBare jid))
a' <- maybeConnect lockingChan chan hubChan db a $ do
oa <- rightZ =<< fmap cmConnection oldRef
guard (connectionJid oa == jid) -- do not reuse if resource has changed
return $! oa
return $! Map.insert (toBare jid) (CM a' (posixSecondsToUTCTime 0) 0 False) m
) empty accounts
-- Kill dead threads
mapM_ (\k -> do
liftIO $ atomically $ writeTChan hubChan (RemoveHubAccount $ jidToText $ toBare k)
case Map.lookup k oldAccounts of
Just (CM { cmConnection = Right (Connection _ _ cleanup) }) -> do
liftIO $ runUnexceptionalIO cleanup
_ -> return ()
) (Map.keys oldAccounts \\ map (toBare . Accounts.jid) accounts)
emit AccountsChanged -- In case we made changes
msg (GetSession jid r) =
lookupConnection jid >>= liftIO . atomically . putTMVar r . fmap connectionSession
msg (GetFullJid jid r) =
lookupConnection jid >>= liftIO . atomically . putTMVar r . fmap connectionJid
msg (DoneClosing jid) =
modify (Map.adjust (\st -> st { cmClosing = False }) jid)
msg (Reconnect jid) = do
st <- Map.lookup (toBare jid) <$> get
case st of
Just (CM { cmConnection = (Right (Connection s _ _)), cmClosing = False }) -> do
void $ forkCatch "connectionManager close connection" $ (closeConnection s >> atomically (writeTChan chan $ DoneClosing jid))
modify (Map.adjust (\st -> st { cmClosing = True }) jid)
_ -> return ()
msg ReconnectAll =
get >>= mapM_ (liftIO . atomically . writeTChan chan . Reconnect) . Map.keys
msg (PingDone jid r) =
modify (Map.adjust (\st -> st { cmLastPingR = r }) jid)
msg MaybePing = do
time <- liftIO $ getCurrentTime
put =<< (get >>= Map.traverseWithKey (\jid st@(CM c lastPing lastPingR closing) ->
let Just serverJid = jidFromTexts Nothing (domainpart jid) Nothing in
case c of
Right (Connection s _ _) | diffUTCTime time lastPing > 30 -> do
void $ forkCatch "connectionManager doing a ping" $ do
pingResult <- doPing serverJid s
case pingResult of
Left _ -> atomically $ writeTChan chan (Reconnect jid)
Right r -> atomically $ writeTChan chan (PingDone jid r)
return $! CM c time lastPingR closing
_ -> return st
))
app :: IO (SignalFromUI -> IO ())
app = do
updateGlobalLogger "Pontarius.Xmpp" $ setLevel DEBUG
dir <- getAppConfigDirectory (T.pack APPNAME)
let dbPath = dir </> FilePath.fromText (T.pack "db.sqlite3")
createTree dir
dbExists <- isFile dbPath
db <- SQLite.open (FilePath.encodeString dbPath)
-- WAL mode means we can read and write at the same time
SQLite.execute_ db $ SQLite.Query $ T.pack "PRAGMA journal_mode=WAL"
-- Create tables if the DB is new
unless dbExists $ eitherT (fail . T.unpack . show) return $ do
Accounts.createTable db
Messages.createTable db
Conversations.createTable db
lockingChan <- atomically newTChan
void $ forkCatch "jidLockingServer" (jidLockingServer lockingChan)
hubChan <- atomically newTChan
void $ forkCatch "hubServer" (hubServer hubChan)
connectionChan <- atomically newTChan
void $ forkCatch "connectionManager" (connectionManager connectionChan lockingChan hubChan db)
void $ forkCatch "ping timer" (atomically (writeTChan connectionChan MaybePing) >> threadDelay 270000000)
return (signals lockingChan connectionChan hubChan db)
|
singpolyma/txtmpp
|
Application.hs
|
isc
| 23,365
| 575
| 27
| 4,315
| 8,564
| 4,357
| 4,207
| 436
| 12
|
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.WebGLDrawBuffers
(js_drawBuffersWEBGL, drawBuffersWEBGL,
pattern COLOR_ATTACHMENT0_WEBGL, pattern COLOR_ATTACHMENT1_WEBGL,
pattern COLOR_ATTACHMENT2_WEBGL, pattern COLOR_ATTACHMENT3_WEBGL,
pattern COLOR_ATTACHMENT4_WEBGL, pattern COLOR_ATTACHMENT5_WEBGL,
pattern COLOR_ATTACHMENT6_WEBGL, pattern COLOR_ATTACHMENT7_WEBGL,
pattern COLOR_ATTACHMENT8_WEBGL, pattern COLOR_ATTACHMENT9_WEBGL,
pattern COLOR_ATTACHMENT10_WEBGL, pattern COLOR_ATTACHMENT11_WEBGL,
pattern COLOR_ATTACHMENT12_WEBGL, pattern COLOR_ATTACHMENT13_WEBGL,
pattern COLOR_ATTACHMENT14_WEBGL, pattern COLOR_ATTACHMENT15_WEBGL,
pattern DRAW_BUFFER0_WEBGL, pattern DRAW_BUFFER1_WEBGL,
pattern DRAW_BUFFER2_WEBGL, pattern DRAW_BUFFER3_WEBGL,
pattern DRAW_BUFFER4_WEBGL, pattern DRAW_BUFFER5_WEBGL,
pattern DRAW_BUFFER6_WEBGL, pattern DRAW_BUFFER7_WEBGL,
pattern DRAW_BUFFER8_WEBGL, pattern DRAW_BUFFER9_WEBGL,
pattern DRAW_BUFFER10_WEBGL, pattern DRAW_BUFFER11_WEBGL,
pattern DRAW_BUFFER12_WEBGL, pattern DRAW_BUFFER13_WEBGL,
pattern DRAW_BUFFER14_WEBGL, pattern DRAW_BUFFER15_WEBGL,
pattern MAX_COLOR_ATTACHMENTS_WEBGL,
pattern MAX_DRAW_BUFFERS_WEBGL, WebGLDrawBuffers,
castToWebGLDrawBuffers, gTypeWebGLDrawBuffers)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord)
import Data.Typeable (Typeable)
import GHCJS.Types (JSRef(..), JSString, castRef)
import GHCJS.Foreign (jsNull)
import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..))
import GHCJS.Marshal (ToJSRef(..), FromJSRef(..))
import GHCJS.Marshal.Pure (PToJSRef(..), PFromJSRef(..))
import Control.Monad.IO.Class (MonadIO(..))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import GHCJS.DOM.Types
import Control.Applicative ((<$>))
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName)
import GHCJS.DOM.Enums
foreign import javascript unsafe "$1[\"drawBuffersWEBGL\"]($2)"
js_drawBuffersWEBGL ::
JSRef WebGLDrawBuffers -> JSRef [GLenum] -> IO ()
-- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLDrawBuffers.drawBuffersWEBGL Mozilla WebGLDrawBuffers.drawBuffersWEBGL documentation>
drawBuffersWEBGL ::
(MonadIO m) => WebGLDrawBuffers -> [GLenum] -> m ()
drawBuffersWEBGL self buffers
= liftIO
(toJSRef buffers >>=
\ buffers' ->
js_drawBuffersWEBGL (unWebGLDrawBuffers self) buffers')
pattern COLOR_ATTACHMENT0_WEBGL = 36064
pattern COLOR_ATTACHMENT1_WEBGL = 36065
pattern COLOR_ATTACHMENT2_WEBGL = 36066
pattern COLOR_ATTACHMENT3_WEBGL = 36067
pattern COLOR_ATTACHMENT4_WEBGL = 36068
pattern COLOR_ATTACHMENT5_WEBGL = 36069
pattern COLOR_ATTACHMENT6_WEBGL = 36070
pattern COLOR_ATTACHMENT7_WEBGL = 36071
pattern COLOR_ATTACHMENT8_WEBGL = 36072
pattern COLOR_ATTACHMENT9_WEBGL = 36073
pattern COLOR_ATTACHMENT10_WEBGL = 36074
pattern COLOR_ATTACHMENT11_WEBGL = 36075
pattern COLOR_ATTACHMENT12_WEBGL = 36076
pattern COLOR_ATTACHMENT13_WEBGL = 36077
pattern COLOR_ATTACHMENT14_WEBGL = 36078
pattern COLOR_ATTACHMENT15_WEBGL = 36079
pattern DRAW_BUFFER0_WEBGL = 34853
pattern DRAW_BUFFER1_WEBGL = 34854
pattern DRAW_BUFFER2_WEBGL = 34855
pattern DRAW_BUFFER3_WEBGL = 34856
pattern DRAW_BUFFER4_WEBGL = 34857
pattern DRAW_BUFFER5_WEBGL = 34858
pattern DRAW_BUFFER6_WEBGL = 34859
pattern DRAW_BUFFER7_WEBGL = 34860
pattern DRAW_BUFFER8_WEBGL = 34861
pattern DRAW_BUFFER9_WEBGL = 34862
pattern DRAW_BUFFER10_WEBGL = 34863
pattern DRAW_BUFFER11_WEBGL = 34864
pattern DRAW_BUFFER12_WEBGL = 34865
pattern DRAW_BUFFER13_WEBGL = 34866
pattern DRAW_BUFFER14_WEBGL = 34867
pattern DRAW_BUFFER15_WEBGL = 34868
pattern MAX_COLOR_ATTACHMENTS_WEBGL = 36063
pattern MAX_DRAW_BUFFERS_WEBGL = 34852
|
plow-technologies/ghcjs-dom
|
src/GHCJS/DOM/JSFFI/Generated/WebGLDrawBuffers.hs
|
mit
| 4,043
| 8
| 11
| 564
| 836
| 485
| 351
| 80
| 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.