HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Misc

  • 4 values

Sorting things

2 declarations
valuepartitionOptReq
  1. :: Eq a
  2. => [a]

    What do we have available

  3. -> [a]

    Optional desired elements

  4. -> [a]

    Required desired elements

  5. -> ([a], Either [a] [a])

    (Missing optional elements, Either (missing required elements) or (all required elements and as many optional elements as possible)

#

From a list of things, take all the required things and as many optional things as possible.

valuepartitionOptReqIO
  1. :: (Show a, Eq a, MonadIO m)
  2. => String

    What are we sorting (Used for a debug message)

  3. -> [a]

    What do we have available

  4. -> [a]

    Optional desired elements

  5. -> [a]

    Required desired elements

  6. -> m ([a], [a])

    All the required elements and as many optional elements as possible, as well as the missing optional elements.

#

Like partitionOptReq.

Will throw an 'IOError in the case of missing things. Details on missing things will be reported in stderr.

This is useful in dealing with layers and extensions.

Bit Utils

2 declarations
valueshowBits :: (Show a, FiniteBits a) => a -> String
#

Show valies as a union of their individual bits

Example1 expression
showBits @Int 5"1 .|. 4"
Example1 expression
showBits @Int 0"zeroBits"
Example2 expressions
import Vulkan.Core10.Enums.QueueFlagBitsshowBits (QUEUE_COMPUTE_BIT .|. QUEUE_GRAPHICS_BIT)"QUEUE_GRAPHICS_BIT .|. QUEUE_COMPUTE_BIT"
value(.&&.) :: Bits a => a -> a -> Bool
#

Check if the intersection of bits is non-zero