Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- partitionOptReq :: Eq a => [a] -> [a] -> [a] -> ([a], Either [a] [a])
- partitionOptReqIO :: (Show a, Eq a, MonadIO m) => String -> [a] -> [a] -> [a] -> m [a]
- showBits :: forall a. (Show a, FiniteBits a) => a -> String
- (.&&.) :: Bits a => a -> a -> Bool
Sorting things
:: Eq a | |
=> [a] | What do we have available |
-> [a] | Optional desired elements |
-> [a] | Required desired elements |
-> ([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.
:: (Show a, Eq a, MonadIO m) | |
=> String | What are we sorting (Used for a debug message) |
-> [a] | What do we have available |
-> [a] | Optional desired elements |
-> [a] | Required desired elements |
-> m [a] | All the required elements and as many optional elements as possible |
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
showBits :: forall a. (Show a, FiniteBits a) => a -> String Source #
Show valies as a union of their individual bits
>>>
showBits @Int 5
"1 .|. 4"
>>>
showBits @Int 0
"zeroBits"
>>>
import Vulkan.Core10.Enums.QueueFlagBits
>>>
showBits (QUEUE_COMPUTE_BIT .|. QUEUE_GRAPHICS_BIT)
"QUEUE_GRAPHICS_BIT .|. QUEUE_COMPUTE_BIT"