    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.GModule.Flags
        (

     -- * Flags

    -- ** ModuleFlags #flag:ModuleFlags#

        ModuleFlags(..)                         ,

        ) where

    import Data.GI.Base.ShortPrelude
    import qualified Data.GI.Base.ShortPrelude as SP
    import qualified Data.GI.Base.Overloading as O
    import qualified Prelude as P

    import qualified Data.GI.Base.Attributes as GI.Attributes
    import qualified Data.GI.Base.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    import qualified Data.GI.Base.GClosure as B.GClosure
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GHashTable as B.GHT
    import qualified Data.GI.Base.GVariant as B.GVariant
    import qualified Data.GI.Base.GValue as B.GValue
    import qualified Data.GI.Base.GParamSpec as B.GParamSpec
    import qualified Data.GI.Base.CallStack as B.CallStack
    import qualified Data.GI.Base.Properties as B.Properties
    import qualified Data.GI.Base.Signals as B.Signals
    import qualified Control.Monad.IO.Class as MIO
    import qualified Data.Coerce as Coerce
    import qualified Data.Text as T
    import qualified Data.Kind as DK
    import qualified Data.ByteString.Char8 as B
    import qualified Data.Map as Map
    import qualified Foreign.Ptr as FP
    import qualified GHC.OverloadedLabels as OL
    import qualified GHC.Records as R
    import qualified Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)

    #else

    #endif

    -- Flags ModuleFlags
    -- | Flags passed to @/g_module_open()/@.
    -- Note that these flags are not supported on all platforms.
    data ModuleFlags =
          ModuleFlagsLazy
        -- ^ specifies that symbols are only resolved when
        --     needed. The default action is to bind all symbols when the module
        --     is loaded.
        | ModuleFlagsLocal
        -- ^ specifies that symbols in the module should
        --     not be added to the global name space. The default action on most
        --     platforms is to place symbols in the module in the global name space,
        --     which may cause conflicts with existing symbols.
        | ModuleFlagsMask
        -- ^ mask for all flags.
        | AnotherModuleFlags Int
        -- ^ Catch-all for unknown values
        deriving (Int -> ModuleFlags -> ShowS
    [ModuleFlags] -> ShowS
    ModuleFlags -> String
    (Int -> ModuleFlags -> ShowS)
    -> (ModuleFlags -> String)
    -> ([ModuleFlags] -> ShowS)
    -> Show ModuleFlags
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ModuleFlags -> ShowS
    showsPrec :: Int -> ModuleFlags -> ShowS
    $cshow :: ModuleFlags -> String
    show :: ModuleFlags -> String
    $cshowList :: [ModuleFlags] -> ShowS
    showList :: [ModuleFlags] -> ShowS
    Show, ModuleFlags -> ModuleFlags -> Bool
    (ModuleFlags -> ModuleFlags -> Bool)
    -> (ModuleFlags -> ModuleFlags -> Bool) -> Eq ModuleFlags
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ModuleFlags -> ModuleFlags -> Bool
    == :: ModuleFlags -> ModuleFlags -> Bool
    $c/= :: ModuleFlags -> ModuleFlags -> Bool
    /= :: ModuleFlags -> ModuleFlags -> Bool
    Eq)

    instance P.Enum ModuleFlags where
        fromEnum :: ModuleFlags -> Int
    fromEnum ModuleFlags
    ModuleFlagsLazy = Int
    1
        fromEnum ModuleFlags
    ModuleFlagsLocal = Int
    2
        fromEnum ModuleFlags
    ModuleFlagsMask = Int
    3
        fromEnum (AnotherModuleFlags Int
    k) = Int
    k

        toEnum :: Int -> ModuleFlags
    toEnum Int
    1 = ModuleFlags
    ModuleFlagsLazy
        toEnum Int
    2 = ModuleFlags
    ModuleFlagsLocal
        toEnum Int
    3 = ModuleFlags
    ModuleFlagsMask
        toEnum Int
    k = Int -> ModuleFlags
    AnotherModuleFlags Int
    k

    instance P.Ord ModuleFlags where
        compare :: ModuleFlags -> ModuleFlags -> Ordering
    compare ModuleFlags
    a ModuleFlags
    b = Int -> Int -> Ordering
    forall a. Ord a => a -> a -> Ordering
    P.compare (ModuleFlags -> Int
    forall a. Enum a => a -> Int
    P.fromEnum ModuleFlags
    a) (ModuleFlags -> Int
    forall a. Enum a => a -> Int
    P.fromEnum ModuleFlags
    b)

    instance IsGFlag ModuleFlags