    module Data.Bitmask (foldFlags) where

    import Prelude hiding (foldl)

    import Data.Bits
    import Data.Foldable

    foldFlags :: (Bits b, Foldable f, Num b) => (flag -> b) -> f flag -> b
    foldFlags :: (flag -> b) -> f flag -> b
    foldFlags f :: flag -> b
    f = (b -> flag -> b) -> b -> f flag -> b
    forall (t :: * -> *) b a.
    Foldable t =>
    (b -> a -> b) -> b -> t a -> b
    foldl (\a :: b
    a b :: flag
    b -> b
    a b -> b -> b
    forall a. Bits a => a -> a -> a
    .|. flag -> b
    f flag
    b) 0