{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Dazzle.Structs.PatternSpec
    ( 

-- * Exported types
    PatternSpec(..)                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [match]("GI.Dazzle.Structs.PatternSpec#g:method:match"), [ref]("GI.Dazzle.Structs.PatternSpec#g:method:ref"), [unref]("GI.Dazzle.Structs.PatternSpec#g:method:unref").
-- 
-- ==== Getters
-- [getText]("GI.Dazzle.Structs.PatternSpec#g:method:getText").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolvePatternSpecMethod                ,
#endif

-- ** getText #method:getText#

#if defined(ENABLE_OVERLOADING)
    PatternSpecGetTextMethodInfo            ,
#endif
    patternSpecGetText                      ,


-- ** match #method:match#

#if defined(ENABLE_OVERLOADING)
    PatternSpecMatchMethodInfo              ,
#endif
    patternSpecMatch                        ,


-- ** new #method:new#

    patternSpecNew                          ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    PatternSpecRefMethodInfo                ,
#endif
    patternSpecRef                          ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    PatternSpecUnrefMethodInfo              ,
#endif
    patternSpecUnref                        ,




    ) 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

-- | Memory-managed wrapper type.
newtype PatternSpec = PatternSpec (SP.ManagedPtr PatternSpec)
    deriving (PatternSpec -> PatternSpec -> Bool
(PatternSpec -> PatternSpec -> Bool)
-> (PatternSpec -> PatternSpec -> Bool) -> Eq PatternSpec
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PatternSpec -> PatternSpec -> Bool
== :: PatternSpec -> PatternSpec -> Bool
$c/= :: PatternSpec -> PatternSpec -> Bool
/= :: PatternSpec -> PatternSpec -> Bool
Eq)

instance SP.ManagedPtrNewtype PatternSpec where
    toManagedPtr :: PatternSpec -> ManagedPtr PatternSpec
toManagedPtr (PatternSpec ManagedPtr PatternSpec
p) = ManagedPtr PatternSpec
p

foreign import ccall "dzl_pattern_spec_get_type" c_dzl_pattern_spec_get_type :: 
    IO GType

type instance O.ParentTypes PatternSpec = '[]
instance O.HasParentTypes PatternSpec

instance B.Types.TypedObject PatternSpec where
    glibType :: IO GType
glibType = IO GType
c_dzl_pattern_spec_get_type

instance B.Types.GBoxed PatternSpec

-- | Convert 'PatternSpec' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe PatternSpec) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_dzl_pattern_spec_get_type
    gvalueSet_ :: Ptr GValue -> Maybe PatternSpec -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PatternSpec
P.Nothing = Ptr GValue -> Ptr PatternSpec -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr PatternSpec
forall a. Ptr a
FP.nullPtr :: FP.Ptr PatternSpec)
    gvalueSet_ Ptr GValue
gv (P.Just PatternSpec
obj) = PatternSpec -> (Ptr PatternSpec -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PatternSpec
obj (Ptr GValue -> Ptr PatternSpec -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe PatternSpec)
gvalueGet_ Ptr GValue
gv = do
        Ptr PatternSpec
ptr <- Ptr GValue -> IO (Ptr PatternSpec)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr PatternSpec)
        if Ptr PatternSpec
ptr Ptr PatternSpec -> Ptr PatternSpec -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr PatternSpec
forall a. Ptr a
FP.nullPtr
        then PatternSpec -> Maybe PatternSpec
forall a. a -> Maybe a
P.Just (PatternSpec -> Maybe PatternSpec)
-> IO PatternSpec -> IO (Maybe PatternSpec)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr PatternSpec -> PatternSpec)
-> Ptr PatternSpec -> IO PatternSpec
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr PatternSpec -> PatternSpec
PatternSpec Ptr PatternSpec
ptr
        else Maybe PatternSpec -> IO (Maybe PatternSpec)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PatternSpec
forall a. Maybe a
P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PatternSpec
type instance O.AttributeList PatternSpec = PatternSpecAttributeList
type PatternSpecAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

-- method PatternSpec::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "keywords"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Dazzle" , name = "PatternSpec" })
-- throws : False
-- Skip return : False

foreign import ccall "dzl_pattern_spec_new" dzl_pattern_spec_new :: 
    CString ->                              -- keywords : TBasicType TUTF8
    IO (Ptr PatternSpec)

-- | /No description available in the introspection data./
patternSpecNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -> m PatternSpec
patternSpecNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m PatternSpec
patternSpecNew Text
keywords = IO PatternSpec -> m PatternSpec
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PatternSpec -> m PatternSpec)
-> IO PatternSpec -> m PatternSpec
forall a b. (a -> b) -> a -> b
$ do
    CString
keywords' <- Text -> IO CString
textToCString Text
keywords
    Ptr PatternSpec
result <- CString -> IO (Ptr PatternSpec)
dzl_pattern_spec_new CString
keywords'
    Text -> Ptr PatternSpec -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"patternSpecNew" Ptr PatternSpec
result
    PatternSpec
result' <- ((ManagedPtr PatternSpec -> PatternSpec)
-> Ptr PatternSpec -> IO PatternSpec
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PatternSpec -> PatternSpec
PatternSpec) Ptr PatternSpec
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
keywords'
    PatternSpec -> IO PatternSpec
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PatternSpec
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method PatternSpec::get_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "PatternSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "dzl_pattern_spec_get_text" dzl_pattern_spec_get_text :: 
    Ptr PatternSpec ->                      -- self : TInterface (Name {namespace = "Dazzle", name = "PatternSpec"})
    IO CString

-- | /No description available in the introspection data./
patternSpecGetText ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    PatternSpec
    -> m T.Text
patternSpecGetText :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PatternSpec -> m Text
patternSpecGetText PatternSpec
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr PatternSpec
self' <- PatternSpec -> IO (Ptr PatternSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PatternSpec
self
    CString
result <- Ptr PatternSpec -> IO CString
dzl_pattern_spec_get_text Ptr PatternSpec
self'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"patternSpecGetText" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    PatternSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PatternSpec
self
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data PatternSpecGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod PatternSpecGetTextMethodInfo PatternSpec signature where
    overloadedMethod = patternSpecGetText

instance O.OverloadedMethodInfo PatternSpecGetTextMethodInfo PatternSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Dazzle.Structs.PatternSpec.patternSpecGetText",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-PatternSpec.html#v:patternSpecGetText"
        })


#endif

-- method PatternSpec::match
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "PatternSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "haystack"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dzl_pattern_spec_match" dzl_pattern_spec_match :: 
    Ptr PatternSpec ->                      -- self : TInterface (Name {namespace = "Dazzle", name = "PatternSpec"})
    CString ->                              -- haystack : TBasicType TUTF8
    IO CInt

-- | /No description available in the introspection data./
patternSpecMatch ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    PatternSpec
    -> T.Text
    -> m Bool
patternSpecMatch :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PatternSpec -> Text -> m Bool
patternSpecMatch PatternSpec
self Text
haystack = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr PatternSpec
self' <- PatternSpec -> IO (Ptr PatternSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PatternSpec
self
    CString
haystack' <- Text -> IO CString
textToCString Text
haystack
    CInt
result <- Ptr PatternSpec -> CString -> IO CInt
dzl_pattern_spec_match Ptr PatternSpec
self' CString
haystack'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    PatternSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PatternSpec
self
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
haystack'
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data PatternSpecMatchMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m) => O.OverloadedMethod PatternSpecMatchMethodInfo PatternSpec signature where
    overloadedMethod = patternSpecMatch

instance O.OverloadedMethodInfo PatternSpecMatchMethodInfo PatternSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Dazzle.Structs.PatternSpec.patternSpecMatch",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-PatternSpec.html#v:patternSpecMatch"
        })


#endif

-- method PatternSpec::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "PatternSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Dazzle" , name = "PatternSpec" })
-- throws : False
-- Skip return : False

foreign import ccall "dzl_pattern_spec_ref" dzl_pattern_spec_ref :: 
    Ptr PatternSpec ->                      -- self : TInterface (Name {namespace = "Dazzle", name = "PatternSpec"})
    IO (Ptr PatternSpec)

-- | /No description available in the introspection data./
patternSpecRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    PatternSpec
    -> m PatternSpec
patternSpecRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PatternSpec -> m PatternSpec
patternSpecRef PatternSpec
self = IO PatternSpec -> m PatternSpec
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PatternSpec -> m PatternSpec)
-> IO PatternSpec -> m PatternSpec
forall a b. (a -> b) -> a -> b
$ do
    Ptr PatternSpec
self' <- PatternSpec -> IO (Ptr PatternSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PatternSpec
self
    Ptr PatternSpec
result <- Ptr PatternSpec -> IO (Ptr PatternSpec)
dzl_pattern_spec_ref Ptr PatternSpec
self'
    Text -> Ptr PatternSpec -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"patternSpecRef" Ptr PatternSpec
result
    PatternSpec
result' <- ((ManagedPtr PatternSpec -> PatternSpec)
-> Ptr PatternSpec -> IO PatternSpec
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr PatternSpec -> PatternSpec
PatternSpec) Ptr PatternSpec
result
    PatternSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PatternSpec
self
    PatternSpec -> IO PatternSpec
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return PatternSpec
result'

#if defined(ENABLE_OVERLOADING)
data PatternSpecRefMethodInfo
instance (signature ~ (m PatternSpec), MonadIO m) => O.OverloadedMethod PatternSpecRefMethodInfo PatternSpec signature where
    overloadedMethod = patternSpecRef

instance O.OverloadedMethodInfo PatternSpecRefMethodInfo PatternSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Dazzle.Structs.PatternSpec.patternSpecRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-PatternSpec.html#v:patternSpecRef"
        })


#endif

-- method PatternSpec::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Dazzle" , name = "PatternSpec" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dzl_pattern_spec_unref" dzl_pattern_spec_unref :: 
    Ptr PatternSpec ->                      -- self : TInterface (Name {namespace = "Dazzle", name = "PatternSpec"})
    IO ()

-- | /No description available in the introspection data./
patternSpecUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    PatternSpec
    -> m ()
patternSpecUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
PatternSpec -> m ()
patternSpecUnref PatternSpec
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr PatternSpec
self' <- PatternSpec -> IO (Ptr PatternSpec)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PatternSpec
self
    Ptr PatternSpec -> IO ()
dzl_pattern_spec_unref Ptr PatternSpec
self'
    PatternSpec -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PatternSpec
self
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data PatternSpecUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod PatternSpecUnrefMethodInfo PatternSpec signature where
    overloadedMethod = patternSpecUnref

instance O.OverloadedMethodInfo PatternSpecUnrefMethodInfo PatternSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Dazzle.Structs.PatternSpec.patternSpecUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-dazzle-1.0.2/docs/GI-Dazzle-Structs-PatternSpec.html#v:patternSpecUnref"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolvePatternSpecMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolvePatternSpecMethod "match" o = PatternSpecMatchMethodInfo
    ResolvePatternSpecMethod "ref" o = PatternSpecRefMethodInfo
    ResolvePatternSpecMethod "unref" o = PatternSpecUnrefMethodInfo
    ResolvePatternSpecMethod "getText" o = PatternSpecGetTextMethodInfo
    ResolvePatternSpecMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePatternSpecMethod t PatternSpec, O.OverloadedMethod info PatternSpec p) => OL.IsLabel t (PatternSpec -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolvePatternSpecMethod t PatternSpec, O.OverloadedMethod info PatternSpec p, R.HasField t PatternSpec p) => R.HasField t PatternSpec p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolvePatternSpecMethod t PatternSpec, O.OverloadedMethodInfo info PatternSpec) => OL.IsLabel t (O.MethodProxy info PatternSpec) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif