HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Misc

Contents
  1. Sorting things
  2. Bit Utils
Synopsis

Sorting things

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

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