{-# LANGUAGE CPP, DeriveDataTypeable,
             DeriveGeneric, FlexibleInstances, DefaultSignatures,
             RankNTypes, RoleAnnotations, ScopedTypeVariables,
             MagicHash, KindSignatures, PolyKinds, TypeApplications, DataKinds,
             GADTs, UnboxedTuples, UnboxedSums, TypeOperators,
             Trustworthy, DeriveFunctor, DeriveTraversable,
             BangPatterns, RecordWildCards, ImplicitParams #-}

{-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-}
{-# LANGUAGE TemplateHaskellQuotes #-}
{-# LANGUAGE StandaloneKindSignatures #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  Language.Haskell.Syntax
-- Copyright   :  (c) The University of Glasgow 2003
-- License     :  BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer  :  libraries@haskell.org
-- Stability   :  experimental
-- Portability :  portable
--
-- Abstract syntax definitions for Template Haskell.
--
-----------------------------------------------------------------------------

module Language.Haskell.TH.Syntax
    ( module Language.Haskell.TH.Syntax
      -- * Language extensions
    , module Language.Haskell.TH.LanguageExtensions
    , ForeignSrcLang(..)
    -- * Notes
    -- ** Unresolved Infix
    -- $infix
    ) where

import qualified Data.Fixed as Fixed
import Data.Data hiding (Fixity(..))
import Data.IORef
import System.IO.Unsafe ( unsafePerformIO )
import System.FilePath
import GHC.IO.Unsafe    ( unsafeDupableInterleaveIO )
import Control.Monad (liftM)
import Control.Monad.IO.Class (MonadIO (..))
import Control.Monad.Fix (MonadFix (..))
import Control.Applicative (Applicative(..))
import Control.Exception (BlockedIndefinitelyOnMVar (..), catch, throwIO)
import Control.Exception.Base (FixIOException (..))
import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
import System.IO        ( hPutStrLn, stderr )
import Data.Char        ( isAlpha, isAlphaNum, isUpper, ord )
import Data.Int
import Data.List.NonEmpty ( NonEmpty(..) )
import Data.Void        ( Void, absurd )
import Data.Word
import Data.Ratio
import GHC.CString      ( unpackCString# )
import GHC.Generics     ( Generic )
import GHC.Types        ( Int(..), Word(..), Char(..), Double(..), Float(..),
                          TYPE, RuntimeRep(..), Multiplicity (..) )
import qualified Data.Kind as Kind (Type)
import GHC.Prim         ( Int#, Word#, Char#, Double#, Float#, Addr# )
import GHC.Ptr          ( Ptr, plusPtr )
import GHC.Lexeme       ( startsVarSym, startsVarId )
import GHC.ForeignSrcLang.Type
import Language.Haskell.TH.LanguageExtensions
import Numeric.Natural
import Prelude hiding (Applicative(..))
import Foreign.ForeignPtr
import Foreign.C.String
import Foreign.C.Types

#if __GLASGOW_HASKELL__ >= 901
import GHC.Types ( Levity(..) )
#endif

#if __GLASGOW_HASKELL__ >= 903
import Data.Array.Byte (ByteArray(..))
import GHC.Exts
  ( ByteArray#, unsafeFreezeByteArray#, copyAddrToByteArray#, newByteArray#
  , isByteArrayPinned#, isTrue#, sizeofByteArray#, unsafeCoerce#, byteArrayContents#
  , copyByteArray#, newPinnedByteArray#)
import GHC.ForeignPtr (ForeignPtr(..), ForeignPtrContents(..))
import GHC.ST (ST(..), runST)
#endif

-----------------------------------------------------
--
--              The Quasi class
--
-----------------------------------------------------

class (MonadIO m, MonadFail m) => Quasi m where
  qNewName :: String -> m Name
        -- ^ Fresh names

        -- Error reporting and recovery
  qReport  :: Bool -> String -> m ()    -- ^ Report an error (True) or warning (False)
                                        -- ...but carry on; use 'fail' to stop
  qRecover :: m a -- ^ the error handler
           -> m a -- ^ action which may fail
           -> m a               -- ^ Recover from the monadic 'fail'

        -- Inspect the type-checker's environment
  qLookupName :: Bool -> String -> m (Maybe Name)
       -- True <=> type namespace, False <=> value namespace
  qReify          :: Name -> m Info
  qReifyFixity    :: Name -> m (Maybe Fixity)
  qReifyType      :: Name -> m Type
  qReifyInstances :: Name -> [Type] -> m [Dec]
       -- Is (n tys) an instance?
       -- Returns list of matching instance Decs
       --    (with empty sub-Decs)
       -- Works for classes and type functions
  qReifyRoles         :: Name -> m [Role]
  qReifyAnnotations   :: Data a => AnnLookup -> m [a]
  qReifyModule        :: Module -> m ModuleInfo
  qReifyConStrictness :: Name -> m [DecidedStrictness]

  qLocation :: m Loc

  qRunIO :: IO a -> m a
  qRunIO = IO a -> m a
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO
  -- ^ Input/output (dangerous)
  qGetPackageRoot :: m FilePath

  qAddDependentFile :: FilePath -> m ()

  qAddTempFile :: String -> m FilePath

  qAddTopDecls :: [Dec] -> m ()

  qAddForeignFilePath :: ForeignSrcLang -> String -> m ()

  qAddModFinalizer :: Q () -> m ()

  qAddCorePlugin :: String -> m ()

  qGetQ :: Typeable a => m (Maybe a)

  qPutQ :: Typeable a => a -> m ()

  qIsExtEnabled :: Extension -> m Bool
  qExtsEnabled :: m [Extension]

  qPutDoc :: DocLoc -> String -> m ()
  qGetDoc :: DocLoc -> m (Maybe String)

-----------------------------------------------------
--      The IO instance of Quasi
--
--  This instance is used only when running a Q
--  computation in the IO monad, usually just to
--  print the result.  There is no interesting
--  type environment, so reification isn't going to
--  work.
--
-----------------------------------------------------

instance Quasi IO where
  qNewName :: FilePath -> IO Name
qNewName = FilePath -> IO Name
newNameIO

  qReport :: Bool -> FilePath -> IO ()
qReport Bool
True  FilePath
msg = Handle -> FilePath -> IO ()
hPutStrLn Handle
stderr (FilePath
"Template Haskell error: " FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
msg)
  qReport Bool
False FilePath
msg = Handle -> FilePath -> IO ()
hPutStrLn Handle
stderr (FilePath
"Template Haskell error: " FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
msg)

  qLookupName :: Bool -> FilePath -> IO (Maybe Name)
qLookupName Bool
_ FilePath
_       = FilePath -> IO (Maybe Name)
forall a. FilePath -> IO a
badIO FilePath
"lookupName"
  qReify :: Name -> IO Info
qReify Name
_              = FilePath -> IO Info
forall a. FilePath -> IO a
badIO FilePath
"reify"
  qReifyFixity :: Name -> IO (Maybe Fixity)
qReifyFixity Name
_        = FilePath -> IO (Maybe Fixity)
forall a. FilePath -> IO a
badIO FilePath
"reifyFixity"
  qReifyType :: Name -> IO Type
qReifyType Name
_          = FilePath -> IO Type
forall a. FilePath -> IO a
badIO FilePath
"reifyFixity"
  qReifyInstances :: Name -> [Type] -> IO [Dec]
qReifyInstances Name
_ [Type]
_   = FilePath -> IO [Dec]
forall a. FilePath -> IO a
badIO FilePath
"reifyInstances"
  qReifyRoles :: Name -> IO [Role]
qReifyRoles Name
_         = FilePath -> IO [Role]
forall a. FilePath -> IO a
badIO FilePath
"reifyRoles"
  qReifyAnnotations :: forall a. Data a => AnnLookup -> IO [a]
qReifyAnnotations AnnLookup
_   = FilePath -> IO [a]
forall a. FilePath -> IO a
badIO FilePath
"reifyAnnotations"
  qReifyModule :: Module -> IO ModuleInfo
qReifyModule Module
_        = FilePath -> IO ModuleInfo
forall a. FilePath -> IO a
badIO FilePath
"reifyModule"
  qReifyConStrictness :: Name -> IO [DecidedStrictness]
qReifyConStrictness Name
_ = FilePath -> IO [DecidedStrictness]
forall a. FilePath -> IO a
badIO FilePath
"reifyConStrictness"
  qLocation :: IO Loc
qLocation             = FilePath -> IO Loc
forall a. FilePath -> IO a
badIO FilePath
"currentLocation"
  qRecover :: forall a. IO a -> IO a -> IO a
qRecover IO a
_ IO a
_          = FilePath -> IO a
forall a. FilePath -> IO a
badIO FilePath
"recover" -- Maybe we could fix this?
  qGetPackageRoot :: IO FilePath
qGetPackageRoot       = FilePath -> IO FilePath
forall a. FilePath -> IO a
badIO FilePath
"getProjectRoot"
  qAddDependentFile :: FilePath -> IO ()
qAddDependentFile FilePath
_   = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"addDependentFile"
  qAddTempFile :: FilePath -> IO FilePath
qAddTempFile FilePath
_        = FilePath -> IO FilePath
forall a. FilePath -> IO a
badIO FilePath
"addTempFile"
  qAddTopDecls :: [Dec] -> IO ()
qAddTopDecls [Dec]
_        = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"addTopDecls"
  qAddForeignFilePath :: ForeignSrcLang -> FilePath -> IO ()
qAddForeignFilePath ForeignSrcLang
_ FilePath
_ = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"addForeignFilePath"
  qAddModFinalizer :: Q () -> IO ()
qAddModFinalizer Q ()
_    = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"addModFinalizer"
  qAddCorePlugin :: FilePath -> IO ()
qAddCorePlugin FilePath
_      = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"addCorePlugin"
  qGetQ :: forall a. Typeable a => IO (Maybe a)
qGetQ                 = FilePath -> IO (Maybe a)
forall a. FilePath -> IO a
badIO FilePath
"getQ"
  qPutQ :: forall a. Typeable a => a -> IO ()
qPutQ a
_               = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"putQ"
  qIsExtEnabled :: Extension -> IO Bool
qIsExtEnabled Extension
_       = FilePath -> IO Bool
forall a. FilePath -> IO a
badIO FilePath
"isExtEnabled"
  qExtsEnabled :: IO [Extension]
qExtsEnabled          = FilePath -> IO [Extension]
forall a. FilePath -> IO a
badIO FilePath
"extsEnabled"
  qPutDoc :: DocLoc -> FilePath -> IO ()
qPutDoc DocLoc
_ FilePath
_           = FilePath -> IO ()
forall a. FilePath -> IO a
badIO FilePath
"putDoc"
  qGetDoc :: DocLoc -> IO (Maybe FilePath)
qGetDoc DocLoc
_             = FilePath -> IO (Maybe FilePath)
forall a. FilePath -> IO a
badIO FilePath
"getDoc"

instance Quote IO where
  newName :: FilePath -> IO Name
newName = FilePath -> IO Name
newNameIO

newNameIO :: String -> IO Name
newNameIO :: FilePath -> IO Name
newNameIO FilePath
s = do { Uniq
n <- IORef Uniq -> (Uniq -> (Uniq, Uniq)) -> IO Uniq
forall a b. IORef a -> (a -> (a, b)) -> IO b
atomicModifyIORef' IORef Uniq
counter (\Uniq
x -> (Uniq
x Uniq -> Uniq -> Uniq
forall a. Num a => a -> a -> a
+ Uniq
1, Uniq
x))
                 ; Name -> IO Name
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (FilePath -> Uniq -> Name
mkNameU FilePath
s Uniq
n) }

badIO :: String -> IO a
badIO :: forall a. FilePath -> IO a
badIO FilePath
op = do   { Bool -> FilePath -> IO ()
forall (m :: * -> *). Quasi m => Bool -> FilePath -> m ()
qReport Bool
True (FilePath
"Can't do `" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
op FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"' in the IO monad")
                ; FilePath -> IO a
forall a. FilePath -> IO a
forall (m :: * -> *) a. MonadFail m => FilePath -> m a
fail FilePath
"Template Haskell failure" }

-- Global variable to generate unique symbols
counter :: IORef Uniq
{-# NOINLINE counter #-}
counter :: IORef Uniq
counter = IO (IORef Uniq) -> IORef Uniq
forall a. IO a -> a
unsafePerformIO (Uniq -> IO (IORef Uniq)
forall a. a -> IO (IORef a)
newIORef Uniq
0)


-----------------------------------------------------
--
--              The Q monad
--
-----------------------------------------------------

newtype Q a = Q { forall a. Q a -> forall (m :: * -> *). Quasi m => m a
unQ :: forall m. Quasi m => m a }

-- \"Runs\" the 'Q' monad. Normal users of Template Haskell
-- should not need this function, as the splice brackets @$( ... )@
-- are the usual way of running a 'Q' computation.
--
-- This function is primarily used in GHC internals, and for debugging
-- splices by running them in 'IO'.
--
-- Note that many functions in 'Q', such as 'reify' and other compiler
-- queries, are not supported when running 'Q' in 'IO'; these operations
-- simply fail at runtime. Indeed, the only operations guaranteed to succeed
-- are 'newName', 'runIO', 'reportError' and 'reportWarning'.
runQ :: Quasi m => Q a -> m a
runQ :: forall (m :: * -> *) a. Quasi m => Q a -> m a
runQ (Q forall (m :: * -> *). Quasi m => m a
m) = m a
forall (m :: * -> *). Quasi m => m a
m

instance Monad Q where
  Q forall (m :: * -> *). Quasi m => m a
m >>= :: forall a b. Q a -> (a -> Q b) -> Q b
>>= a -> Q b
k  = (forall (m :: * -> *). Quasi m => m b) -> Q b
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (m a
forall (m :: * -> *). Quasi m => m a
m m a -> (a -> m b) -> m b
forall a b. m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a
x -> Q b -> forall (m :: * -> *). Quasi m => m b
forall a. Q a -> forall (m :: * -> *). Quasi m => m a
unQ (a -> Q b
k a
x))
  >> :: forall a b. Q a -> Q b -> Q b
(>>) = Q a -> Q b -> Q b
forall a b. Q a -> Q b -> Q b
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
(*>)

instance MonadFail Q where
  fail :: forall a. FilePath -> Q a
fail FilePath
s     = Bool -> FilePath -> Q ()
report Bool
True FilePath
s Q () -> Q a -> Q a
forall a b. Q a -> Q b -> Q b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (forall (m :: * -> *). Quasi m => m a) -> Q a
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (FilePath -> m a
forall a. FilePath -> m a
forall (m :: * -> *) a. MonadFail m => FilePath -> m a
fail FilePath
"Q monad failure")

instance Functor Q where
  fmap :: forall a b. (a -> b) -> Q a -> Q b
fmap a -> b
f (Q forall (m :: * -> *). Quasi m => m a
x) = (forall (m :: * -> *). Quasi m => m b) -> Q b
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q ((a -> b) -> m a -> m b
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f m a
forall (m :: * -> *). Quasi m => m a
x)

instance Applicative Q where
  pure :: forall a. a -> Q a
pure a
x = (forall (m :: * -> *). Quasi m => m a) -> Q a
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (a -> m a
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
x)
  Q forall (m :: * -> *). Quasi m => m (a -> b)
f <*> :: forall a b. Q (a -> b) -> Q a -> Q b
<*> Q forall (m :: * -> *). Quasi m => m a
x = (forall (m :: * -> *). Quasi m => m b) -> Q b
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (m (a -> b)
forall (m :: * -> *). Quasi m => m (a -> b)
f m (a -> b) -> m a -> m b
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> m a
forall (m :: * -> *). Quasi m => m a
x)
  Q forall (m :: * -> *). Quasi m => m a
m *> :: forall a b. Q a -> Q b -> Q b
*> Q forall (m :: * -> *). Quasi m => m b
n = (forall (m :: * -> *). Quasi m => m b) -> Q b
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (m a
forall (m :: * -> *). Quasi m => m a
m m a -> m b -> m b
forall a b. m a -> m b -> m b
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> m b
forall (m :: * -> *). Quasi m => m b
n)

-- | @since 2.17.0.0
instance Semigroup a => Semigroup (Q a) where
  <> :: Q a -> Q a -> Q a
(<>) = (a -> a -> a) -> Q a -> Q a -> Q a
forall a b c. (a -> b -> c) -> Q a -> Q b -> Q c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 a -> a -> a
forall a. Semigroup a => a -> a -> a
(<>)

-- | @since 2.17.0.0
instance Monoid a => Monoid (Q a) where
  mempty :: Q a
mempty = a -> Q a
forall a. a -> Q a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
forall a. Monoid a => a
mempty

-- | If the function passed to 'mfix' inspects its argument,
-- the resulting action will throw a 'FixIOException'.
--
-- @since 2.17.0.0
instance MonadFix Q where
  -- We use the same blackholing approach as in fixIO.
  -- See Note [Blackholing in fixIO] in System.IO in base.
  mfix :: forall a. (a -> Q a) -> Q a
mfix a -> Q a
k = do
    MVar a
m <- IO (MVar a) -> Q (MVar a)
forall a. IO a -> Q a
runIO IO (MVar a)
forall a. IO (MVar a)
newEmptyMVar
    a
ans <- IO a -> Q a
forall a. IO a -> Q a
runIO (IO a -> IO a
forall a. IO a -> IO a
unsafeDupableInterleaveIO
             (MVar a -> IO a
forall a. MVar a -> IO a
readMVar MVar a
m IO a -> (BlockedIndefinitelyOnMVar -> IO a) -> IO a
forall e a. Exception e => IO a -> (e -> IO a) -> IO a
`catch` \BlockedIndefinitelyOnMVar
BlockedIndefinitelyOnMVar ->
                                    FixIOException -> IO a
forall e a. Exception e => e -> IO a
throwIO FixIOException
FixIOException))
    a
result <- a -> Q a
k a
ans
    IO () -> Q ()
forall a. IO a -> Q a
runIO (MVar a -> a -> IO ()
forall a. MVar a -> a -> IO ()
putMVar MVar a
m a
result)
    a -> Q a
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
return a
result


-----------------------------------------------------
--
--              The Quote class
--
-----------------------------------------------------



-- | The 'Quote' class implements the minimal interface which is necessary for
-- desugaring quotations.
--
-- * The @Monad m@ superclass is needed to stitch together the different
-- AST fragments.
-- * 'newName' is used when desugaring binding structures such as lambdas
-- to generate fresh names.
--
-- Therefore the type of an untyped quotation in GHC is `Quote m => m Exp`
--
-- For many years the type of a quotation was fixed to be `Q Exp` but by
-- more precisely specifying the minimal interface it enables the `Exp` to
-- be extracted purely from the quotation without interacting with `Q`.
class Monad m => Quote m where
  {- |
  Generate a fresh name, which cannot be captured.

  For example, this:

  @f = $(do
    nm1 <- newName \"x\"
    let nm2 = 'mkName' \"x\"
    return ('LamE' ['VarP' nm1] (LamE [VarP nm2] ('VarE' nm1)))
   )@

  will produce the splice

  >f = \x0 -> \x -> x0

  In particular, the occurrence @VarE nm1@ refers to the binding @VarP nm1@,
  and is not captured by the binding @VarP nm2@.

  Although names generated by @newName@ cannot /be captured/, they can
  /capture/ other names. For example, this:

  >g = $(do
  >  nm1 <- newName "x"
  >  let nm2 = mkName "x"
  >  return (LamE [VarP nm2] (LamE [VarP nm1] (VarE nm2)))
  > )

  will produce the splice

  >g = \x -> \x0 -> x0

  since the occurrence @VarE nm2@ is captured by the innermost binding
  of @x@, namely @VarP nm1@.
  -}
  newName :: String -> m Name

instance Quote Q where
  newName :: FilePath -> Q Name
newName FilePath
s = (forall (m :: * -> *). Quasi m => m Name) -> Q Name
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (FilePath -> m Name
forall (m :: * -> *). Quasi m => FilePath -> m Name
qNewName FilePath
s)

-----------------------------------------------------
--
--              The TExp type
--
-----------------------------------------------------

type TExp :: TYPE r -> Kind.Type
type role TExp nominal   -- See Note [Role of TExp]
newtype TExp a = TExp
  { forall a. TExp a -> Exp
unType :: Exp -- ^ Underlying untyped Template Haskell expression
  }
-- ^ Typed wrapper around an 'Exp'.
--
-- This is the typed representation of terms produced by typed quotes.
--
-- Representation-polymorphic since /template-haskell-2.16.0.0/.

-- | Discard the type annotation and produce a plain Template Haskell
-- expression
--
-- Representation-polymorphic since /template-haskell-2.16.0.0/.
unTypeQ :: forall (r :: RuntimeRep) (a :: TYPE r) m . Quote m => m (TExp a) -> m Exp
unTypeQ :: forall a (m :: * -> *). Quote m => m (TExp a) -> m Exp
unTypeQ m (TExp a)
m = do { TExp Exp
e <- m (TExp a)
m
               ; Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return Exp
e }

-- | Annotate the Template Haskell expression with a type
--
-- This is unsafe because GHC cannot check for you that the expression
-- really does have the type you claim it has.
--
-- Representation-polymorphic since /template-haskell-2.16.0.0/.
unsafeTExpCoerce :: forall (r :: RuntimeRep) (a :: TYPE r) m .
                      Quote m => m Exp -> m (TExp a)
unsafeTExpCoerce :: forall a (m :: * -> *). Quote m => m Exp -> m (TExp a)
unsafeTExpCoerce m Exp
m = do { Exp
e <- m Exp
m
                        ; TExp a -> m (TExp a)
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Exp -> TExp a
forall a. Exp -> TExp a
TExp Exp
e) }

{- Note [Role of TExp]
~~~~~~~~~~~~~~~~~~~~~~
TExp's argument must have a nominal role, not phantom as would
be inferred (#8459).  Consider

  e :: Code Q Age
  e = [|| MkAge 3 ||]

  foo = $(coerce e) + 4::Int

The splice will evaluate to (MkAge 3) and you can't add that to
4::Int. So you can't coerce a (Code Q Age) to a (Code Q Int). -}

-- Code constructor

type Code :: (Kind.Type -> Kind.Type) -> TYPE r -> Kind.Type
type role Code representational nominal   -- See Note [Role of TExp]
newtype Code m a = Code
  { forall (m :: * -> *) a. Code m a -> m (TExp a)
examineCode :: m (TExp a) -- ^ Underlying monadic value
  }
-- ^ Represents an expression which has type @a@, built in monadic context @m@. Built on top of 'TExp', typed
-- expressions allow for type-safe splicing via:
--
--   - typed quotes, written as @[|| ... ||]@ where @...@ is an expression; if
--     that expression has type @a@, then the quotation has type
--     @Quote m => Code m a@
--
--   - typed splices inside of typed quotes, written as @$$(...)@ where @...@
--     is an arbitrary expression of type @Quote m => Code m a@
--
-- Traditional expression quotes and splices let us construct ill-typed
-- expressions:
--
-- >>> fmap ppr $ runQ (unTypeCode [| True == $( [| "foo" |] ) |])
-- GHC.Types.True GHC.Classes.== "foo"
-- >>> GHC.Types.True GHC.Classes.== "foo"
-- <interactive> error:
--     • Couldn't match expected type ‘Bool’ with actual type ‘[Char]’
--     • In the second argument of ‘(==)’, namely ‘"foo"’
--       In the expression: True == "foo"
--       In an equation for ‘it’: it = True == "foo"
--
-- With typed expressions, the type error occurs when /constructing/ the
-- Template Haskell expression:
--
-- >>> fmap ppr $ runQ (unTypeCode [|| True == $$( [|| "foo" ||] ) ||])
-- <interactive> error:
--     • Couldn't match type ‘[Char]’ with ‘Bool’
--       Expected type: Code Q Bool
--         Actual type: Code Q [Char]
--     • In the Template Haskell quotation [|| "foo" ||]
--       In the expression: [|| "foo" ||]
--       In the Template Haskell splice $$([|| "foo" ||])


-- | Unsafely convert an untyped code representation into a typed code
-- representation.
unsafeCodeCoerce :: forall (r :: RuntimeRep) (a :: TYPE r) m .
                      Quote m => m Exp -> Code m a
unsafeCodeCoerce :: forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce m Exp
m = m (TExp a) -> Code m a
forall (m :: * -> *) a. m (TExp a) -> Code m a
Code (m Exp -> m (TExp a)
forall a (m :: * -> *). Quote m => m Exp -> m (TExp a)
unsafeTExpCoerce m Exp
m)

-- | Lift a monadic action producing code into the typed 'Code'
-- representation
liftCode :: forall (r :: RuntimeRep) (a :: TYPE r) m . m (TExp a) -> Code m a
liftCode :: forall a (m :: * -> *). m (TExp a) -> Code m a
liftCode = m (TExp a) -> Code m a
forall (m :: * -> *) a. m (TExp a) -> Code m a
Code

-- | Extract the untyped representation from the typed representation
unTypeCode :: forall (r :: RuntimeRep) (a :: TYPE r) m . Quote m
           => Code m a -> m Exp
unTypeCode :: forall a (m :: * -> *). Quote m => Code m a -> m Exp
unTypeCode = m (TExp a) -> m Exp
forall a (m :: * -> *). Quote m => m (TExp a) -> m Exp
unTypeQ (m (TExp a) -> m Exp)
-> (Code m a -> m (TExp a)) -> Code m a -> m Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Code m a -> m (TExp a)
forall (m :: * -> *) a. Code m a -> m (TExp a)
examineCode

-- | Modify the ambient monad used during code generation. For example, you
-- can use `hoistCode` to handle a state effect:
-- @
--  handleState :: Code (StateT Int Q) a -> Code Q a
--  handleState = hoistCode (flip runState 0)
-- @
hoistCode :: forall m n (r :: RuntimeRep) (a :: TYPE r) . Monad m
          => (forall x . m x -> n x) -> Code m a -> Code n a
hoistCode :: forall (m :: * -> *) (n :: * -> *) a.
Monad m =>
(forall x. m x -> n x) -> Code m a -> Code n a
hoistCode forall x. m x -> n x
f (Code m (TExp a)
a) = n (TExp a) -> Code n a
forall (m :: * -> *) a. m (TExp a) -> Code m a
Code (m (TExp a) -> n (TExp a)
forall x. m x -> n x
f m (TExp a)
a)


-- | Variant of (>>=) which allows effectful computations to be injected
-- into code generation.
bindCode :: forall m a (r :: RuntimeRep) (b :: TYPE r) . Monad m
         => m a -> (a -> Code m b) -> Code m b
bindCode :: forall (m :: * -> *) a b.
Monad m =>
m a -> (a -> Code m b) -> Code m b
bindCode m a
q a -> Code m b
k = m (TExp b) -> Code m b
forall a (m :: * -> *). m (TExp a) -> Code m a
liftCode (m a
q m a -> (a -> m (TExp b)) -> m (TExp b)
forall a b. m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Code m b -> m (TExp b)
forall (m :: * -> *) a. Code m a -> m (TExp a)
examineCode (Code m b -> m (TExp b)) -> (a -> Code m b) -> a -> m (TExp b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Code m b
k)

-- | Variant of (>>) which allows effectful computations to be injected
-- into code generation.
bindCode_ :: forall m a (r :: RuntimeRep) (b :: TYPE r) . Monad m
          => m a -> Code m b -> Code m b
bindCode_ :: forall (m :: * -> *) a b. Monad m => m a -> Code m b -> Code m b
bindCode_ m a
q Code m b
c = m (TExp b) -> Code m b
forall a (m :: * -> *). m (TExp a) -> Code m a
liftCode ( m a
q m a -> m (TExp b) -> m (TExp b)
forall a b. m a -> m b -> m b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Code m b -> m (TExp b)
forall (m :: * -> *) a. Code m a -> m (TExp a)
examineCode Code m b
c)

-- | A useful combinator for embedding monadic actions into 'Code'
-- @
-- myCode :: ... => Code m a
-- myCode = joinCode $ do
--   x <- someSideEffect
--   return (makeCodeWith x)
-- @
joinCode :: forall m (r :: RuntimeRep) (a :: TYPE r) . Monad m
         => m (Code m a) -> Code m a
joinCode :: forall (m :: * -> *) a. Monad m => m (Code m a) -> Code m a
joinCode = (m (Code m a) -> (Code m a -> Code m a) -> Code m a)
-> (Code m a -> Code m a) -> m (Code m a) -> Code m a
forall a b c. (a -> b -> c) -> b -> a -> c
flip m (Code m a) -> (Code m a -> Code m a) -> Code m a
forall (m :: * -> *) a b.
Monad m =>
m a -> (a -> Code m b) -> Code m b
bindCode Code m a -> Code m a
forall a. a -> a
id

----------------------------------------------------
-- Packaged versions for the programmer, hiding the Quasi-ness


-- | Report an error (True) or warning (False),
-- but carry on; use 'fail' to stop.
report  :: Bool -> String -> Q ()
report :: Bool -> FilePath -> Q ()
report Bool
b FilePath
s = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Bool -> FilePath -> m ()
forall (m :: * -> *). Quasi m => Bool -> FilePath -> m ()
qReport Bool
b FilePath
s)
{-# DEPRECATED report "Use reportError or reportWarning instead" #-} -- deprecated in 7.6

-- | Report an error to the user, but allow the current splice's computation to carry on. To abort the computation, use 'fail'.
reportError :: String -> Q ()
reportError :: FilePath -> Q ()
reportError = Bool -> FilePath -> Q ()
report Bool
True

-- | Report a warning to the user, and carry on.
reportWarning :: String -> Q ()
reportWarning :: FilePath -> Q ()
reportWarning = Bool -> FilePath -> Q ()
report Bool
False

-- | Recover from errors raised by 'reportError' or 'fail'.
recover :: Q a -- ^ handler to invoke on failure
        -> Q a -- ^ computation to run
        -> Q a
recover :: forall a. Q a -> Q a -> Q a
recover (Q forall (m :: * -> *). Quasi m => m a
r) (Q forall (m :: * -> *). Quasi m => m a
m) = (forall (m :: * -> *). Quasi m => m a) -> Q a
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (m a -> m a -> m a
forall a. m a -> m a -> m a
forall (m :: * -> *) a. Quasi m => m a -> m a -> m a
qRecover m a
forall (m :: * -> *). Quasi m => m a
r m a
forall (m :: * -> *). Quasi m => m a
m)

-- We don't export lookupName; the Bool isn't a great API
-- Instead we export lookupTypeName, lookupValueName
lookupName :: Bool -> String -> Q (Maybe Name)
lookupName :: Bool -> FilePath -> Q (Maybe Name)
lookupName Bool
ns FilePath
s = (forall (m :: * -> *). Quasi m => m (Maybe Name)) -> Q (Maybe Name)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Bool -> FilePath -> m (Maybe Name)
forall (m :: * -> *). Quasi m => Bool -> FilePath -> m (Maybe Name)
qLookupName Bool
ns FilePath
s)

-- | Look up the given name in the (type namespace of the) current splice's scope. See "Language.Haskell.TH.Syntax#namelookup" for more details.
lookupTypeName :: String -> Q (Maybe Name)
lookupTypeName :: FilePath -> Q (Maybe Name)
lookupTypeName  FilePath
s = (forall (m :: * -> *). Quasi m => m (Maybe Name)) -> Q (Maybe Name)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Bool -> FilePath -> m (Maybe Name)
forall (m :: * -> *). Quasi m => Bool -> FilePath -> m (Maybe Name)
qLookupName Bool
True FilePath
s)

-- | Look up the given name in the (value namespace of the) current splice's scope. See "Language.Haskell.TH.Syntax#namelookup" for more details.
lookupValueName :: String -> Q (Maybe Name)
lookupValueName :: FilePath -> Q (Maybe Name)
lookupValueName FilePath
s = (forall (m :: * -> *). Quasi m => m (Maybe Name)) -> Q (Maybe Name)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Bool -> FilePath -> m (Maybe Name)
forall (m :: * -> *). Quasi m => Bool -> FilePath -> m (Maybe Name)
qLookupName Bool
False FilePath
s)

{-
Note [Name lookup]
~~~~~~~~~~~~~~~~~~
-}
{- $namelookup #namelookup#
The functions 'lookupTypeName' and 'lookupValueName' provide
a way to query the current splice's context for what names
are in scope. The function 'lookupTypeName' queries the type
namespace, whereas 'lookupValueName' queries the value namespace,
but the functions are otherwise identical.

A call @lookupValueName s@ will check if there is a value
with name @s@ in scope at the current splice's location. If
there is, the @Name@ of this value is returned;
if not, then @Nothing@ is returned.

The returned name cannot be \"captured\".
For example:

> f = "global"
> g = $( do
>          Just nm <- lookupValueName "f"
>          [| let f = "local" in $( varE nm ) |]

In this case, @g = \"global\"@; the call to @lookupValueName@
returned the global @f@, and this name was /not/ captured by
the local definition of @f@.

The lookup is performed in the context of the /top-level/ splice
being run. For example:

> f = "global"
> g = $( [| let f = "local" in
>            $(do
>                Just nm <- lookupValueName "f"
>                varE nm
>             ) |] )

Again in this example, @g = \"global\"@, because the call to
@lookupValueName@ queries the context of the outer-most @$(...)@.

Operators should be queried without any surrounding parentheses, like so:

> lookupValueName "+"

Qualified names are also supported, like so:

> lookupValueName "Prelude.+"
> lookupValueName "Prelude.map"

-}


{- | 'reify' looks up information about the 'Name'. It will fail with
a compile error if the 'Name' is not visible. A 'Name' is visible if it is
imported or defined in a prior top-level declaration group. See the
documentation for 'newDeclarationGroup' for more details.

It is sometimes useful to construct the argument name using 'lookupTypeName' or 'lookupValueName'
to ensure that we are reifying from the right namespace. For instance, in this context:

> data D = D

which @D@ does @reify (mkName \"D\")@ return information about? (Answer: @D@-the-type, but don't rely on it.)
To ensure we get information about @D@-the-value, use 'lookupValueName':

> do
>   Just nm <- lookupValueName "D"
>   reify nm

and to get information about @D@-the-type, use 'lookupTypeName'.
-}
reify :: Name -> Q Info
reify :: Name -> Q Info
reify Name
v = (forall (m :: * -> *). Quasi m => m Info) -> Q Info
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> m Info
forall (m :: * -> *). Quasi m => Name -> m Info
qReify Name
v)

{- | @reifyFixity nm@ attempts to find a fixity declaration for @nm@. For
example, if the function @foo@ has the fixity declaration @infixr 7 foo@, then
@reifyFixity 'foo@ would return @'Just' ('Fixity' 7 'InfixR')@. If the function
@bar@ does not have a fixity declaration, then @reifyFixity 'bar@ returns
'Nothing', so you may assume @bar@ has 'defaultFixity'.
-}
reifyFixity :: Name -> Q (Maybe Fixity)
reifyFixity :: Name -> Q (Maybe Fixity)
reifyFixity Name
nm = (forall (m :: * -> *). Quasi m => m (Maybe Fixity))
-> Q (Maybe Fixity)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> m (Maybe Fixity)
forall (m :: * -> *). Quasi m => Name -> m (Maybe Fixity)
qReifyFixity Name
nm)

{- | @reifyType nm@ attempts to find the type or kind of @nm@. For example,
@reifyType 'not@   returns @Bool -> Bool@, and
@reifyType ''Bool@ returns @Type@.
This works even if there's no explicit signature and the type or kind is inferred.
-}
reifyType :: Name -> Q Type
reifyType :: Name -> Q Type
reifyType Name
nm = (forall (m :: * -> *). Quasi m => m Type) -> Q Type
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> m Type
forall (m :: * -> *). Quasi m => Name -> m Type
qReifyType Name
nm)

{- | Template Haskell is capable of reifying information about types and
terms defined in previous declaration groups. Top-level declaration splices break up
declaration groups.

For an example, consider this  code block. We define a datatype @X@ and
then try to call 'reify' on the datatype.

@
module Check where

data X = X
    deriving Eq

$(do
    info <- reify ''X
    runIO $ print info
 )
@

This code fails to compile, noting that @X@ is not available for reification at the site of 'reify'. We can fix this by creating a new declaration group using an empty top-level splice:

@
data X = X
    deriving Eq

$(pure [])

$(do
    info <- reify ''X
    runIO $ print info
 )
@

We provide 'newDeclarationGroup' as a means of documenting this behavior
and providing a name for the pattern.

Since top level splices infer the presence of the @$( ... )@ brackets, we can also write:

@
data X = X
    deriving Eq

newDeclarationGroup

$(do
    info <- reify ''X
    runIO $ print info
 )
@

-}
newDeclarationGroup :: Q [Dec]
newDeclarationGroup :: Q [Dec]
newDeclarationGroup = [Dec] -> Q [Dec]
forall a. a -> Q a
forall (f :: * -> *) a. Applicative f => a -> f a
pure []

{- | @reifyInstances nm tys@ returns a list of all visible instances (see below for "visible")
of @nm tys@. That is,
if @nm@ is the name of a type class, then all instances of this class at the types @tys@
are returned. Alternatively, if @nm@ is the name of a data family or type family,
all instances of this family at the types @tys@ are returned.

Note that this is a \"shallow\" test; the declarations returned merely have
instance heads which unify with @nm tys@, they need not actually be satisfiable.

  - @reifyInstances ''Eq [ 'TupleT' 2 \``AppT`\` 'ConT' ''A \``AppT`\` 'ConT' ''B ]@ contains
    the @instance (Eq a, Eq b) => Eq (a, b)@ regardless of whether @A@ and
    @B@ themselves implement 'Eq'

  - @reifyInstances ''Show [ 'VarT' ('mkName' "a") ]@ produces every available
    instance of 'Eq'

There is one edge case: @reifyInstances ''Typeable tys@ currently always
produces an empty list (no matter what @tys@ are given).

In principle, the *visible* instances are
* all instances defined in a prior top-level declaration group
  (see docs on @newDeclarationGroup@), or
* all instances defined in any module transitively imported by the
  module being compiled

However, actually searching all modules transitively below the one being
compiled is unreasonably expensive, so @reifyInstances@ will report only the
instance for modules that GHC has had some cause to visit during this
compilation.  This is a shortcoming: @reifyInstances@ might fail to report
instances for a type that is otherwise unusued, or instances defined in a
different component.  You can work around this shortcoming by explicitly importing the modules
whose instances you want to be visible. GHC issue <https://gitlab.haskell.org/ghc/ghc/-/issues/20529#note_388980 #20529>
has some discussion around this.

-}
reifyInstances :: Name -> [Type] -> Q [InstanceDec]
reifyInstances :: Name -> [Type] -> Q [Dec]
reifyInstances Name
cls [Type]
tys = (forall (m :: * -> *). Quasi m => m [Dec]) -> Q [Dec]
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> [Type] -> m [Dec]
forall (m :: * -> *). Quasi m => Name -> [Type] -> m [Dec]
qReifyInstances Name
cls [Type]
tys)

{- | @reifyRoles nm@ returns the list of roles associated with the parameters
(both visible and invisible) of
the tycon @nm@. Fails if @nm@ cannot be found or is not a tycon.
The returned list should never contain 'InferR'.

An invisible parameter to a tycon is often a kind parameter. For example, if
we have

@
type Proxy :: forall k. k -> Type
data Proxy a = MkProxy
@

and @reifyRoles Proxy@, we will get @['NominalR', 'PhantomR']@. The 'NominalR' is
the role of the invisible @k@ parameter. Kind parameters are always nominal.
-}
reifyRoles :: Name -> Q [Role]
reifyRoles :: Name -> Q [Role]
reifyRoles Name
nm = (forall (m :: * -> *). Quasi m => m [Role]) -> Q [Role]
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> m [Role]
forall (m :: * -> *). Quasi m => Name -> m [Role]
qReifyRoles Name
nm)

-- | @reifyAnnotations target@ returns the list of annotations
-- associated with @target@.  Only the annotations that are
-- appropriately typed is returned.  So if you have @Int@ and @String@
-- annotations for the same target, you have to call this function twice.
reifyAnnotations :: Data a => AnnLookup -> Q [a]
reifyAnnotations :: forall a. Data a => AnnLookup -> Q [a]
reifyAnnotations AnnLookup
an = (forall (m :: * -> *). Quasi m => m [a]) -> Q [a]
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (AnnLookup -> m [a]
forall a. Data a => AnnLookup -> m [a]
forall (m :: * -> *) a. (Quasi m, Data a) => AnnLookup -> m [a]
qReifyAnnotations AnnLookup
an)

-- | @reifyModule mod@ looks up information about module @mod@.  To
-- look up the current module, call this function with the return
-- value of 'Language.Haskell.TH.Lib.thisModule'.
reifyModule :: Module -> Q ModuleInfo
reifyModule :: Module -> Q ModuleInfo
reifyModule Module
m = (forall (m :: * -> *). Quasi m => m ModuleInfo) -> Q ModuleInfo
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Module -> m ModuleInfo
forall (m :: * -> *). Quasi m => Module -> m ModuleInfo
qReifyModule Module
m)

-- | @reifyConStrictness nm@ looks up the strictness information for the fields
-- of the constructor with the name @nm@. Note that the strictness information
-- that 'reifyConStrictness' returns may not correspond to what is written in
-- the source code. For example, in the following data declaration:
--
-- @
-- data Pair a = Pair a a
-- @
--
-- 'reifyConStrictness' would return @['DecidedLazy', DecidedLazy]@ under most
-- circumstances, but it would return @['DecidedStrict', DecidedStrict]@ if the
-- @-XStrictData@ language extension was enabled.
reifyConStrictness :: Name -> Q [DecidedStrictness]
reifyConStrictness :: Name -> Q [DecidedStrictness]
reifyConStrictness Name
n = (forall (m :: * -> *). Quasi m => m [DecidedStrictness])
-> Q [DecidedStrictness]
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Name -> m [DecidedStrictness]
forall (m :: * -> *). Quasi m => Name -> m [DecidedStrictness]
qReifyConStrictness Name
n)

-- | Is the list of instances returned by 'reifyInstances' nonempty?
--
-- If you're confused by an instance not being visible despite being
-- defined in the same module and above the splice in question, see the
-- docs for 'newDeclarationGroup' for a possible explanation.
isInstance :: Name -> [Type] -> Q Bool
isInstance :: Name -> [Type] -> Q Bool
isInstance Name
nm [Type]
tys = do { [Dec]
decs <- Name -> [Type] -> Q [Dec]
reifyInstances Name
nm [Type]
tys
                       ; Bool -> Q Bool
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool -> Bool
not ([Dec] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [Dec]
decs)) }

-- | The location at which this computation is spliced.
location :: Q Loc
location :: Q Loc
location = (forall (m :: * -> *). Quasi m => m Loc) -> Q Loc
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q m Loc
forall (m :: * -> *). Quasi m => m Loc
qLocation

-- |The 'runIO' function lets you run an I\/O computation in the 'Q' monad.
-- Take care: you are guaranteed the ordering of calls to 'runIO' within
-- a single 'Q' computation, but not about the order in which splices are run.
--
-- Note: for various murky reasons, stdout and stderr handles are not
-- necessarily flushed when the compiler finishes running, so you should
-- flush them yourself.
runIO :: IO a -> Q a
runIO :: forall a. IO a -> Q a
runIO IO a
m = (forall (m :: * -> *). Quasi m => m a) -> Q a
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (IO a -> m a
forall a. IO a -> m a
forall (m :: * -> *) a. Quasi m => IO a -> m a
qRunIO IO a
m)

-- | Get the package root for the current package which is being compiled.
-- This can be set explicitly with the -package-root flag but is normally
-- just the current working directory.
--
-- The motivation for this flag is to provide a principled means to remove the
-- assumption from splices that they will be executed in the directory where the
-- cabal file resides. Projects such as haskell-language-server can't and don't
-- change directory when compiling files but instead set the -package-root flag
-- appropiately.
getPackageRoot :: Q FilePath
getPackageRoot :: Q FilePath
getPackageRoot = (forall (m :: * -> *). Quasi m => m FilePath) -> Q FilePath
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q m FilePath
forall (m :: * -> *). Quasi m => m FilePath
qGetPackageRoot

-- | The input is a filepath, which if relative is offset by the package root.
makeRelativeToProject :: FilePath -> Q FilePath
makeRelativeToProject :: FilePath -> Q FilePath
makeRelativeToProject FilePath
fp | FilePath -> Bool
isRelative FilePath
fp = do
  FilePath
root <- Q FilePath
getPackageRoot
  FilePath -> Q FilePath
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
return (FilePath
root FilePath -> FilePath -> FilePath
</> FilePath
fp)
makeRelativeToProject FilePath
fp = FilePath -> Q FilePath
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
return FilePath
fp



-- | Record external files that runIO is using (dependent upon).
-- The compiler can then recognize that it should re-compile the Haskell file
-- when an external file changes.
--
-- Expects an absolute file path.
--
-- Notes:
--
--   * ghc -M does not know about these dependencies - it does not execute TH.
--
--   * The dependency is based on file content, not a modification time
addDependentFile :: FilePath -> Q ()
addDependentFile :: FilePath -> Q ()
addDependentFile FilePath
fp = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (FilePath -> m ()
forall (m :: * -> *). Quasi m => FilePath -> m ()
qAddDependentFile FilePath
fp)

-- | Obtain a temporary file path with the given suffix. The compiler will
-- delete this file after compilation.
addTempFile :: String -> Q FilePath
addTempFile :: FilePath -> Q FilePath
addTempFile FilePath
suffix = (forall (m :: * -> *). Quasi m => m FilePath) -> Q FilePath
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (FilePath -> m FilePath
forall (m :: * -> *). Quasi m => FilePath -> m FilePath
qAddTempFile FilePath
suffix)

-- | Add additional top-level declarations. The added declarations will be type
-- checked along with the current declaration group.
addTopDecls :: [Dec] -> Q ()
addTopDecls :: [Dec] -> Q ()
addTopDecls [Dec]
ds = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q ([Dec] -> m ()
forall (m :: * -> *). Quasi m => [Dec] -> m ()
qAddTopDecls [Dec]
ds)

-- |
addForeignFile :: ForeignSrcLang -> String -> Q ()
addForeignFile :: ForeignSrcLang -> FilePath -> Q ()
addForeignFile = ForeignSrcLang -> FilePath -> Q ()
addForeignSource
{-# DEPRECATED addForeignFile
               "Use 'Language.Haskell.TH.Syntax.addForeignSource' instead"
  #-} -- deprecated in 8.6

-- | Emit a foreign file which will be compiled and linked to the object for
-- the current module. Currently only languages that can be compiled with
-- the C compiler are supported, and the flags passed as part of -optc will
-- be also applied to the C compiler invocation that will compile them.
--
-- Note that for non-C languages (for example C++) @extern "C"@ directives
-- must be used to get symbols that we can access from Haskell.
--
-- To get better errors, it is recommended to use #line pragmas when
-- emitting C files, e.g.
--
-- > {-# LANGUAGE CPP #-}
-- > ...
-- > addForeignSource LangC $ unlines
-- >   [ "#line " ++ show (__LINE__ + 1) ++ " " ++ show __FILE__
-- >   , ...
-- >   ]
addForeignSource :: ForeignSrcLang -> String -> Q ()
addForeignSource :: ForeignSrcLang -> FilePath -> Q ()
addForeignSource ForeignSrcLang
lang FilePath
src = do
  let suffix :: FilePath
suffix = case ForeignSrcLang
lang of
                 ForeignSrcLang
LangC      -> FilePath
"c"
                 ForeignSrcLang
LangCxx    -> FilePath
"cpp"
                 ForeignSrcLang
LangObjc   -> FilePath
"m"
                 ForeignSrcLang
LangObjcxx -> FilePath
"mm"
                 ForeignSrcLang
LangAsm    -> FilePath
"s"
                 ForeignSrcLang
LangJs     -> FilePath
"js"
                 ForeignSrcLang
RawObject  -> FilePath
"a"
  FilePath
path <- FilePath -> Q FilePath
addTempFile FilePath
suffix
  IO () -> Q ()
forall a. IO a -> Q a
runIO (IO () -> Q ()) -> IO () -> Q ()
forall a b. (a -> b) -> a -> b
$ FilePath -> FilePath -> IO ()
writeFile FilePath
path FilePath
src
  ForeignSrcLang -> FilePath -> Q ()
addForeignFilePath ForeignSrcLang
lang FilePath
path

-- | Same as 'addForeignSource', but expects to receive a path pointing to the
-- foreign file instead of a 'String' of its contents. Consider using this in
-- conjunction with 'addTempFile'.
--
-- This is a good alternative to 'addForeignSource' when you are trying to
-- directly link in an object file.
addForeignFilePath :: ForeignSrcLang -> FilePath -> Q ()
addForeignFilePath :: ForeignSrcLang -> FilePath -> Q ()
addForeignFilePath ForeignSrcLang
lang FilePath
fp = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (ForeignSrcLang -> FilePath -> m ()
forall (m :: * -> *). Quasi m => ForeignSrcLang -> FilePath -> m ()
qAddForeignFilePath ForeignSrcLang
lang FilePath
fp)

-- | Add a finalizer that will run in the Q monad after the current module has
-- been type checked. This only makes sense when run within a top-level splice.
--
-- The finalizer is given the local type environment at the splice point. Thus
-- 'reify' is able to find the local definitions when executed inside the
-- finalizer.
addModFinalizer :: Q () -> Q ()
addModFinalizer :: Q () -> Q ()
addModFinalizer Q ()
act = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Q () -> m ()
forall (m :: * -> *). Quasi m => Q () -> m ()
qAddModFinalizer (Q () -> forall (m :: * -> *). Quasi m => m ()
forall a. Q a -> forall (m :: * -> *). Quasi m => m a
unQ Q ()
act))

-- | Adds a core plugin to the compilation pipeline.
--
-- @addCorePlugin m@ has almost the same effect as passing @-fplugin=m@ to ghc
-- in the command line. The major difference is that the plugin module @m@
-- must not belong to the current package. When TH executes, it is too late
-- to tell the compiler that we needed to compile first a plugin module in the
-- current package.
addCorePlugin :: String -> Q ()
addCorePlugin :: FilePath -> Q ()
addCorePlugin FilePath
plugin = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (FilePath -> m ()
forall (m :: * -> *). Quasi m => FilePath -> m ()
qAddCorePlugin FilePath
plugin)

-- | Get state from the 'Q' monad. Note that the state is local to the
-- Haskell module in which the Template Haskell expression is executed.
getQ :: Typeable a => Q (Maybe a)
getQ :: forall a. Typeable a => Q (Maybe a)
getQ = (forall (m :: * -> *). Quasi m => m (Maybe a)) -> Q (Maybe a)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q m (Maybe a)
forall a. Typeable a => m (Maybe a)
forall (m :: * -> *). Quasi m => m (Maybe a)
forall (m :: * -> *) a. (Quasi m, Typeable a) => m (Maybe a)
qGetQ

-- | Replace the state in the 'Q' monad. Note that the state is local to the
-- Haskell module in which the Template Haskell expression is executed.
putQ :: Typeable a => a -> Q ()
putQ :: forall a. Typeable a => a -> Q ()
putQ a
x = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (a -> m ()
forall a. Typeable a => a -> m ()
forall (m :: * -> *) a. (Quasi m, Typeable a) => a -> m ()
qPutQ a
x)

-- | Determine whether the given language extension is enabled in the 'Q' monad.
isExtEnabled :: Extension -> Q Bool
isExtEnabled :: Extension -> Q Bool
isExtEnabled Extension
ext = (forall (m :: * -> *). Quasi m => m Bool) -> Q Bool
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (Extension -> m Bool
forall (m :: * -> *). Quasi m => Extension -> m Bool
qIsExtEnabled Extension
ext)

-- | List all enabled language extensions.
extsEnabled :: Q [Extension]
extsEnabled :: Q [Extension]
extsEnabled = (forall (m :: * -> *). Quasi m => m [Extension]) -> Q [Extension]
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q m [Extension]
forall (m :: * -> *). Quasi m => m [Extension]
qExtsEnabled

-- | Add Haddock documentation to the specified location. This will overwrite
-- any documentation at the location if it already exists. This will reify the
-- specified name, so it must be in scope when you call it. If you want to add
-- documentation to something that you are currently splicing, you can use
-- 'addModFinalizer' e.g.
--
-- > do
-- >   let nm = mkName "x"
-- >   addModFinalizer $ putDoc (DeclDoc nm) "Hello"
-- >   [d| $(varP nm) = 42 |]
--
-- The helper functions 'withDecDoc' and 'withDecsDoc' will do this for you, as
-- will the 'funD_doc' and other @_doc@ combinators.
-- You most likely want to have the @-haddock@ flag turned on when using this.
-- Adding documentation to anything outside of the current module will cause an
-- error.
putDoc :: DocLoc -> String -> Q ()
putDoc :: DocLoc -> FilePath -> Q ()
putDoc DocLoc
t FilePath
s = (forall (m :: * -> *). Quasi m => m ()) -> Q ()
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (DocLoc -> FilePath -> m ()
forall (m :: * -> *). Quasi m => DocLoc -> FilePath -> m ()
qPutDoc DocLoc
t FilePath
s)

-- | Retreives the Haddock documentation at the specified location, if one
-- exists.
-- It can be used to read documentation on things defined outside of the current
-- module, provided that those modules were compiled with the @-haddock@ flag.
getDoc :: DocLoc -> Q (Maybe String)
getDoc :: DocLoc -> Q (Maybe FilePath)
getDoc DocLoc
n = (forall (m :: * -> *). Quasi m => m (Maybe FilePath))
-> Q (Maybe FilePath)
forall a. (forall (m :: * -> *). Quasi m => m a) -> Q a
Q (DocLoc -> m (Maybe FilePath)
forall (m :: * -> *). Quasi m => DocLoc -> m (Maybe FilePath)
qGetDoc DocLoc
n)

instance MonadIO Q where
  liftIO :: forall a. IO a -> Q a
liftIO = IO a -> Q a
forall a. IO a -> Q a
runIO

instance Quasi Q where
  qNewName :: FilePath -> Q Name
qNewName            = FilePath -> Q Name
forall (m :: * -> *). Quote m => FilePath -> m Name
newName
  qReport :: Bool -> FilePath -> Q ()
qReport             = Bool -> FilePath -> Q ()
report
  qRecover :: forall a. Q a -> Q a -> Q a
qRecover            = Q a -> Q a -> Q a
forall a. Q a -> Q a -> Q a
recover
  qReify :: Name -> Q Info
qReify              = Name -> Q Info
reify
  qReifyFixity :: Name -> Q (Maybe Fixity)
qReifyFixity        = Name -> Q (Maybe Fixity)
reifyFixity
  qReifyType :: Name -> Q Type
qReifyType          = Name -> Q Type
reifyType
  qReifyInstances :: Name -> [Type] -> Q [Dec]
qReifyInstances     = Name -> [Type] -> Q [Dec]
reifyInstances
  qReifyRoles :: Name -> Q [Role]
qReifyRoles         = Name -> Q [Role]
reifyRoles
  qReifyAnnotations :: forall a. Data a => AnnLookup -> Q [a]
qReifyAnnotations   = AnnLookup -> Q [a]
forall a. Data a => AnnLookup -> Q [a]
reifyAnnotations
  qReifyModule :: Module -> Q ModuleInfo
qReifyModule        = Module -> Q ModuleInfo
reifyModule
  qReifyConStrictness :: Name -> Q [DecidedStrictness]
qReifyConStrictness = Name -> Q [DecidedStrictness]
reifyConStrictness
  qLookupName :: Bool -> FilePath -> Q (Maybe Name)
qLookupName         = Bool -> FilePath -> Q (Maybe Name)
lookupName
  qLocation :: Q Loc
qLocation           = Q Loc
location
  qGetPackageRoot :: Q FilePath
qGetPackageRoot     = Q FilePath
getPackageRoot
  qAddDependentFile :: FilePath -> Q ()
qAddDependentFile   = FilePath -> Q ()
addDependentFile
  qAddTempFile :: FilePath -> Q FilePath
qAddTempFile        = FilePath -> Q FilePath
addTempFile
  qAddTopDecls :: [Dec] -> Q ()
qAddTopDecls        = [Dec] -> Q ()
addTopDecls
  qAddForeignFilePath :: ForeignSrcLang -> FilePath -> Q ()
qAddForeignFilePath = ForeignSrcLang -> FilePath -> Q ()
addForeignFilePath
  qAddModFinalizer :: Q () -> Q ()
qAddModFinalizer    = Q () -> Q ()
addModFinalizer
  qAddCorePlugin :: FilePath -> Q ()
qAddCorePlugin      = FilePath -> Q ()
addCorePlugin
  qGetQ :: forall a. Typeable a => Q (Maybe a)
qGetQ               = Q (Maybe a)
forall a. Typeable a => Q (Maybe a)
getQ
  qPutQ :: forall a. Typeable a => a -> Q ()
qPutQ               = a -> Q ()
forall a. Typeable a => a -> Q ()
putQ
  qIsExtEnabled :: Extension -> Q Bool
qIsExtEnabled       = Extension -> Q Bool
isExtEnabled
  qExtsEnabled :: Q [Extension]
qExtsEnabled        = Q [Extension]
extsEnabled
  qPutDoc :: DocLoc -> FilePath -> Q ()
qPutDoc             = DocLoc -> FilePath -> Q ()
putDoc
  qGetDoc :: DocLoc -> Q (Maybe FilePath)
qGetDoc             = DocLoc -> Q (Maybe FilePath)
getDoc


----------------------------------------------------
-- The following operations are used solely in GHC.HsToCore.Quote when
-- desugaring brackets. They are not necessary for the user, who can use
-- ordinary return and (>>=) etc

sequenceQ :: forall m . Monad m => forall a . [m a] -> m [a]
sequenceQ :: forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequenceQ = [m a] -> m [a]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence


-----------------------------------------------------
--
--              The Lift class
--
-----------------------------------------------------

-- | A 'Lift' instance can have any of its values turned into a Template
-- Haskell expression. This is needed when a value used within a Template
-- Haskell quotation is bound outside the Oxford brackets (@[| ... |]@ or
-- @[|| ... ||]@) but not at the top level. As an example:
--
-- > add1 :: Int -> Code Q Int
-- > add1 x = [|| x + 1 ||]
--
-- Template Haskell has no way of knowing what value @x@ will take on at
-- splice-time, so it requires the type of @x@ to be an instance of 'Lift'.
--
-- A 'Lift' instance must satisfy @$(lift x) ≡ x@ and @$$(liftTyped x) ≡ x@
-- for all @x@, where @$(...)@ and @$$(...)@ are Template Haskell splices.
-- It is additionally expected that @'lift' x ≡ 'unTypeCode' ('liftTyped' x)@.
--
-- 'Lift' instances can be derived automatically by use of the @-XDeriveLift@
-- GHC language extension:
--
-- > {-# LANGUAGE DeriveLift #-}
-- > module Foo where
-- >
-- > import Language.Haskell.TH.Syntax
-- >
-- > data Bar a = Bar1 a (Bar a) | Bar2 String
-- >   deriving Lift
--
-- Representation-polymorphic since /template-haskell-2.16.0.0/.
class Lift (t :: TYPE r) where
  -- | Turn a value into a Template Haskell expression, suitable for use in
  -- a splice.
  lift :: Quote m => t -> m Exp
#if __GLASGOW_HASKELL__ >= 901
  default lift :: (r ~ ('BoxedRep 'Lifted), Quote m) => t -> m Exp
#else
  default lift :: (r ~ 'LiftedRep, Quote m) => t -> m Exp
#endif
  lift = Code m t -> m Exp
forall a (m :: * -> *). Quote m => Code m a -> m Exp
unTypeCode (Code m t -> m Exp) -> (t -> Code m t) -> t -> m Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t -> Code m t
forall t (m :: * -> *). (Lift t, Quote m) => t -> Code m t
forall (m :: * -> *). Quote m => t -> Code m t
liftTyped

  -- | Turn a value into a Template Haskell typed expression, suitable for use
  -- in a typed splice.
  --
  -- @since 2.16.0.0
  liftTyped :: Quote m => t -> Code m t


-- If you add any instances here, consider updating test th/TH_Lift
instance Lift Integer where
  liftTyped :: forall (m :: * -> *). Quote m => Uniq -> Code m Uniq
liftTyped Uniq
x = m Exp -> Code m Uniq
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Uniq -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Uniq -> m Exp
lift Uniq
x)
  lift :: forall (m :: * -> *). Quote m => Uniq -> m Exp
lift Uniq
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL Uniq
x))

instance Lift Int where
  liftTyped :: forall (m :: * -> *). Quote m => Int -> Code m Int
liftTyped Int
x = m Exp -> Code m Int
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int -> m Exp
lift Int
x)
  lift :: forall (m :: * -> *). Quote m => Int -> m Exp
lift Int
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x)))

-- | @since 2.16.0.0
instance Lift Int# where
  liftTyped :: forall (m :: * -> *). Quote m => Int# -> Code m Int#
liftTyped Int#
x = m Exp -> Code m Int#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int# -> m Exp
lift Int#
x)
  lift :: forall (m :: * -> *). Quote m => Int# -> m Exp
lift Int#
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntPrimL (Int -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int# -> Int
I# Int#
x))))

instance Lift Int8 where
  liftTyped :: forall (m :: * -> *). Quote m => Int8 -> Code m Int8
liftTyped Int8
x = m Exp -> Code m Int8
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int8 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int8 -> m Exp
lift Int8
x)
  lift :: forall (m :: * -> *). Quote m => Int8 -> m Exp
lift Int8
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int8 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int8
x)))

instance Lift Int16 where
  liftTyped :: forall (m :: * -> *). Quote m => Int16 -> Code m Int16
liftTyped Int16
x = m Exp -> Code m Int16
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int16 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int16 -> m Exp
lift Int16
x)
  lift :: forall (m :: * -> *). Quote m => Int16 -> m Exp
lift Int16
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int16 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int16
x)))

instance Lift Int32 where
  liftTyped :: forall (m :: * -> *). Quote m => Int32 -> Code m Int32
liftTyped Int32
x = m Exp -> Code m Int32
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int32 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int32 -> m Exp
lift Int32
x)
  lift :: forall (m :: * -> *). Quote m => Int32 -> m Exp
lift Int32
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int32 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int32
x)))

instance Lift Int64 where
  liftTyped :: forall (m :: * -> *). Quote m => Int64 -> Code m Int64
liftTyped Int64
x = m Exp -> Code m Int64
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Int64 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Int64 -> m Exp
lift Int64
x)
  lift :: forall (m :: * -> *). Quote m => Int64 -> m Exp
lift Int64
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int64 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int64
x)))

-- | @since 2.16.0.0
instance Lift Word# where
  liftTyped :: forall (m :: * -> *). Quote m => Word# -> Code m Word#
liftTyped Word#
x = m Exp -> Code m Word#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word# -> m Exp
lift Word#
x)
  lift :: forall (m :: * -> *). Quote m => Word# -> m Exp
lift Word#
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
WordPrimL (Word -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word# -> Word
W# Word#
x))))

instance Lift Word where
  liftTyped :: forall (m :: * -> *). Quote m => Word -> Code m Word
liftTyped Word
x = m Exp -> Code m Word
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word -> m Exp
lift Word
x)
  lift :: forall (m :: * -> *). Quote m => Word -> m Exp
lift Word
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Word -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
x)))

instance Lift Word8 where
  liftTyped :: forall (m :: * -> *). Quote m => Word8 -> Code m Word8
liftTyped Word8
x = m Exp -> Code m Word8
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word8 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word8 -> m Exp
lift Word8
x)
  lift :: forall (m :: * -> *). Quote m => Word8 -> m Exp
lift Word8
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Word8 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
x)))

instance Lift Word16 where
  liftTyped :: forall (m :: * -> *). Quote m => Word16 -> Code m Word16
liftTyped Word16
x = m Exp -> Code m Word16
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word16 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word16 -> m Exp
lift Word16
x)
  lift :: forall (m :: * -> *). Quote m => Word16 -> m Exp
lift Word16
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Word16 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word16
x)))

instance Lift Word32 where
  liftTyped :: forall (m :: * -> *). Quote m => Word32 -> Code m Word32
liftTyped Word32
x = m Exp -> Code m Word32
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word32 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word32 -> m Exp
lift Word32
x)
  lift :: forall (m :: * -> *). Quote m => Word32 -> m Exp
lift Word32
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Word32 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
x)))

instance Lift Word64 where
  liftTyped :: forall (m :: * -> *). Quote m => Word64 -> Code m Word64
liftTyped Word64
x = m Exp -> Code m Word64
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Word64 -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Word64 -> m Exp
lift Word64
x)
  lift :: forall (m :: * -> *). Quote m => Word64 -> m Exp
lift Word64
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Word64 -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word64
x)))

instance Lift Natural where
  liftTyped :: forall (m :: * -> *). Quote m => Natural -> Code m Natural
liftTyped Natural
x = m Exp -> Code m Natural
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Natural -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Natural -> m Exp
lift Natural
x)
  lift :: forall (m :: * -> *). Quote m => Natural -> m Exp
lift Natural
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Natural -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Natural
x)))

instance Lift (Fixed.Fixed a) where
  liftTyped :: forall (m :: * -> *). Quote m => Fixed a -> Code m (Fixed a)
liftTyped Fixed a
x = m Exp -> Code m (Fixed a)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Fixed a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Fixed a -> m Exp
lift Fixed a
x)
  lift :: forall (m :: * -> *). Quote m => Fixed a -> m Exp
lift (Fixed.MkFixed Uniq
x) = do
    Exp
ex <- Uniq -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Uniq -> m Exp
lift Uniq
x
    Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE Name
mkFixedName Exp -> Exp -> Exp
`AppE` Exp
ex)
    where
      mkFixedName :: Name
mkFixedName = 'Fixed.MkFixed

instance Integral a => Lift (Ratio a) where
  liftTyped :: forall (m :: * -> *). Quote m => Ratio a -> Code m (Ratio a)
liftTyped Ratio a
x = m Exp -> Code m (Ratio a)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Ratio a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Ratio a -> m Exp
lift Ratio a
x)
  lift :: forall (m :: * -> *). Quote m => Ratio a -> m Exp
lift Ratio a
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Rational -> Lit
RationalL (Ratio a -> Rational
forall a. Real a => a -> Rational
toRational Ratio a
x)))

instance Lift Float where
  liftTyped :: forall (m :: * -> *). Quote m => Float -> Code m Float
liftTyped Float
x = m Exp -> Code m Float
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Float -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Float -> m Exp
lift Float
x)
  lift :: forall (m :: * -> *). Quote m => Float -> m Exp
lift Float
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Rational -> Lit
RationalL (Float -> Rational
forall a. Real a => a -> Rational
toRational Float
x)))

-- | @since 2.16.0.0
instance Lift Float# where
  liftTyped :: forall (m :: * -> *). Quote m => Float# -> Code m Float#
liftTyped Float#
x = m Exp -> Code m Float#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Float# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Float# -> m Exp
lift Float#
x)
  lift :: forall (m :: * -> *). Quote m => Float# -> m Exp
lift Float#
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Rational -> Lit
FloatPrimL (Float -> Rational
forall a. Real a => a -> Rational
toRational (Float# -> Float
F# Float#
x))))

instance Lift Double where
  liftTyped :: forall (m :: * -> *). Quote m => Double -> Code m Double
liftTyped Double
x = m Exp -> Code m Double
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Double -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Double -> m Exp
lift Double
x)
  lift :: forall (m :: * -> *). Quote m => Double -> m Exp
lift Double
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Rational -> Lit
RationalL (Double -> Rational
forall a. Real a => a -> Rational
toRational Double
x)))

-- | @since 2.16.0.0
instance Lift Double# where
  liftTyped :: forall (m :: * -> *). Quote m => Double# -> Code m Double#
liftTyped Double#
x = m Exp -> Code m Double#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Double# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Double# -> m Exp
lift Double#
x)
  lift :: forall (m :: * -> *). Quote m => Double# -> m Exp
lift Double#
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Rational -> Lit
DoublePrimL (Double -> Rational
forall a. Real a => a -> Rational
toRational (Double# -> Double
D# Double#
x))))

instance Lift Char where
  liftTyped :: forall (m :: * -> *). Quote m => Char -> Code m Char
liftTyped Char
x = m Exp -> Code m Char
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Char -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Char -> m Exp
lift Char
x)
  lift :: forall (m :: * -> *). Quote m => Char -> m Exp
lift Char
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Char -> Lit
CharL Char
x))

-- | @since 2.16.0.0
instance Lift Char# where
  liftTyped :: forall (m :: * -> *). Quote m => Char# -> Code m Char#
liftTyped Char#
x = m Exp -> Code m Char#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Char# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Char# -> m Exp
lift Char#
x)
  lift :: forall (m :: * -> *). Quote m => Char# -> m Exp
lift Char#
x = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (Char -> Lit
CharPrimL (Char# -> Char
C# Char#
x)))

instance Lift Bool where
  liftTyped :: forall (m :: * -> *). Quote m => Bool -> Code m Bool
liftTyped Bool
x = m Exp -> Code m Bool
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Bool -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Bool -> m Exp
lift Bool
x)

  lift :: forall (m :: * -> *). Quote m => Bool -> m Exp
lift Bool
True  = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE Name
trueName)
  lift Bool
False = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE Name
falseName)

-- | Produces an 'Addr#' literal from the NUL-terminated C-string starting at
-- the given memory address.
--
-- @since 2.16.0.0
instance Lift Addr# where
  liftTyped :: forall (m :: * -> *). Quote m => Addr# -> Code m Addr#
liftTyped Addr#
x = m Exp -> Code m Addr#
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Addr# -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Addr# -> m Exp
lift Addr#
x)
  lift :: forall (m :: * -> *). Quote m => Addr# -> m Exp
lift Addr#
x
    = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE ([Word8] -> Lit
StringPrimL ((Char -> Word8) -> FilePath -> [Word8]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word8) -> (Char -> Int) -> Char -> Word8
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) (Addr# -> FilePath
unpackCString# Addr#
x))))

#if __GLASGOW_HASKELL__ >= 903

-- |
-- @since 2.19.0.0
instance Lift ByteArray where
  liftTyped :: forall (m :: * -> *). Quote m => ByteArray -> Code m ByteArray
liftTyped ByteArray
x = m Exp -> Code m ByteArray
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (ByteArray -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => ByteArray -> m Exp
lift ByteArray
x)
  lift :: forall (m :: * -> *). Quote m => ByteArray -> m Exp
lift (ByteArray ByteArray#
b) = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return
    (Exp -> Exp -> Exp
AppE (Exp -> Exp -> Exp
AppE (Name -> Exp
VarE Name
addrToByteArrayName) (Lit -> Exp
LitE (Uniq -> Lit
IntegerL (Int -> Uniq
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
len))))
      (Lit -> Exp
LitE (Bytes -> Lit
BytesPrimL (ForeignPtr Word8 -> Word -> Word -> Bytes
Bytes ForeignPtr Word8
ptr Word
0 (Int -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
len)))))
    where
      len# :: Int#
len# = ByteArray# -> Int#
sizeofByteArray# ByteArray#
b
      len :: Int
len = Int# -> Int
I# Int#
len#
      pb :: ByteArray#
      !(ByteArray ByteArray#
pb)
        | Int# -> Bool
isTrue# (ByteArray# -> Int#
isByteArrayPinned# ByteArray#
b) = ByteArray# -> ByteArray
ByteArray ByteArray#
b
        | Bool
otherwise = (forall s. ST s ByteArray) -> ByteArray
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s ByteArray) -> ByteArray)
-> (forall s. ST s ByteArray) -> ByteArray
forall a b. (a -> b) -> a -> b
$ STRep s ByteArray -> ST s ByteArray
forall s a. STRep s a -> ST s a
ST (STRep s ByteArray -> ST s ByteArray)
-> STRep s ByteArray -> ST s ByteArray
forall a b. (a -> b) -> a -> b
$
          \State# s
s -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newPinnedByteArray# Int#
len# State# s
s of
            (# State# s
s', MutableByteArray# s
mb #) -> case ByteArray#
-> Int#
-> MutableByteArray# s
-> Int#
-> Int#
-> State# s
-> State# s
forall d.
ByteArray#
-> Int#
-> MutableByteArray# d
-> Int#
-> Int#
-> State# d
-> State# d
copyByteArray# ByteArray#
b Int#
0# MutableByteArray# s
mb Int#
0# Int#
len# State# s
s' of
              State# s
s'' -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
mb State# s
s'' of
                (# State# s
s''', ByteArray#
ret #) -> (# State# s
s''', ByteArray# -> ByteArray
ByteArray ByteArray#
ret #)
      ptr :: ForeignPtr Word8
      ptr :: ForeignPtr Word8
ptr = Addr# -> ForeignPtrContents -> ForeignPtr Word8
forall a. Addr# -> ForeignPtrContents -> ForeignPtr a
ForeignPtr (ByteArray# -> Addr#
byteArrayContents# ByteArray#
pb) (MutableByteArray# RealWorld -> ForeignPtrContents
PlainPtr (ByteArray# -> MutableByteArray# RealWorld
forall a b. a -> b
unsafeCoerce# ByteArray#
pb))

addrToByteArrayName :: Name
addrToByteArrayName :: Name
addrToByteArrayName = 'addrToByteArray

addrToByteArray :: Int -> Addr# -> ByteArray
addrToByteArray :: Int -> Addr# -> ByteArray
addrToByteArray (I# Int#
len) Addr#
addr = (forall s. ST s ByteArray) -> ByteArray
forall a. (forall s. ST s a) -> a
runST ((forall s. ST s ByteArray) -> ByteArray)
-> (forall s. ST s ByteArray) -> ByteArray
forall a b. (a -> b) -> a -> b
$ STRep s ByteArray -> ST s ByteArray
forall s a. STRep s a -> ST s a
ST (STRep s ByteArray -> ST s ByteArray)
-> STRep s ByteArray -> ST s ByteArray
forall a b. (a -> b) -> a -> b
$
  \State# s
s -> case Int# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray# Int#
len State# s
s of
    (# State# s
s', MutableByteArray# s
mb #) -> case Addr#
-> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
Addr#
-> MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
copyAddrToByteArray# Addr#
addr MutableByteArray# s
mb Int#
0# Int#
len State# s
s' of
      State# s
s'' -> case MutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray# MutableByteArray# s
mb State# s
s'' of
        (# State# s
s''', ByteArray#
ret #) -> (# State# s
s''', ByteArray# -> ByteArray
ByteArray ByteArray#
ret #)

#endif

instance Lift a => Lift (Maybe a) where
  liftTyped :: forall (m :: * -> *). Quote m => Maybe a -> Code m (Maybe a)
liftTyped Maybe a
x = m Exp -> Code m (Maybe a)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Maybe a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Maybe a -> m Exp
lift Maybe a
x)

  lift :: forall (m :: * -> *). Quote m => Maybe a -> m Exp
lift Maybe a
Nothing  = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE Name
nothingName)
  lift (Just a
x) = (Exp -> Exp) -> m Exp -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Name -> Exp
ConE Name
justName Exp -> Exp -> Exp
`AppE`) (a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
x)

instance (Lift a, Lift b) => Lift (Either a b) where
  liftTyped :: forall (m :: * -> *). Quote m => Either a b -> Code m (Either a b)
liftTyped Either a b
x = m Exp -> Code m (Either a b)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (Either a b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => Either a b -> m Exp
lift Either a b
x)

  lift :: forall (m :: * -> *). Quote m => Either a b -> m Exp
lift (Left a
x)  = (Exp -> Exp) -> m Exp -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Name -> Exp
ConE Name
leftName  Exp -> Exp -> Exp
`AppE`) (a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
x)
  lift (Right b
y) = (Exp -> Exp) -> m Exp -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Name -> Exp
ConE Name
rightName Exp -> Exp -> Exp
`AppE`) (b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y)

instance Lift a => Lift [a] where
  liftTyped :: forall (m :: * -> *). Quote m => [a] -> Code m [a]
liftTyped [a]
x = m Exp -> Code m [a]
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ([a] -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => [a] -> m Exp
lift [a]
x)
  lift :: forall (m :: * -> *). Quote m => [a] -> m Exp
lift [a]
xs = do { [Exp]
xs' <- (a -> m Exp) -> [a] -> m [Exp]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift [a]
xs; Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Exp] -> Exp
ListE [Exp]
xs') }

liftString :: Quote m => String -> m Exp
-- Used in GHC.Tc.Gen.Expr to short-circuit the lifting for strings
liftString :: forall (m :: * -> *). Quote m => FilePath -> m Exp
liftString FilePath
s = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE (FilePath -> Lit
StringL FilePath
s))

-- | @since 2.15.0.0
instance Lift a => Lift (NonEmpty a) where
  liftTyped :: forall (m :: * -> *). Quote m => NonEmpty a -> Code m (NonEmpty a)
liftTyped NonEmpty a
x = m Exp -> Code m (NonEmpty a)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (NonEmpty a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => NonEmpty a -> m Exp
lift NonEmpty a
x)

  lift :: forall (m :: * -> *). Quote m => NonEmpty a -> m Exp
lift (a
x :| [a]
xs) = do
    Exp
x' <- a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
x
    Exp
xs' <- [a] -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => [a] -> m Exp
lift [a]
xs
    Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Exp -> Exp -> Maybe Exp -> Exp
InfixE (Exp -> Maybe Exp
forall a. a -> Maybe a
Just Exp
x') (Name -> Exp
ConE Name
nonemptyName) (Exp -> Maybe Exp
forall a. a -> Maybe a
Just Exp
xs'))

-- | @since 2.15.0.0
instance Lift Void where
  liftTyped :: forall (m :: * -> *). Quote m => Void -> Code m Void
liftTyped = m (TExp Void) -> Code m Void
forall a (m :: * -> *). m (TExp a) -> Code m a
liftCode (m (TExp Void) -> Code m Void)
-> (Void -> m (TExp Void)) -> Void -> Code m Void
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Void -> m (TExp Void)
forall a. Void -> a
absurd
  lift :: forall (m :: * -> *). Quote m => Void -> m Exp
lift = Exp -> m Exp
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Exp -> m Exp) -> (Void -> Exp) -> Void -> m Exp
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Void -> Exp
forall a. Void -> a
absurd

instance Lift () where
  liftTyped :: forall (m :: * -> *). Quote m => () -> Code m ()
liftTyped ()
x = m Exp -> Code m ()
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce (() -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => () -> m Exp
lift ()
x)
  lift :: forall (m :: * -> *). Quote m => () -> m Exp
lift () = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE (Int -> Name
tupleDataName Int
0))

instance (Lift a, Lift b) => Lift (a, b) where
  liftTyped :: forall (m :: * -> *). Quote m => (a, b) -> Code m (a, b)
liftTyped (a, b)
x = m Exp -> Code m (a, b)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b) -> m Exp
lift (a, b)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b) -> m Exp
lift (a
a, b
b)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b]

instance (Lift a, Lift b, Lift c) => Lift (a, b, c) where
  liftTyped :: forall (m :: * -> *). Quote m => (a, b, c) -> Code m (a, b, c)
liftTyped (a, b, c)
x = m Exp -> Code m (a, b, c)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b, c) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b, c) -> m Exp
lift (a, b, c)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b, c) -> m Exp
lift (a
a, b
b, c
c)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c]

instance (Lift a, Lift b, Lift c, Lift d) => Lift (a, b, c, d) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(a, b, c, d) -> Code m (a, b, c, d)
liftTyped (a, b, c, d)
x = m Exp -> Code m (a, b, c, d)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b, c, d) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b, c, d) -> m Exp
lift (a, b, c, d)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b, c, d) -> m Exp
lift (a
a, b
b, c
c, d
d)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c, d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d]

instance (Lift a, Lift b, Lift c, Lift d, Lift e)
      => Lift (a, b, c, d, e) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(a, b, c, d, e) -> Code m (a, b, c, d, e)
liftTyped (a, b, c, d, e)
x = m Exp -> Code m (a, b, c, d, e)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b, c, d, e) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b, c, d, e) -> m Exp
lift (a, b, c, d, e)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b, c, d, e) -> m Exp
lift (a
a, b
b, c
c, d
d, e
e)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b
                                              , c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c, d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e ]

instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f)
      => Lift (a, b, c, d, e, f) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(a, b, c, d, e, f) -> Code m (a, b, c, d, e, f)
liftTyped (a, b, c, d, e, f)
x = m Exp -> Code m (a, b, c, d, e, f)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b, c, d, e, f) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b, c, d, e, f) -> m Exp
lift (a, b, c, d, e, f)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b, c, d, e, f) -> m Exp
lift (a
a, b
b, c
c, d
d, e
e, f
f)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c
                                              , d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e, f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
f ]

instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g)
      => Lift (a, b, c, d, e, f, g) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(a, b, c, d, e, f, g) -> Code m (a, b, c, d, e, f, g)
liftTyped (a, b, c, d, e, f, g)
x = m Exp -> Code m (a, b, c, d, e, f, g)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((a, b, c, d, e, f, g) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (a, b, c, d, e, f, g) -> m Exp
lift (a, b, c, d, e, f, g)
x)
  lift :: forall (m :: * -> *). Quote m => (a, b, c, d, e, f, g) -> m Exp
lift (a
a, b
b, c
c, d
d, e
e, f
f, g
g)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
TupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c
                                              , d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e, f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
f, g -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => g -> m Exp
lift g
g ]

-- | @since 2.16.0.0
instance Lift (# #) where
  liftTyped :: forall (m :: * -> *). Quote m => (# #) -> Code m (# #)
liftTyped (# #)
x = m Exp -> Code m (# #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# #) -> m Exp
lift (# #)
x)
  lift :: forall (m :: * -> *). Quote m => (# #) -> m Exp
lift (# #) = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE (Int -> Name
unboxedTupleTypeName Int
0))

-- | @since 2.16.0.0
instance (Lift a) => Lift (# a #) where
  liftTyped :: forall (m :: * -> *). Quote m => (# a #) -> Code m (# a #)
liftTyped (# a #)
x = m Exp -> Code m (# a #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a #) -> m Exp
lift (# a #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a #) -> m Exp
lift (# a
a #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a]

-- | @since 2.16.0.0
instance (Lift a, Lift b) => Lift (# a, b #) where
  liftTyped :: forall (m :: * -> *). Quote m => (# a, b #) -> Code m (# a, b #)
liftTyped (# a, b #)
x = m Exp -> Code m (# a, b #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b #) -> m Exp
lift (# a, b #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b #) -> m Exp
lift (# a
a, b
b #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b]

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c)
      => Lift (# a, b, c #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a, b, c #) -> Code m (# a, b, c #)
liftTyped (# a, b, c #)
x = m Exp -> Code m (# a, b, c #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b, c #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b, c #) -> m Exp
lift (# a, b, c #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b, c #) -> m Exp
lift (# a
a, b
b, c
c #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c]

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d)
      => Lift (# a, b, c, d #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a, b, c, d #) -> Code m (# a, b, c, d #)
liftTyped (# a, b, c, d #)
x = m Exp -> Code m (# a, b, c, d #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b, c, d #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b, c, d #) -> m Exp
lift (# a, b, c, d #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b, c, d #) -> m Exp
lift (# a
a, b
b, c
c, d
d #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b
                                                     , c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c, d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d ]

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e)
      => Lift (# a, b, c, d, e #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a, b, c, d, e #) -> Code m (# a, b, c, d, e #)
liftTyped (# a, b, c, d, e #)
x = m Exp -> Code m (# a, b, c, d, e #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b, c, d, e #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b, c, d, e #) -> m Exp
lift (# a, b, c, d, e #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b, c, d, e #) -> m Exp
lift (# a
a, b
b, c
c, d
d, e
e #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b
                                                     , c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c, d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e ]

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f)
      => Lift (# a, b, c, d, e, f #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a, b, c, d, e, f #) -> Code m (# a, b, c, d, e, f #)
liftTyped (# a, b, c, d, e, f #)
x = m Exp -> Code m (# a, b, c, d, e, f #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b, c, d, e, f #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b, c, d, e, f #) -> m Exp
lift (# a, b, c, d, e, f #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b, c, d, e, f #) -> m Exp
lift (# a
a, b
b, c
c, d
d, e
e, f
f #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c
                                                     , d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e, f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
f ]

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g)
      => Lift (# a, b, c, d, e, f, g #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a, b, c, d, e, f, g #) -> Code m (# a, b, c, d, e, f, g #)
liftTyped (# a, b, c, d, e, f, g #)
x = m Exp -> Code m (# a, b, c, d, e, f, g #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a, b, c, d, e, f, g #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a, b, c, d, e, f, g #) -> m Exp
lift (# a, b, c, d, e, f, g #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a, b, c, d, e, f, g #) -> m Exp
lift (# a
a, b
b, c
c, d
d, e
e, f
f, g
g #)
    = ([Maybe Exp] -> Exp) -> m [Maybe Exp] -> m Exp
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM [Maybe Exp] -> Exp
UnboxedTupE (m [Maybe Exp] -> m Exp) -> m [Maybe Exp] -> m Exp
forall a b. (a -> b) -> a -> b
$ [m (Maybe Exp)] -> m [Maybe Exp]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence ([m (Maybe Exp)] -> m [Maybe Exp])
-> [m (Maybe Exp)] -> m [Maybe Exp]
forall a b. (a -> b) -> a -> b
$ (m Exp -> m (Maybe Exp)) -> [m Exp] -> [m (Maybe Exp)]
forall a b. (a -> b) -> [a] -> [b]
map ((Exp -> Maybe Exp) -> m Exp -> m (Maybe Exp)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Exp -> Maybe Exp
forall a. a -> Maybe a
Just) [ a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
a, b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
b, c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
c
                                                     , d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
d, e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
e, f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
f
                                                     , g -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => g -> m Exp
lift g
g ]

-- | @since 2.16.0.0
instance (Lift a, Lift b) => Lift (# a | b #) where
  liftTyped :: forall (m :: * -> *). Quote m => (# a | b #) -> Code m (# a | b #)
liftTyped (# a | b #)
x = m Exp -> Code m (# a | b #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a | b #) -> m Exp
lift (# a | b #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a | b #) -> m Exp
lift (# a | b #)
x
    = case (# a | b #)
x of
        (# a
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2
        (# | b
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c)
      => Lift (# a | b | c #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a | b | c #) -> Code m (# a | b | c #)
liftTyped (# a | b | c #)
x = m Exp -> Code m (# a | b | c #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b | c #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a | b | c #) -> m Exp
lift (# a | b | c #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a | b | c #) -> m Exp
lift (# a | b | c #)
x
    = case (# a | b | c #)
x of
        (# a
y | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3
        (# | b
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3
        (# | | c
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d)
      => Lift (# a | b | c | d #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d #) -> Code m (# a | b | c | d #)
liftTyped (# a | b | c | d #)
x = m Exp -> Code m (# a | b | c | d #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b | c | d #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a | b | c | d #) -> m Exp
lift (# a | b | c | d #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a | b | c | d #) -> m Exp
lift (# a | b | c | d #)
x
    = case (# a | b | c | d #)
x of
        (# a
y | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4
        (# | b
y | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4
        (# | | c
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4
        (# | | | d
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e)
      => Lift (# a | b | c | d | e #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e #) -> Code m (# a | b | c | d | e #)
liftTyped (# a | b | c | d | e #)
x = m Exp -> Code m (# a | b | c | d | e #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b | c | d | e #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => (# a | b | c | d | e #) -> m Exp
lift (# a | b | c | d | e #)
x)
  lift :: forall (m :: * -> *). Quote m => (# a | b | c | d | e #) -> m Exp
lift (# a | b | c | d | e #)
x
    = case (# a | b | c | d | e #)
x of
        (# a
y | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5
        (# | b
y | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5
        (# | | c
y | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5
        (# | | | d
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5
        (# | | | | e
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f)
      => Lift (# a | b | c | d | e | f #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f #) -> Code m (# a | b | c | d | e | f #)
liftTyped (# a | b | c | d | e | f #)
x = m Exp -> Code m (# a | b | c | d | e | f #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b | c | d | e | f #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f #) -> m Exp
lift (# a | b | c | d | e | f #)
x)
  lift :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f #) -> m Exp
lift (# a | b | c | d | e | f #)
x
    = case (# a | b | c | d | e | f #)
x of
        (# a
y | | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
        (# | b
y | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
        (# | | c
y | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
        (# | | | d
y | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
        (# | | | | e
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6
        (# | | | | | f
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6

-- | @since 2.16.0.0
instance (Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g)
      => Lift (# a | b | c | d | e | f | g #) where
  liftTyped :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f | g #)
-> Code m (# a | b | c | d | e | f | g #)
liftTyped (# a | b | c | d | e | f | g #)
x = m Exp -> Code m (# a | b | c | d | e | f | g #)
forall a (m :: * -> *). Quote m => m Exp -> Code m a
unsafeCodeCoerce ((# a | b | c | d | e | f | g #) -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f | g #) -> m Exp
lift (# a | b | c | d | e | f | g #)
x)
  lift :: forall (m :: * -> *).
Quote m =>
(# a | b | c | d | e | f | g #) -> m Exp
lift (# a | b | c | d | e | f | g #)
x
    = case (# a | b | c | d | e | f | g #)
x of
        (# a
y | | | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => a -> m Exp
lift a
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
1 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | b
y | | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> b -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => b -> m Exp
lift b
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
2 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | | c
y | | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> c -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => c -> m Exp
lift c
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
3 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | | | d
y | | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> d -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => d -> m Exp
lift d
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
4 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | | | | e
y | | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> e -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => e -> m Exp
lift e
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
5 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | | | | | f
y | #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => f -> m Exp
lift f
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
6 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7
        (# | | | | | | g
y #) -> Exp -> Int -> Int -> Exp
UnboxedSumE (Exp -> Int -> Int -> Exp) -> m Exp -> m (Int -> Int -> Exp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> g -> m Exp
forall t (m :: * -> *). (Lift t, Quote m) => t -> m Exp
forall (m :: * -> *). Quote m => g -> m Exp
lift g
y m (Int -> Int -> Exp) -> m Int -> m (Int -> Exp)
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7 m (Int -> Exp) -> m Int -> m Exp
forall a b. m (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int -> m Int
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int
7

-- TH has a special form for literal strings,
-- which we should take advantage of.
-- NB: the lhs of the rule has no args, so that
--     the rule will apply to a 'lift' all on its own
--     which happens to be the way the type checker
--     creates it.
{-# RULES "TH:liftString" lift = \s -> return (LitE (StringL s)) #-}


trueName, falseName :: Name
trueName :: Name
trueName  = 'True
falseName :: Name
falseName = 'False

nothingName, justName :: Name
nothingName :: Name
nothingName = 'Nothing
justName :: Name
justName    = 'Just

leftName, rightName :: Name
leftName :: Name
leftName  = 'Left
rightName :: Name
rightName = 'Right

nonemptyName :: Name
nonemptyName :: Name
nonemptyName = '(:|)

oneName, manyName :: Name
oneName :: Name
oneName  = 'One
manyName :: Name
manyName = 'Many

-----------------------------------------------------
--
--              Generic Lift implementations
--
-----------------------------------------------------

-- | 'dataToQa' is an internal utility function for constructing generic
-- conversion functions from types with 'Data' instances to various
-- quasi-quoting representations.  See the source of 'dataToExpQ' and
-- 'dataToPatQ' for two example usages: @mkCon@, @mkLit@
-- and @appQ@ are overloadable to account for different syntax for
-- expressions and patterns; @antiQ@ allows you to override type-specific
-- cases, a common usage is just @const Nothing@, which results in
-- no overloading.
dataToQa  ::  forall m a k q. (Quote m, Data a)
          =>  (Name -> k)
          ->  (Lit -> m q)
          ->  (k -> [m q] -> m q)
          ->  (forall b . Data b => b -> Maybe (m q))
          ->  a
          ->  m q
dataToQa :: forall (m :: * -> *) a k q.
(Quote m, Data a) =>
(Name -> k)
-> (Lit -> m q)
-> (k -> [m q] -> m q)
-> (forall b. Data b => b -> Maybe (m q))
-> a
-> m q
dataToQa Name -> k
mkCon Lit -> m q
mkLit k -> [m q] -> m q
appCon forall b. Data b => b -> Maybe (m q)
antiQ a
t =
    case a -> Maybe (m q)
forall b. Data b => b -> Maybe (m q)
antiQ a
t of
      Maybe (m q)
Nothing ->
          case Constr -> ConstrRep
constrRep Constr
constr of
            AlgConstr Int
_ ->
                k -> [m q] -> m q
appCon (Name -> k
mkCon Name
funOrConName) [m q]
conArgs
              where
                funOrConName :: Name
                funOrConName :: Name
funOrConName =
                    case Constr -> FilePath
showConstr Constr
constr of
                      FilePath
"(:)"       -> OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
":")
                                          (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
DataName
                                                (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim")
                                                (FilePath -> ModName
mkModName FilePath
"GHC.Types"))
                      con :: FilePath
con@FilePath
"[]"    -> OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
con)
                                          (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
DataName
                                                (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim")
                                                (FilePath -> ModName
mkModName FilePath
"GHC.Types"))
                      con :: FilePath
con@(Char
'(':FilePath
_) -> OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
con)
                                          (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
DataName
                                                (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim")
                                                (FilePath -> ModName
mkModName FilePath
"GHC.Tuple.Prim"))

                      -- Tricky case: see Note [Data for non-algebraic types]
                      fun :: FilePath
fun@(Char
x:FilePath
_)   | Char -> Bool
startsVarSym Char
x Bool -> Bool -> Bool
|| Char -> Bool
startsVarId Char
x
                                  -> FilePath -> FilePath -> FilePath -> Name
mkNameG_v FilePath
tyconPkg FilePath
tyconMod FilePath
fun
                      FilePath
con         -> FilePath -> FilePath -> FilePath -> Name
mkNameG_d FilePath
tyconPkg FilePath
tyconMod FilePath
con

                  where
                    tycon :: TyCon
                    tycon :: TyCon
tycon = (TypeRep -> TyCon
typeRepTyCon (TypeRep -> TyCon) -> (a -> TypeRep) -> a -> TyCon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> TypeRep
forall a. Typeable a => a -> TypeRep
typeOf) a
t

                    tyconPkg, tyconMod :: String
                    tyconPkg :: FilePath
tyconPkg = TyCon -> FilePath
tyConPackage TyCon
tycon
                    tyconMod :: FilePath
tyconMod = TyCon -> FilePath
tyConModule  TyCon
tycon

                conArgs :: [m q]
                conArgs :: [m q]
conArgs = (forall d. Data d => d -> m q) -> a -> [m q]
forall a u. Data a => (forall d. Data d => d -> u) -> a -> [u]
forall u. (forall d. Data d => d -> u) -> a -> [u]
gmapQ ((Name -> k)
-> (Lit -> m q)
-> (k -> [m q] -> m q)
-> (forall b. Data b => b -> Maybe (m q))
-> d
-> m q
forall (m :: * -> *) a k q.
(Quote m, Data a) =>
(Name -> k)
-> (Lit -> m q)
-> (k -> [m q] -> m q)
-> (forall b. Data b => b -> Maybe (m q))
-> a
-> m q
dataToQa Name -> k
mkCon Lit -> m q
mkLit k -> [m q] -> m q
appCon b -> Maybe (m q)
forall b. Data b => b -> Maybe (m q)
antiQ) a
t
            IntConstr Uniq
n ->
                Lit -> m q
mkLit (Lit -> m q) -> Lit -> m q
forall a b. (a -> b) -> a -> b
$ Uniq -> Lit
IntegerL Uniq
n
            FloatConstr Rational
n ->
                Lit -> m q
mkLit (Lit -> m q) -> Lit -> m q
forall a b. (a -> b) -> a -> b
$ Rational -> Lit
RationalL Rational
n
            CharConstr Char
c ->
                Lit -> m q
mkLit (Lit -> m q) -> Lit -> m q
forall a b. (a -> b) -> a -> b
$ Char -> Lit
CharL Char
c
        where
          constr :: Constr
          constr :: Constr
constr = a -> Constr
forall a. Data a => a -> Constr
toConstr a
t

      Just m q
y -> m q
y


{- Note [Data for non-algebraic types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Class Data was originally intended for algebraic data types.  But
it is possible to use it for abstract types too.  For example, in
package `text` we find

  instance Data Text where
    ...
    toConstr _ = packConstr

  packConstr :: Constr
  packConstr = mkConstr textDataType "pack" [] Prefix

Here `packConstr` isn't a real data constructor, it's an ordinary
function.  Two complications

* In such a case, we must take care to build the Name using
  mkNameG_v (for values), not mkNameG_d (for data constructors).
  See #10796.

* The pseudo-constructor is named only by its string, here "pack".
  But 'dataToQa' needs the TyCon of its defining module, and has
  to assume it's defined in the same module as the TyCon itself.
  But nothing enforces that; #12596 shows what goes wrong if
  "pack" is defined in a different module than the data type "Text".
  -}

-- | 'dataToExpQ' converts a value to a 'Exp' representation of the
-- same value, in the SYB style. It is generalized to take a function
-- override type-specific cases; see 'liftData' for a more commonly
-- used variant.
dataToExpQ  ::  (Quote m, Data a)
            =>  (forall b . Data b => b -> Maybe (m Exp))
            ->  a
            ->  m Exp
dataToExpQ :: forall (m :: * -> *) a.
(Quote m, Data a) =>
(forall b. Data b => b -> Maybe (m Exp)) -> a -> m Exp
dataToExpQ = (Name -> m Exp)
-> (Lit -> m Exp)
-> (m Exp -> [m Exp] -> m Exp)
-> (forall b. Data b => b -> Maybe (m Exp))
-> a
-> m Exp
forall (m :: * -> *) a k q.
(Quote m, Data a) =>
(Name -> k)
-> (Lit -> m q)
-> (k -> [m q] -> m q)
-> (forall b. Data b => b -> Maybe (m q))
-> a
-> m q
dataToQa Name -> m Exp
forall {m :: * -> *}. Monad m => Name -> m Exp
varOrConE Lit -> m Exp
forall {m :: * -> *}. Monad m => Lit -> m Exp
litE ((m Exp -> m Exp -> m Exp) -> m Exp -> [m Exp] -> m Exp
forall b a. (b -> a -> b) -> b -> [a] -> b
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl m Exp -> m Exp -> m Exp
forall {m :: * -> *}. Monad m => m Exp -> m Exp -> m Exp
appE)
    where
          -- Make sure that VarE is used if the Constr value relies on a
          -- function underneath the surface (instead of a constructor).
          -- See #10796.
          varOrConE :: Name -> m Exp
varOrConE Name
s =
            case Name -> Maybe NameSpace
nameSpace Name
s of
                 Just NameSpace
VarName      -> Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
VarE Name
s)
                 Just (FldName {}) -> Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
VarE Name
s)
                 Just NameSpace
DataName     -> Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> Exp
ConE Name
s)
                 Maybe NameSpace
_ -> FilePath -> m Exp
forall a. HasCallStack => FilePath -> a
error (FilePath -> m Exp) -> FilePath -> m Exp
forall a b. (a -> b) -> a -> b
$ FilePath
"Can't construct an expression from name "
                           FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Name -> FilePath
showName Name
s
          appE :: m Exp -> m Exp -> m Exp
appE m Exp
x m Exp
y = do { Exp
a <- m Exp
x; Exp
b <- m Exp
y; Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Exp -> Exp -> Exp
AppE Exp
a Exp
b)}
          litE :: Lit -> m Exp
litE Lit
c = Exp -> m Exp
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Exp
LitE Lit
c)

-- | 'liftData' is a variant of 'lift' in the 'Lift' type class which
-- works for any type with a 'Data' instance.
liftData :: (Quote m, Data a) => a -> m Exp
liftData :: forall (m :: * -> *) a. (Quote m, Data a) => a -> m Exp
liftData = (forall b. Data b => b -> Maybe (m Exp)) -> a -> m Exp
forall (m :: * -> *) a.
(Quote m, Data a) =>
(forall b. Data b => b -> Maybe (m Exp)) -> a -> m Exp
dataToExpQ (Maybe (m Exp) -> b -> Maybe (m Exp)
forall a b. a -> b -> a
const Maybe (m Exp)
forall a. Maybe a
Nothing)

-- | 'dataToPatQ' converts a value to a 'Pat' representation of the same
-- value, in the SYB style. It takes a function to handle type-specific cases,
-- alternatively, pass @const Nothing@ to get default behavior.
dataToPatQ  ::  (Quote m, Data a)
            =>  (forall b . Data b => b -> Maybe (m Pat))
            ->  a
            ->  m Pat
dataToPatQ :: forall (m :: * -> *) a.
(Quote m, Data a) =>
(forall b. Data b => b -> Maybe (m Pat)) -> a -> m Pat
dataToPatQ = (Name -> Name)
-> (Lit -> m Pat)
-> (Name -> [m Pat] -> m Pat)
-> (forall b. Data b => b -> Maybe (m Pat))
-> a
-> m Pat
forall (m :: * -> *) a k q.
(Quote m, Data a) =>
(Name -> k)
-> (Lit -> m q)
-> (k -> [m q] -> m q)
-> (forall b. Data b => b -> Maybe (m q))
-> a
-> m q
dataToQa Name -> Name
forall a. a -> a
id Lit -> m Pat
forall {m :: * -> *}. Monad m => Lit -> m Pat
litP Name -> [m Pat] -> m Pat
forall {m :: * -> *}. Monad m => Name -> [m Pat] -> m Pat
conP
    where litP :: Lit -> m Pat
litP Lit
l = Pat -> m Pat
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Lit -> Pat
LitP Lit
l)
          conP :: Name -> [m Pat] -> m Pat
conP Name
n [m Pat]
ps =
            case Name -> Maybe NameSpace
nameSpace Name
n of
                Just NameSpace
DataName -> do
                    [Pat]
ps' <- [m Pat] -> m [Pat]
forall (t :: * -> *) (m :: * -> *) a.
(Traversable t, Monad m) =>
t (m a) -> m (t a)
forall (m :: * -> *) a. Monad m => [m a] -> m [a]
sequence [m Pat]
ps
                    Pat -> m Pat
forall a. a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return (Name -> [Type] -> [Pat] -> Pat
ConP Name
n [] [Pat]
ps')
                Maybe NameSpace
_ -> FilePath -> m Pat
forall a. HasCallStack => FilePath -> a
error (FilePath -> m Pat) -> FilePath -> m Pat
forall a b. (a -> b) -> a -> b
$ FilePath
"Can't construct a pattern from name "
                          FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Name -> FilePath
showName Name
n

-----------------------------------------------------
--              Names and uniques
-----------------------------------------------------

newtype ModName = ModName String        -- Module name
 deriving (Int -> ModName -> FilePath -> FilePath
[ModName] -> FilePath -> FilePath
ModName -> FilePath
(Int -> ModName -> FilePath -> FilePath)
-> (ModName -> FilePath)
-> ([ModName] -> FilePath -> FilePath)
-> Show ModName
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> ModName -> FilePath -> FilePath
showsPrec :: Int -> ModName -> FilePath -> FilePath
$cshow :: ModName -> FilePath
show :: ModName -> FilePath
$cshowList :: [ModName] -> FilePath -> FilePath
showList :: [ModName] -> FilePath -> FilePath
Show,ModName -> ModName -> Bool
(ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool) -> Eq ModName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModName -> ModName -> Bool
== :: ModName -> ModName -> Bool
$c/= :: ModName -> ModName -> Bool
/= :: ModName -> ModName -> Bool
Eq,Eq ModName
Eq ModName =>
(ModName -> ModName -> Ordering)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> Bool)
-> (ModName -> ModName -> ModName)
-> (ModName -> ModName -> ModName)
-> Ord ModName
ModName -> ModName -> Bool
ModName -> ModName -> Ordering
ModName -> ModName -> ModName
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ModName -> ModName -> Ordering
compare :: ModName -> ModName -> Ordering
$c< :: ModName -> ModName -> Bool
< :: ModName -> ModName -> Bool
$c<= :: ModName -> ModName -> Bool
<= :: ModName -> ModName -> Bool
$c> :: ModName -> ModName -> Bool
> :: ModName -> ModName -> Bool
$c>= :: ModName -> ModName -> Bool
>= :: ModName -> ModName -> Bool
$cmax :: ModName -> ModName -> ModName
max :: ModName -> ModName -> ModName
$cmin :: ModName -> ModName -> ModName
min :: ModName -> ModName -> ModName
Ord,Typeable ModName
Typeable ModName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ModName -> c ModName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ModName)
-> (ModName -> Constr)
-> (ModName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ModName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName))
-> ((forall b. Data b => b -> b) -> ModName -> ModName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ModName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ModName -> r)
-> (forall u. (forall d. Data d => d -> u) -> ModName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ModName -> m ModName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModName -> m ModName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModName -> m ModName)
-> Data ModName
ModName -> Constr
ModName -> DataType
(forall b. Data b => b -> b) -> ModName -> ModName
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u
forall u. (forall d. Data d => d -> u) -> ModName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModName -> c ModName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModName
$ctoConstr :: ModName -> Constr
toConstr :: ModName -> Constr
$cdataTypeOf :: ModName -> DataType
dataTypeOf :: ModName -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModName)
$cgmapT :: (forall b. Data b => b -> b) -> ModName -> ModName
gmapT :: (forall b. Data b => b -> b) -> ModName -> ModName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ModName -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModName -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModName -> m ModName
Data,(forall x. ModName -> Rep ModName x)
-> (forall x. Rep ModName x -> ModName) -> Generic ModName
forall x. Rep ModName x -> ModName
forall x. ModName -> Rep ModName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ModName -> Rep ModName x
from :: forall x. ModName -> Rep ModName x
$cto :: forall x. Rep ModName x -> ModName
to :: forall x. Rep ModName x -> ModName
Generic)

newtype PkgName = PkgName String        -- package name
 deriving (Int -> PkgName -> FilePath -> FilePath
[PkgName] -> FilePath -> FilePath
PkgName -> FilePath
(Int -> PkgName -> FilePath -> FilePath)
-> (PkgName -> FilePath)
-> ([PkgName] -> FilePath -> FilePath)
-> Show PkgName
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> PkgName -> FilePath -> FilePath
showsPrec :: Int -> PkgName -> FilePath -> FilePath
$cshow :: PkgName -> FilePath
show :: PkgName -> FilePath
$cshowList :: [PkgName] -> FilePath -> FilePath
showList :: [PkgName] -> FilePath -> FilePath
Show,PkgName -> PkgName -> Bool
(PkgName -> PkgName -> Bool)
-> (PkgName -> PkgName -> Bool) -> Eq PkgName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PkgName -> PkgName -> Bool
== :: PkgName -> PkgName -> Bool
$c/= :: PkgName -> PkgName -> Bool
/= :: PkgName -> PkgName -> Bool
Eq,Eq PkgName
Eq PkgName =>
(PkgName -> PkgName -> Ordering)
-> (PkgName -> PkgName -> Bool)
-> (PkgName -> PkgName -> Bool)
-> (PkgName -> PkgName -> Bool)
-> (PkgName -> PkgName -> Bool)
-> (PkgName -> PkgName -> PkgName)
-> (PkgName -> PkgName -> PkgName)
-> Ord PkgName
PkgName -> PkgName -> Bool
PkgName -> PkgName -> Ordering
PkgName -> PkgName -> PkgName
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PkgName -> PkgName -> Ordering
compare :: PkgName -> PkgName -> Ordering
$c< :: PkgName -> PkgName -> Bool
< :: PkgName -> PkgName -> Bool
$c<= :: PkgName -> PkgName -> Bool
<= :: PkgName -> PkgName -> Bool
$c> :: PkgName -> PkgName -> Bool
> :: PkgName -> PkgName -> Bool
$c>= :: PkgName -> PkgName -> Bool
>= :: PkgName -> PkgName -> Bool
$cmax :: PkgName -> PkgName -> PkgName
max :: PkgName -> PkgName -> PkgName
$cmin :: PkgName -> PkgName -> PkgName
min :: PkgName -> PkgName -> PkgName
Ord,Typeable PkgName
Typeable PkgName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> PkgName -> c PkgName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PkgName)
-> (PkgName -> Constr)
-> (PkgName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PkgName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PkgName))
-> ((forall b. Data b => b -> b) -> PkgName -> PkgName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PkgName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PkgName -> r)
-> (forall u. (forall d. Data d => d -> u) -> PkgName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> PkgName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PkgName -> m PkgName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PkgName -> m PkgName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PkgName -> m PkgName)
-> Data PkgName
PkgName -> Constr
PkgName -> DataType
(forall b. Data b => b -> b) -> PkgName -> PkgName
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PkgName -> u
forall u. (forall d. Data d => d -> u) -> PkgName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PkgName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PkgName -> c PkgName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PkgName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PkgName)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PkgName -> c PkgName
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PkgName -> c PkgName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PkgName
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PkgName
$ctoConstr :: PkgName -> Constr
toConstr :: PkgName -> Constr
$cdataTypeOf :: PkgName -> DataType
dataTypeOf :: PkgName -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PkgName)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PkgName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PkgName)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PkgName)
$cgmapT :: (forall b. Data b => b -> b) -> PkgName -> PkgName
gmapT :: (forall b. Data b => b -> b) -> PkgName -> PkgName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PkgName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PkgName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PkgName -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PkgName -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PkgName -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PkgName -> m PkgName
Data,(forall x. PkgName -> Rep PkgName x)
-> (forall x. Rep PkgName x -> PkgName) -> Generic PkgName
forall x. Rep PkgName x -> PkgName
forall x. PkgName -> Rep PkgName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PkgName -> Rep PkgName x
from :: forall x. PkgName -> Rep PkgName x
$cto :: forall x. Rep PkgName x -> PkgName
to :: forall x. Rep PkgName x -> PkgName
Generic)

-- | Obtained from 'reifyModule' and 'Language.Haskell.TH.Lib.thisModule'.
data Module = Module PkgName ModName -- package qualified module name
 deriving (Int -> Module -> FilePath -> FilePath
[Module] -> FilePath -> FilePath
Module -> FilePath
(Int -> Module -> FilePath -> FilePath)
-> (Module -> FilePath)
-> ([Module] -> FilePath -> FilePath)
-> Show Module
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Module -> FilePath -> FilePath
showsPrec :: Int -> Module -> FilePath -> FilePath
$cshow :: Module -> FilePath
show :: Module -> FilePath
$cshowList :: [Module] -> FilePath -> FilePath
showList :: [Module] -> FilePath -> FilePath
Show,Module -> Module -> Bool
(Module -> Module -> Bool)
-> (Module -> Module -> Bool) -> Eq Module
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Module -> Module -> Bool
== :: Module -> Module -> Bool
$c/= :: Module -> Module -> Bool
/= :: Module -> Module -> Bool
Eq,Eq Module
Eq Module =>
(Module -> Module -> Ordering)
-> (Module -> Module -> Bool)
-> (Module -> Module -> Bool)
-> (Module -> Module -> Bool)
-> (Module -> Module -> Bool)
-> (Module -> Module -> Module)
-> (Module -> Module -> Module)
-> Ord Module
Module -> Module -> Bool
Module -> Module -> Ordering
Module -> Module -> Module
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Module -> Module -> Ordering
compare :: Module -> Module -> Ordering
$c< :: Module -> Module -> Bool
< :: Module -> Module -> Bool
$c<= :: Module -> Module -> Bool
<= :: Module -> Module -> Bool
$c> :: Module -> Module -> Bool
> :: Module -> Module -> Bool
$c>= :: Module -> Module -> Bool
>= :: Module -> Module -> Bool
$cmax :: Module -> Module -> Module
max :: Module -> Module -> Module
$cmin :: Module -> Module -> Module
min :: Module -> Module -> Module
Ord,Typeable Module
Typeable Module =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Module -> c Module)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Module)
-> (Module -> Constr)
-> (Module -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Module))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module))
-> ((forall b. Data b => b -> b) -> Module -> Module)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Module -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Module -> r)
-> (forall u. (forall d. Data d => d -> u) -> Module -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Module -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Module -> m Module)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Module -> m Module)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Module -> m Module)
-> Data Module
Module -> Constr
Module -> DataType
(forall b. Data b => b -> b) -> Module -> Module
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Module -> u
forall u. (forall d. Data d => d -> u) -> Module -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Module -> m Module
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Module -> m Module
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Module
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Module -> c Module
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Module)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Module -> c Module
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Module -> c Module
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Module
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Module
$ctoConstr :: Module -> Constr
toConstr :: Module -> Constr
$cdataTypeOf :: Module -> DataType
dataTypeOf :: Module -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Module)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Module)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Module)
$cgmapT :: (forall b. Data b => b -> b) -> Module -> Module
gmapT :: (forall b. Data b => b -> b) -> Module -> Module
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Module -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Module -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Module -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Module -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Module -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Module -> m Module
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Module -> m Module
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Module -> m Module
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Module -> m Module
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Module -> m Module
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Module -> m Module
Data,(forall x. Module -> Rep Module x)
-> (forall x. Rep Module x -> Module) -> Generic Module
forall x. Rep Module x -> Module
forall x. Module -> Rep Module x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Module -> Rep Module x
from :: forall x. Module -> Rep Module x
$cto :: forall x. Rep Module x -> Module
to :: forall x. Rep Module x -> Module
Generic)

newtype OccName = OccName String
 deriving (Int -> OccName -> FilePath -> FilePath
[OccName] -> FilePath -> FilePath
OccName -> FilePath
(Int -> OccName -> FilePath -> FilePath)
-> (OccName -> FilePath)
-> ([OccName] -> FilePath -> FilePath)
-> Show OccName
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> OccName -> FilePath -> FilePath
showsPrec :: Int -> OccName -> FilePath -> FilePath
$cshow :: OccName -> FilePath
show :: OccName -> FilePath
$cshowList :: [OccName] -> FilePath -> FilePath
showList :: [OccName] -> FilePath -> FilePath
Show,OccName -> OccName -> Bool
(OccName -> OccName -> Bool)
-> (OccName -> OccName -> Bool) -> Eq OccName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OccName -> OccName -> Bool
== :: OccName -> OccName -> Bool
$c/= :: OccName -> OccName -> Bool
/= :: OccName -> OccName -> Bool
Eq,Eq OccName
Eq OccName =>
(OccName -> OccName -> Ordering)
-> (OccName -> OccName -> Bool)
-> (OccName -> OccName -> Bool)
-> (OccName -> OccName -> Bool)
-> (OccName -> OccName -> Bool)
-> (OccName -> OccName -> OccName)
-> (OccName -> OccName -> OccName)
-> Ord OccName
OccName -> OccName -> Bool
OccName -> OccName -> Ordering
OccName -> OccName -> OccName
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: OccName -> OccName -> Ordering
compare :: OccName -> OccName -> Ordering
$c< :: OccName -> OccName -> Bool
< :: OccName -> OccName -> Bool
$c<= :: OccName -> OccName -> Bool
<= :: OccName -> OccName -> Bool
$c> :: OccName -> OccName -> Bool
> :: OccName -> OccName -> Bool
$c>= :: OccName -> OccName -> Bool
>= :: OccName -> OccName -> Bool
$cmax :: OccName -> OccName -> OccName
max :: OccName -> OccName -> OccName
$cmin :: OccName -> OccName -> OccName
min :: OccName -> OccName -> OccName
Ord,Typeable OccName
Typeable OccName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> OccName -> c OccName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c OccName)
-> (OccName -> Constr)
-> (OccName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c OccName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName))
-> ((forall b. Data b => b -> b) -> OccName -> OccName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> OccName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> OccName -> r)
-> (forall u. (forall d. Data d => d -> u) -> OccName -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> OccName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> OccName -> m OccName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OccName -> m OccName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> OccName -> m OccName)
-> Data OccName
OccName -> Constr
OccName -> DataType
(forall b. Data b => b -> b) -> OccName -> OccName
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> OccName -> u
forall u. (forall d. Data d => d -> u) -> OccName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OccName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OccName -> c OccName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OccName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OccName -> c OccName
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OccName -> c OccName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OccName
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OccName
$ctoConstr :: OccName -> Constr
toConstr :: OccName -> Constr
$cdataTypeOf :: OccName -> DataType
dataTypeOf :: OccName -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OccName)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OccName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName)
$cgmapT :: (forall b. Data b => b -> b) -> OccName -> OccName
gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OccName -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> OccName -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> OccName -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OccName -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OccName -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OccName -> m OccName
Data,(forall x. OccName -> Rep OccName x)
-> (forall x. Rep OccName x -> OccName) -> Generic OccName
forall x. Rep OccName x -> OccName
forall x. OccName -> Rep OccName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. OccName -> Rep OccName x
from :: forall x. OccName -> Rep OccName x
$cto :: forall x. Rep OccName x -> OccName
to :: forall x. Rep OccName x -> OccName
Generic)

mkModName :: String -> ModName
mkModName :: FilePath -> ModName
mkModName FilePath
s = FilePath -> ModName
ModName FilePath
s

modString :: ModName -> String
modString :: ModName -> FilePath
modString (ModName FilePath
m) = FilePath
m


mkPkgName :: String -> PkgName
mkPkgName :: FilePath -> PkgName
mkPkgName FilePath
s = FilePath -> PkgName
PkgName FilePath
s

pkgString :: PkgName -> String
pkgString :: PkgName -> FilePath
pkgString (PkgName FilePath
m) = FilePath
m


-----------------------------------------------------
--              OccName
-----------------------------------------------------

mkOccName :: String -> OccName
mkOccName :: FilePath -> OccName
mkOccName FilePath
s = FilePath -> OccName
OccName FilePath
s

occString :: OccName -> String
occString :: OccName -> FilePath
occString (OccName FilePath
occ) = FilePath
occ


-----------------------------------------------------
--               Names
-----------------------------------------------------
--
-- For "global" names ('NameG') we need a totally unique name,
-- so we must include the name-space of the thing
--
-- For unique-numbered things ('NameU'), we've got a unique reference
-- anyway, so no need for name space
--
-- For dynamically bound thing ('NameS') we probably want them to
-- in a context-dependent way, so again we don't want the name
-- space.  For example:
--
-- > let v = mkName "T" in [| data $v = $v |]
--
-- Here we use the same Name for both type constructor and data constructor
--
--
-- NameL and NameG are bound *outside* the TH syntax tree
-- either globally (NameG) or locally (NameL). Ex:
--
-- > f x = $(h [| (map, x) |])
--
-- The 'map' will be a NameG, and 'x' wil be a NameL
--
-- These Names should never appear in a binding position in a TH syntax tree

{- $namecapture #namecapture#
Much of 'Name' API is concerned with the problem of /name capture/, which
can be seen in the following example.

> f expr = [| let x = 0 in $expr |]
> ...
> g x = $( f [| x |] )
> h y = $( f [| y |] )

A naive desugaring of this would yield:

> g x = let x = 0 in x
> h y = let x = 0 in y

All of a sudden, @g@ and @h@ have different meanings! In this case,
we say that the @x@ in the RHS of @g@ has been /captured/
by the binding of @x@ in @f@.

What we actually want is for the @x@ in @f@ to be distinct from the
@x@ in @g@, so we get the following desugaring:

> g x = let x' = 0 in x
> h y = let x' = 0 in y

which avoids name capture as desired.

In the general case, we say that a @Name@ can be captured if
the thing it refers to can be changed by adding new declarations.
-}

{- |
An abstract type representing names in the syntax tree.

'Name's can be constructed in several ways, which come with different
name-capture guarantees (see "Language.Haskell.TH.Syntax#namecapture" for
an explanation of name capture):

  * the built-in syntax @'f@ and @''T@ can be used to construct names,
    The expression @'f@ gives a @Name@ which refers to the value @f@
    currently in scope, and @''T@ gives a @Name@ which refers to the
    type @T@ currently in scope. These names can never be captured.

  * 'lookupValueName' and 'lookupTypeName' are similar to @'f@ and
     @''T@ respectively, but the @Name@s are looked up at the point
     where the current splice is being run. These names can never be
     captured.

  * 'newName' monadically generates a new name, which can never
     be captured.

  * 'mkName' generates a capturable name.

Names constructed using @newName@ and @mkName@ may be used in bindings
(such as @let x = ...@ or @\x -> ...@), but names constructed using
@lookupValueName@, @lookupTypeName@, @'f@, @''T@ may not.
-}
data Name = Name OccName NameFlavour deriving (Typeable Name
Typeable Name =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Name -> c Name)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Name)
-> (Name -> Constr)
-> (Name -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Name))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name))
-> ((forall b. Data b => b -> b) -> Name -> Name)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r)
-> (forall u. (forall d. Data d => d -> u) -> Name -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Name -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Name -> m Name)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Name -> m Name)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Name -> m Name)
-> Data Name
Name -> Constr
Name -> DataType
(forall b. Data b => b -> b) -> Name -> Name
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Name -> u
forall u. (forall d. Data d => d -> u) -> Name -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Name -> c Name
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Name
$ctoConstr :: Name -> Constr
toConstr :: Name -> Constr
$cdataTypeOf :: Name -> DataType
dataTypeOf :: Name -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Name)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name)
$cgmapT :: (forall b. Data b => b -> b) -> Name -> Name
gmapT :: (forall b. Data b => b -> b) -> Name -> Name
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Name -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Name -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Name -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Name -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Name -> m Name
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Name -> m Name
Data, Name -> Name -> Bool
(Name -> Name -> Bool) -> (Name -> Name -> Bool) -> Eq Name
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Name -> Name -> Bool
== :: Name -> Name -> Bool
$c/= :: Name -> Name -> Bool
/= :: Name -> Name -> Bool
Eq, (forall x. Name -> Rep Name x)
-> (forall x. Rep Name x -> Name) -> Generic Name
forall x. Rep Name x -> Name
forall x. Name -> Rep Name x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Name -> Rep Name x
from :: forall x. Name -> Rep Name x
$cto :: forall x. Rep Name x -> Name
to :: forall x. Rep Name x -> Name
Generic)

instance Ord Name where
    -- check if unique is different before looking at strings
  (Name OccName
o1 NameFlavour
f1) compare :: Name -> Name -> Ordering
`compare` (Name OccName
o2 NameFlavour
f2) = (NameFlavour
f1 NameFlavour -> NameFlavour -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` NameFlavour
f2)   Ordering -> Ordering -> Ordering
`thenCmp`
                                        (OccName
o1 OccName -> OccName -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` OccName
o2)

data NameFlavour
  = NameS           -- ^ An unqualified name; dynamically bound
  | NameQ ModName   -- ^ A qualified name; dynamically bound
  | NameU !Uniq     -- ^ A unique local name
  | NameL !Uniq     -- ^ Local name bound outside of the TH AST
  | NameG NameSpace PkgName ModName -- ^ Global name bound outside of the TH AST:
                -- An original name (occurrences only, not binders)
                -- Need the namespace too to be sure which
                -- thing we are naming
  deriving ( Typeable NameFlavour
Typeable NameFlavour =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NameFlavour -> c NameFlavour)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NameFlavour)
-> (NameFlavour -> Constr)
-> (NameFlavour -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NameFlavour))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c NameFlavour))
-> ((forall b. Data b => b -> b) -> NameFlavour -> NameFlavour)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NameFlavour -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NameFlavour -> r)
-> (forall u. (forall d. Data d => d -> u) -> NameFlavour -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NameFlavour -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour)
-> Data NameFlavour
NameFlavour -> Constr
NameFlavour -> DataType
(forall b. Data b => b -> b) -> NameFlavour -> NameFlavour
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> NameFlavour -> u
forall u. (forall d. Data d => d -> u) -> NameFlavour -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameFlavour
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameFlavour -> c NameFlavour
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameFlavour)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NameFlavour)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameFlavour -> c NameFlavour
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameFlavour -> c NameFlavour
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameFlavour
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameFlavour
$ctoConstr :: NameFlavour -> Constr
toConstr :: NameFlavour -> Constr
$cdataTypeOf :: NameFlavour -> DataType
dataTypeOf :: NameFlavour -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameFlavour)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameFlavour)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NameFlavour)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NameFlavour)
$cgmapT :: (forall b. Data b => b -> b) -> NameFlavour -> NameFlavour
gmapT :: (forall b. Data b => b -> b) -> NameFlavour -> NameFlavour
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameFlavour -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NameFlavour -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> NameFlavour -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NameFlavour -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NameFlavour -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameFlavour -> m NameFlavour
Data, NameFlavour -> NameFlavour -> Bool
(NameFlavour -> NameFlavour -> Bool)
-> (NameFlavour -> NameFlavour -> Bool) -> Eq NameFlavour
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NameFlavour -> NameFlavour -> Bool
== :: NameFlavour -> NameFlavour -> Bool
$c/= :: NameFlavour -> NameFlavour -> Bool
/= :: NameFlavour -> NameFlavour -> Bool
Eq, Eq NameFlavour
Eq NameFlavour =>
(NameFlavour -> NameFlavour -> Ordering)
-> (NameFlavour -> NameFlavour -> Bool)
-> (NameFlavour -> NameFlavour -> Bool)
-> (NameFlavour -> NameFlavour -> Bool)
-> (NameFlavour -> NameFlavour -> Bool)
-> (NameFlavour -> NameFlavour -> NameFlavour)
-> (NameFlavour -> NameFlavour -> NameFlavour)
-> Ord NameFlavour
NameFlavour -> NameFlavour -> Bool
NameFlavour -> NameFlavour -> Ordering
NameFlavour -> NameFlavour -> NameFlavour
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NameFlavour -> NameFlavour -> Ordering
compare :: NameFlavour -> NameFlavour -> Ordering
$c< :: NameFlavour -> NameFlavour -> Bool
< :: NameFlavour -> NameFlavour -> Bool
$c<= :: NameFlavour -> NameFlavour -> Bool
<= :: NameFlavour -> NameFlavour -> Bool
$c> :: NameFlavour -> NameFlavour -> Bool
> :: NameFlavour -> NameFlavour -> Bool
$c>= :: NameFlavour -> NameFlavour -> Bool
>= :: NameFlavour -> NameFlavour -> Bool
$cmax :: NameFlavour -> NameFlavour -> NameFlavour
max :: NameFlavour -> NameFlavour -> NameFlavour
$cmin :: NameFlavour -> NameFlavour -> NameFlavour
min :: NameFlavour -> NameFlavour -> NameFlavour
Ord, Int -> NameFlavour -> FilePath -> FilePath
[NameFlavour] -> FilePath -> FilePath
NameFlavour -> FilePath
(Int -> NameFlavour -> FilePath -> FilePath)
-> (NameFlavour -> FilePath)
-> ([NameFlavour] -> FilePath -> FilePath)
-> Show NameFlavour
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> NameFlavour -> FilePath -> FilePath
showsPrec :: Int -> NameFlavour -> FilePath -> FilePath
$cshow :: NameFlavour -> FilePath
show :: NameFlavour -> FilePath
$cshowList :: [NameFlavour] -> FilePath -> FilePath
showList :: [NameFlavour] -> FilePath -> FilePath
Show, (forall x. NameFlavour -> Rep NameFlavour x)
-> (forall x. Rep NameFlavour x -> NameFlavour)
-> Generic NameFlavour
forall x. Rep NameFlavour x -> NameFlavour
forall x. NameFlavour -> Rep NameFlavour x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NameFlavour -> Rep NameFlavour x
from :: forall x. NameFlavour -> Rep NameFlavour x
$cto :: forall x. Rep NameFlavour x -> NameFlavour
to :: forall x. Rep NameFlavour x -> NameFlavour
Generic )

data NameSpace = VarName        -- ^ Variables
               | DataName       -- ^ Data constructors
               | TcClsName      -- ^ Type constructors and classes; Haskell has them
                                -- in the same name space for now.
               | FldName
                 { NameSpace -> FilePath
fldParent :: !String
                   -- ^ The textual name of the parent of the field.
                   --
                   --   - For a field of a datatype, this is the name of the first constructor
                   --     of the datatype (regardless of whether this constructor has this field).
                   --   - For a field of a pattern synonym, this is the name of the pattern synonym.
                 }
               deriving( NameSpace -> NameSpace -> Bool
(NameSpace -> NameSpace -> Bool)
-> (NameSpace -> NameSpace -> Bool) -> Eq NameSpace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NameSpace -> NameSpace -> Bool
== :: NameSpace -> NameSpace -> Bool
$c/= :: NameSpace -> NameSpace -> Bool
/= :: NameSpace -> NameSpace -> Bool
Eq, Eq NameSpace
Eq NameSpace =>
(NameSpace -> NameSpace -> Ordering)
-> (NameSpace -> NameSpace -> Bool)
-> (NameSpace -> NameSpace -> Bool)
-> (NameSpace -> NameSpace -> Bool)
-> (NameSpace -> NameSpace -> Bool)
-> (NameSpace -> NameSpace -> NameSpace)
-> (NameSpace -> NameSpace -> NameSpace)
-> Ord NameSpace
NameSpace -> NameSpace -> Bool
NameSpace -> NameSpace -> Ordering
NameSpace -> NameSpace -> NameSpace
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: NameSpace -> NameSpace -> Ordering
compare :: NameSpace -> NameSpace -> Ordering
$c< :: NameSpace -> NameSpace -> Bool
< :: NameSpace -> NameSpace -> Bool
$c<= :: NameSpace -> NameSpace -> Bool
<= :: NameSpace -> NameSpace -> Bool
$c> :: NameSpace -> NameSpace -> Bool
> :: NameSpace -> NameSpace -> Bool
$c>= :: NameSpace -> NameSpace -> Bool
>= :: NameSpace -> NameSpace -> Bool
$cmax :: NameSpace -> NameSpace -> NameSpace
max :: NameSpace -> NameSpace -> NameSpace
$cmin :: NameSpace -> NameSpace -> NameSpace
min :: NameSpace -> NameSpace -> NameSpace
Ord, Int -> NameSpace -> FilePath -> FilePath
[NameSpace] -> FilePath -> FilePath
NameSpace -> FilePath
(Int -> NameSpace -> FilePath -> FilePath)
-> (NameSpace -> FilePath)
-> ([NameSpace] -> FilePath -> FilePath)
-> Show NameSpace
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> NameSpace -> FilePath -> FilePath
showsPrec :: Int -> NameSpace -> FilePath -> FilePath
$cshow :: NameSpace -> FilePath
show :: NameSpace -> FilePath
$cshowList :: [NameSpace] -> FilePath -> FilePath
showList :: [NameSpace] -> FilePath -> FilePath
Show, Typeable NameSpace
Typeable NameSpace =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NameSpace -> c NameSpace)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NameSpace)
-> (NameSpace -> Constr)
-> (NameSpace -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NameSpace))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NameSpace))
-> ((forall b. Data b => b -> b) -> NameSpace -> NameSpace)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NameSpace -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NameSpace -> r)
-> (forall u. (forall d. Data d => d -> u) -> NameSpace -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NameSpace -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NameSpace -> m NameSpace)
-> Data NameSpace
NameSpace -> Constr
NameSpace -> DataType
(forall b. Data b => b -> b) -> NameSpace -> NameSpace
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> NameSpace -> u
forall u. (forall d. Data d => d -> u) -> NameSpace -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameSpace
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameSpace -> c NameSpace
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameSpace)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NameSpace)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameSpace -> c NameSpace
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NameSpace -> c NameSpace
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameSpace
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NameSpace
$ctoConstr :: NameSpace -> Constr
toConstr :: NameSpace -> Constr
$cdataTypeOf :: NameSpace -> DataType
dataTypeOf :: NameSpace -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameSpace)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NameSpace)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NameSpace)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NameSpace)
$cgmapT :: (forall b. Data b => b -> b) -> NameSpace -> NameSpace
gmapT :: (forall b. Data b => b -> b) -> NameSpace -> NameSpace
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NameSpace -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NameSpace -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> NameSpace -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NameSpace -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NameSpace -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NameSpace -> m NameSpace
Data, (forall x. NameSpace -> Rep NameSpace x)
-> (forall x. Rep NameSpace x -> NameSpace) -> Generic NameSpace
forall x. Rep NameSpace x -> NameSpace
forall x. NameSpace -> Rep NameSpace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. NameSpace -> Rep NameSpace x
from :: forall x. NameSpace -> Rep NameSpace x
$cto :: forall x. Rep NameSpace x -> NameSpace
to :: forall x. Rep NameSpace x -> NameSpace
Generic )

-- | @Uniq@ is used by GHC to distinguish names from each other.
type Uniq = Integer

-- | The name without its module prefix.
--
-- ==== __Examples__
--
-- >>> nameBase ''Data.Either.Either
-- "Either"
-- >>> nameBase (mkName "foo")
-- "foo"
-- >>> nameBase (mkName "Module.foo")
-- "foo"
nameBase :: Name -> String
nameBase :: Name -> FilePath
nameBase (Name OccName
occ NameFlavour
_) = OccName -> FilePath
occString OccName
occ

-- | Module prefix of a name, if it exists.
--
-- ==== __Examples__
--
-- >>> nameModule ''Data.Either.Either
-- Just "Data.Either"
-- >>> nameModule (mkName "foo")
-- Nothing
-- >>> nameModule (mkName "Module.foo")
-- Just "Module"
nameModule :: Name -> Maybe String
nameModule :: Name -> Maybe FilePath
nameModule (Name OccName
_ (NameQ ModName
m))     = FilePath -> Maybe FilePath
forall a. a -> Maybe a
Just (ModName -> FilePath
modString ModName
m)
nameModule (Name OccName
_ (NameG NameSpace
_ PkgName
_ ModName
m)) = FilePath -> Maybe FilePath
forall a. a -> Maybe a
Just (ModName -> FilePath
modString ModName
m)
nameModule Name
_                      = Maybe FilePath
forall a. Maybe a
Nothing

-- | A name's package, if it exists.
--
-- ==== __Examples__
--
-- >>> namePackage ''Data.Either.Either
-- Just "base"
-- >>> namePackage (mkName "foo")
-- Nothing
-- >>> namePackage (mkName "Module.foo")
-- Nothing
namePackage :: Name -> Maybe String
namePackage :: Name -> Maybe FilePath
namePackage (Name OccName
_ (NameG NameSpace
_ PkgName
p ModName
_)) = FilePath -> Maybe FilePath
forall a. a -> Maybe a
Just (PkgName -> FilePath
pkgString PkgName
p)
namePackage Name
_                      = Maybe FilePath
forall a. Maybe a
Nothing

-- | Returns whether a name represents an occurrence of a top-level variable
-- ('VarName'), data constructor ('DataName'), type constructor, or type class
-- ('TcClsName'). If we can't be sure, it returns 'Nothing'.
--
-- ==== __Examples__
--
-- >>> nameSpace 'Prelude.id
-- Just VarName
-- >>> nameSpace (mkName "id")
-- Nothing -- only works for top-level variable names
-- >>> nameSpace 'Data.Maybe.Just
-- Just DataName
-- >>> nameSpace ''Data.Maybe.Maybe
-- Just TcClsName
-- >>> nameSpace ''Data.Ord.Ord
-- Just TcClsName
nameSpace :: Name -> Maybe NameSpace
nameSpace :: Name -> Maybe NameSpace
nameSpace (Name OccName
_ (NameG NameSpace
ns PkgName
_ ModName
_)) = NameSpace -> Maybe NameSpace
forall a. a -> Maybe a
Just NameSpace
ns
nameSpace Name
_                       = Maybe NameSpace
forall a. Maybe a
Nothing

{- |
Generate a capturable name. Occurrences of such names will be
resolved according to the Haskell scoping rules at the occurrence
site.

For example:

> f = [| pi + $(varE (mkName "pi")) |]
> ...
> g = let pi = 3 in $f

In this case, @g@ is desugared to

> g = Prelude.pi + 3

Note that @mkName@ may be used with qualified names:

> mkName "Prelude.pi"

See also 'Language.Haskell.TH.Lib.dyn' for a useful combinator. The above example could
be rewritten using 'Language.Haskell.TH.Lib.dyn' as

> f = [| pi + $(dyn "pi") |]
-}
mkName :: String -> Name
-- The string can have a '.', thus "Foo.baz",
-- giving a dynamically-bound qualified name,
-- in which case we want to generate a NameQ
--
-- Parse the string to see if it has a "." in it
-- so we know whether to generate a qualified or unqualified name
-- It's a bit tricky because we need to parse
--
-- > Foo.Baz.x   as    Qual Foo.Baz x
--
-- So we parse it from back to front
mkName :: FilePath -> Name
mkName FilePath
str
  = FilePath -> FilePath -> Name
split [] (FilePath -> FilePath
forall a. [a] -> [a]
reverse FilePath
str)
  where
    split :: FilePath -> FilePath -> Name
split FilePath
occ []        = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
occ) NameFlavour
NameS
    split FilePath
occ (Char
'.':FilePath
rev) | Bool -> Bool
not (FilePath -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null FilePath
occ)
                        , FilePath -> Bool
is_rev_mod_name FilePath
rev
                        = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
occ) (ModName -> NameFlavour
NameQ (FilePath -> ModName
mkModName (FilePath -> FilePath
forall a. [a] -> [a]
reverse FilePath
rev)))
        -- The 'not (null occ)' guard ensures that
        --      mkName "&." = Name "&." NameS
        -- The 'is_rev_mod' guards ensure that
        --      mkName ".&" = Name ".&" NameS
        --      mkName "^.." = Name "^.." NameS      -- #8633
        --      mkName "Data.Bits..&" = Name ".&" (NameQ "Data.Bits")
        -- This rather bizarre case actually happened; (.&.) is in Data.Bits
    split FilePath
occ (Char
c:FilePath
rev)   = FilePath -> FilePath -> Name
split (Char
cChar -> FilePath -> FilePath
forall a. a -> [a] -> [a]
:FilePath
occ) FilePath
rev

    -- Recognises a reversed module name xA.yB.C,
    -- with at least one component,
    -- and each component looks like a module name
    --   (i.e. non-empty, starts with capital, all alpha)
    is_rev_mod_name :: FilePath -> Bool
is_rev_mod_name FilePath
rev_mod_str
      | (FilePath
compt, FilePath
rest) <- (Char -> Bool) -> FilePath -> (FilePath, FilePath)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'.') FilePath
rev_mod_str
      , Bool -> Bool
not (FilePath -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null FilePath
compt), Char -> Bool
isUpper (FilePath -> Char
forall a. HasCallStack => [a] -> a
last FilePath
compt), (Char -> Bool) -> FilePath -> Bool
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
all Char -> Bool
is_mod_char FilePath
compt
      = case FilePath
rest of
          []             -> Bool
True
          (Char
_dot : FilePath
rest') -> FilePath -> Bool
is_rev_mod_name FilePath
rest'
      | Bool
otherwise
      = Bool
False

    is_mod_char :: Char -> Bool
is_mod_char Char
c = Char -> Bool
isAlphaNum Char
c Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'_' Bool -> Bool -> Bool
|| Char
c Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'\''

-- | Only used internally
mkNameU :: String -> Uniq -> Name
mkNameU :: FilePath -> Uniq -> Name
mkNameU FilePath
s Uniq
u = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
s) (Uniq -> NameFlavour
NameU Uniq
u)

-- | Only used internally
mkNameL :: String -> Uniq -> Name
mkNameL :: FilePath -> Uniq -> Name
mkNameL FilePath
s Uniq
u = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
s) (Uniq -> NameFlavour
NameL Uniq
u)

-- | Only used internally
mkNameQ :: String -> String -> Name
mkNameQ :: FilePath -> FilePath -> Name
mkNameQ FilePath
mn FilePath
occ = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
occ) (ModName -> NameFlavour
NameQ (FilePath -> ModName
mkModName FilePath
mn))

-- | Used for 'x etc, but not available to the programmer
mkNameG :: NameSpace -> String -> String -> String -> Name
mkNameG :: NameSpace -> FilePath -> FilePath -> FilePath -> Name
mkNameG NameSpace
ns FilePath
pkg FilePath
modu FilePath
occ
  = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
occ) (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
ns (FilePath -> PkgName
mkPkgName FilePath
pkg) (FilePath -> ModName
mkModName FilePath
modu))

mkNameS :: String -> Name
mkNameS :: FilePath -> Name
mkNameS FilePath
n = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
n) NameFlavour
NameS

mkNameG_v, mkNameG_tc, mkNameG_d :: String -> String -> String -> Name
mkNameG_v :: FilePath -> FilePath -> FilePath -> Name
mkNameG_v  = NameSpace -> FilePath -> FilePath -> FilePath -> Name
mkNameG NameSpace
VarName
mkNameG_tc :: FilePath -> FilePath -> FilePath -> Name
mkNameG_tc = NameSpace -> FilePath -> FilePath -> FilePath -> Name
mkNameG NameSpace
TcClsName
mkNameG_d :: FilePath -> FilePath -> FilePath -> Name
mkNameG_d  = NameSpace -> FilePath -> FilePath -> FilePath -> Name
mkNameG NameSpace
DataName

mkNameG_fld :: String -- ^ package
            -> String -- ^ module
            -> String -- ^ parent (first constructor of parent type)
            -> String -- ^ field name
            -> Name
mkNameG_fld :: FilePath -> FilePath -> FilePath -> FilePath -> Name
mkNameG_fld FilePath
pkg FilePath
modu FilePath
con FilePath
occ = NameSpace -> FilePath -> FilePath -> FilePath -> Name
mkNameG (FilePath -> NameSpace
FldName FilePath
con) FilePath
pkg FilePath
modu FilePath
occ

data NameIs = Alone | Applied | Infix

showName :: Name -> String
showName :: Name -> FilePath
showName = NameIs -> Name -> FilePath
showName' NameIs
Alone

showName' :: NameIs -> Name -> String
showName' :: NameIs -> Name -> FilePath
showName' NameIs
ni Name
nm
 = case NameIs
ni of
       NameIs
Alone        -> FilePath
nms
       NameIs
Applied
        | Bool
pnam      -> FilePath
nms
        | Bool
otherwise -> FilePath
"(" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
nms FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
")"
       NameIs
Infix
        | Bool
pnam      -> FilePath
"`" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
nms FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"`"
        | Bool
otherwise -> FilePath
nms
    where
        -- For now, we make the NameQ and NameG print the same, even though
        -- NameQ is a qualified name (so what it means depends on what the
        -- current scope is), and NameG is an original name (so its meaning
        -- should be independent of what's in scope.
        -- We may well want to distinguish them in the end.
        -- Ditto NameU and NameL
        nms :: FilePath
nms = case Name
nm of
          Name OccName
occ NameFlavour
NameS          -> OccName -> FilePath
occString OccName
occ
          Name OccName
occ (NameQ ModName
m)      -> ModName -> FilePath
modString ModName
m FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ OccName -> FilePath
occString OccName
occ
          Name OccName
occ (NameG NameSpace
_ PkgName
_ ModName
m) -> ModName -> FilePath
modString ModName
m FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ OccName -> FilePath
occString OccName
occ
          Name OccName
occ (NameU Uniq
u)      -> OccName -> FilePath
occString OccName
occ FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"_" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Uniq -> FilePath
forall a. Show a => a -> FilePath
show Uniq
u
          Name OccName
occ (NameL Uniq
u)      -> OccName -> FilePath
occString OccName
occ FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"_" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Uniq -> FilePath
forall a. Show a => a -> FilePath
show Uniq
u

        pnam :: Bool
pnam = FilePath -> Bool
classify FilePath
nms

        -- True if we are function style, e.g. f, [], (,)
        -- False if we are operator style, e.g. +, :+
        classify :: FilePath -> Bool
classify FilePath
"" = Bool
False -- shouldn't happen; . operator is handled below
        classify (Char
x:FilePath
xs) | Char -> Bool
isAlpha Char
x Bool -> Bool -> Bool
|| (Char
x Char -> FilePath -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` FilePath
"_[]()") =
                            case (Char -> Bool) -> FilePath -> FilePath
forall a. (a -> Bool) -> [a] -> [a]
dropWhile (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/=Char
'.') FilePath
xs of
                                  (Char
_:FilePath
xs') -> FilePath -> Bool
classify FilePath
xs'
                                  []      -> Bool
True
                        | Bool
otherwise = Bool
False

instance Show Name where
  show :: Name -> FilePath
show = Name -> FilePath
showName

-- Tuple data and type constructors
-- | Tuple data constructor
tupleDataName :: Int -> Name
-- | Tuple type constructor
tupleTypeName :: Int -> Name

tupleDataName :: Int -> Name
tupleDataName Int
n = Int -> NameSpace -> Bool -> Name
mk_tup_name Int
n NameSpace
DataName  Bool
True
tupleTypeName :: Int -> Name
tupleTypeName Int
n = Int -> NameSpace -> Bool -> Name
mk_tup_name Int
n NameSpace
TcClsName Bool
True

-- Unboxed tuple data and type constructors
-- | Unboxed tuple data constructor
unboxedTupleDataName :: Int -> Name
-- | Unboxed tuple type constructor
unboxedTupleTypeName :: Int -> Name

unboxedTupleDataName :: Int -> Name
unboxedTupleDataName Int
n = Int -> NameSpace -> Bool -> Name
mk_tup_name Int
n NameSpace
DataName  Bool
False
unboxedTupleTypeName :: Int -> Name
unboxedTupleTypeName Int
n = Int -> NameSpace -> Bool -> Name
mk_tup_name Int
n NameSpace
TcClsName Bool
False

mk_tup_name :: Int -> NameSpace -> Bool -> Name
mk_tup_name :: Int -> NameSpace -> Bool -> Name
mk_tup_name Int
n NameSpace
space Bool
boxed
  = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
tup_occ) (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
space (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim") ModName
tup_mod)
  where
    withParens :: FilePath -> FilePath
withParens FilePath
thing
      | Bool
boxed     = FilePath
"("  FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
thing FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
")"
      | Bool
otherwise = FilePath
"(#" FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
thing FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"#)"
    tup_occ :: FilePath
tup_occ | Int
n Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
1    = if Bool
boxed then FilePath
solo else FilePath
"Solo#"
            | Bool
otherwise = FilePath -> FilePath
withParens (Int -> Char -> FilePath
forall a. Int -> a -> [a]
replicate Int
n_commas Char
',')
    n_commas :: Int
n_commas = Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1
    tup_mod :: ModName
tup_mod  = FilePath -> ModName
mkModName FilePath
"GHC.Tuple.Prim"
    solo :: FilePath
solo
      | NameSpace
space NameSpace -> NameSpace -> Bool
forall a. Eq a => a -> a -> Bool
== NameSpace
DataName = FilePath
"MkSolo"
      | Bool
otherwise = FilePath
"Solo"

-- Unboxed sum data and type constructors
-- | Unboxed sum data constructor
unboxedSumDataName :: SumAlt -> SumArity -> Name
-- | Unboxed sum type constructor
unboxedSumTypeName :: SumArity -> Name

unboxedSumDataName :: Int -> Int -> Name
unboxedSumDataName Int
alt Int
arity
  | Int
alt Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
arity
  = FilePath -> Name
forall a. HasCallStack => FilePath -> a
error (FilePath -> Name) -> FilePath -> Name
forall a b. (a -> b) -> a -> b
$ FilePath
prefix FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"Index out of bounds." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
debug_info

  | Int
alt Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
0
  = FilePath -> Name
forall a. HasCallStack => FilePath -> a
error (FilePath -> Name) -> FilePath -> Name
forall a b. (a -> b) -> a -> b
$ FilePath
prefix FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"Alt must be > 0." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
debug_info

  | Int
arity Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
2
  = FilePath -> Name
forall a. HasCallStack => FilePath -> a
error (FilePath -> Name) -> FilePath -> Name
forall a b. (a -> b) -> a -> b
$ FilePath
prefix FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"Arity must be >= 2." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
debug_info

  | Bool
otherwise
  = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
sum_occ)
         (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
DataName (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim") (FilePath -> ModName
mkModName FilePath
"GHC.Prim"))

  where
    prefix :: FilePath
prefix     = FilePath
"unboxedSumDataName: "
    debug_info :: FilePath
debug_info = FilePath
" (alt: " FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Int -> FilePath
forall a. Show a => a -> FilePath
show Int
alt FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
", arity: " FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Int -> FilePath
forall a. Show a => a -> FilePath
show Int
arity FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
")"

    -- Synced with the definition of mkSumDataConOcc in GHC.Builtin.Types
    sum_occ :: FilePath
sum_occ = Char
'(' Char -> FilePath -> FilePath
forall a. a -> [a] -> [a]
: Char
'#' Char -> FilePath -> FilePath
forall a. a -> [a] -> [a]
: Int -> FilePath
bars Int
nbars_before FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Char
'_' Char -> FilePath -> FilePath
forall a. a -> [a] -> [a]
: Int -> FilePath
bars Int
nbars_after FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"#)"
    bars :: Int -> FilePath
bars Int
i = Int -> Char -> FilePath
forall a. Int -> a -> [a]
replicate Int
i Char
'|'
    nbars_before :: Int
nbars_before = Int
alt Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1
    nbars_after :: Int
nbars_after  = Int
arity Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
alt

unboxedSumTypeName :: Int -> Name
unboxedSumTypeName Int
arity
  | Int
arity Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
2
  = FilePath -> Name
forall a. HasCallStack => FilePath -> a
error (FilePath -> Name) -> FilePath -> Name
forall a b. (a -> b) -> a -> b
$ FilePath
"unboxedSumTypeName: Arity must be >= 2."
         FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
" (arity: " FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ Int -> FilePath
forall a. Show a => a -> FilePath
show Int
arity FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
")"

  | Bool
otherwise
  = OccName -> NameFlavour -> Name
Name (FilePath -> OccName
mkOccName FilePath
sum_occ)
         (NameSpace -> PkgName -> ModName -> NameFlavour
NameG NameSpace
TcClsName (FilePath -> PkgName
mkPkgName FilePath
"ghc-prim") (FilePath -> ModName
mkModName FilePath
"GHC.Prim"))

  where
    -- Synced with the definition of mkSumTyConOcc in GHC.Builtin.Types
    sum_occ :: FilePath
sum_occ = Char
'(' Char -> FilePath -> FilePath
forall a. a -> [a] -> [a]
: Char
'#' Char -> FilePath -> FilePath
forall a. a -> [a] -> [a]
: Int -> Char -> FilePath
forall a. Int -> a -> [a]
replicate (Int
arity Int -> Int -> Int
forall a. Num a => a -> a -> a
- Int
1) Char
'|' FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
"#)"

-----------------------------------------------------
--              Locations
-----------------------------------------------------

data Loc
  = Loc { Loc -> FilePath
loc_filename :: String
        , Loc -> FilePath
loc_package  :: String
        , Loc -> FilePath
loc_module   :: String
        , Loc -> CharPos
loc_start    :: CharPos
        , Loc -> CharPos
loc_end      :: CharPos }
   deriving( Int -> Loc -> FilePath -> FilePath
[Loc] -> FilePath -> FilePath
Loc -> FilePath
(Int -> Loc -> FilePath -> FilePath)
-> (Loc -> FilePath) -> ([Loc] -> FilePath -> FilePath) -> Show Loc
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Loc -> FilePath -> FilePath
showsPrec :: Int -> Loc -> FilePath -> FilePath
$cshow :: Loc -> FilePath
show :: Loc -> FilePath
$cshowList :: [Loc] -> FilePath -> FilePath
showList :: [Loc] -> FilePath -> FilePath
Show, Loc -> Loc -> Bool
(Loc -> Loc -> Bool) -> (Loc -> Loc -> Bool) -> Eq Loc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Loc -> Loc -> Bool
== :: Loc -> Loc -> Bool
$c/= :: Loc -> Loc -> Bool
/= :: Loc -> Loc -> Bool
Eq, Eq Loc
Eq Loc =>
(Loc -> Loc -> Ordering)
-> (Loc -> Loc -> Bool)
-> (Loc -> Loc -> Bool)
-> (Loc -> Loc -> Bool)
-> (Loc -> Loc -> Bool)
-> (Loc -> Loc -> Loc)
-> (Loc -> Loc -> Loc)
-> Ord Loc
Loc -> Loc -> Bool
Loc -> Loc -> Ordering
Loc -> Loc -> Loc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Loc -> Loc -> Ordering
compare :: Loc -> Loc -> Ordering
$c< :: Loc -> Loc -> Bool
< :: Loc -> Loc -> Bool
$c<= :: Loc -> Loc -> Bool
<= :: Loc -> Loc -> Bool
$c> :: Loc -> Loc -> Bool
> :: Loc -> Loc -> Bool
$c>= :: Loc -> Loc -> Bool
>= :: Loc -> Loc -> Bool
$cmax :: Loc -> Loc -> Loc
max :: Loc -> Loc -> Loc
$cmin :: Loc -> Loc -> Loc
min :: Loc -> Loc -> Loc
Ord, Typeable Loc
Typeable Loc =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Loc -> c Loc)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Loc)
-> (Loc -> Constr)
-> (Loc -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Loc))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc))
-> ((forall b. Data b => b -> b) -> Loc -> Loc)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r)
-> (forall u. (forall d. Data d => d -> u) -> Loc -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Loc -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Loc -> m Loc)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Loc -> m Loc)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Loc -> m Loc)
-> Data Loc
Loc -> Constr
Loc -> DataType
(forall b. Data b => b -> b) -> Loc -> Loc
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Loc -> u
forall u. (forall d. Data d => d -> u) -> Loc -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Loc
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Loc -> c Loc
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Loc)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Loc -> c Loc
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Loc -> c Loc
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Loc
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Loc
$ctoConstr :: Loc -> Constr
toConstr :: Loc -> Constr
$cdataTypeOf :: Loc -> DataType
dataTypeOf :: Loc -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Loc)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Loc)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc)
$cgmapT :: (forall b. Data b => b -> b) -> Loc -> Loc
gmapT :: (forall b. Data b => b -> b) -> Loc -> Loc
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Loc -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Loc -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Loc -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Loc -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Loc -> m Loc
Data, (forall x. Loc -> Rep Loc x)
-> (forall x. Rep Loc x -> Loc) -> Generic Loc
forall x. Rep Loc x -> Loc
forall x. Loc -> Rep Loc x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Loc -> Rep Loc x
from :: forall x. Loc -> Rep Loc x
$cto :: forall x. Rep Loc x -> Loc
to :: forall x. Rep Loc x -> Loc
Generic )

type CharPos = (Int, Int)       -- ^ Line and character position


-----------------------------------------------------
--
--      The Info returned by reification
--
-----------------------------------------------------

-- | Obtained from 'reify' in the 'Q' Monad.
data Info
  =
  -- | A class, with a list of its visible instances
  ClassI
      Dec
      [InstanceDec]

  -- | A class method
  | ClassOpI
       Name
       Type
       ParentName

  -- | A \"plain\" type constructor. \"Fancier\" type constructors are returned
  -- using 'PrimTyConI' or 'FamilyI' as appropriate. At present, this reified
  -- declaration will never have derived instances attached to it (if you wish
  -- to check for an instance, see 'reifyInstances').
  | TyConI
        Dec

  -- | A type or data family, with a list of its visible instances. A closed
  -- type family is returned with 0 instances.
  | FamilyI
        Dec
        [InstanceDec]

  -- | A \"primitive\" type constructor, which can't be expressed with a 'Dec'.
  -- Examples: @(->)@, @Int#@.
  | PrimTyConI
       Name
       Arity
       Unlifted

  -- | A data constructor
  | DataConI
       Name
       Type
       ParentName

  -- | A pattern synonym
  | PatSynI
       Name
       PatSynType

  {- |
  A \"value\" variable (as opposed to a type variable, see 'TyVarI').

  The @Maybe Dec@ field contains @Just@ the declaration which
  defined the variable - including the RHS of the declaration -
  or else @Nothing@, in the case where the RHS is unavailable to
  the compiler. At present, this value is /always/ @Nothing@:
  returning the RHS has not yet been implemented because of
  lack of interest.
  -}
  | VarI
       Name
       Type
       (Maybe Dec)

  {- |
  A type variable.

  The @Type@ field contains the type which underlies the variable.
  At present, this is always @'VarT' theName@, but future changes
  may permit refinement of this.
  -}
  | TyVarI      -- Scoped type variable
        Name
        Type    -- What it is bound to
  deriving( Int -> Info -> FilePath -> FilePath
[Info] -> FilePath -> FilePath
Info -> FilePath
(Int -> Info -> FilePath -> FilePath)
-> (Info -> FilePath)
-> ([Info] -> FilePath -> FilePath)
-> Show Info
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Info -> FilePath -> FilePath
showsPrec :: Int -> Info -> FilePath -> FilePath
$cshow :: Info -> FilePath
show :: Info -> FilePath
$cshowList :: [Info] -> FilePath -> FilePath
showList :: [Info] -> FilePath -> FilePath
Show, Info -> Info -> Bool
(Info -> Info -> Bool) -> (Info -> Info -> Bool) -> Eq Info
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Info -> Info -> Bool
== :: Info -> Info -> Bool
$c/= :: Info -> Info -> Bool
/= :: Info -> Info -> Bool
Eq, Eq Info
Eq Info =>
(Info -> Info -> Ordering)
-> (Info -> Info -> Bool)
-> (Info -> Info -> Bool)
-> (Info -> Info -> Bool)
-> (Info -> Info -> Bool)
-> (Info -> Info -> Info)
-> (Info -> Info -> Info)
-> Ord Info
Info -> Info -> Bool
Info -> Info -> Ordering
Info -> Info -> Info
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Info -> Info -> Ordering
compare :: Info -> Info -> Ordering
$c< :: Info -> Info -> Bool
< :: Info -> Info -> Bool
$c<= :: Info -> Info -> Bool
<= :: Info -> Info -> Bool
$c> :: Info -> Info -> Bool
> :: Info -> Info -> Bool
$c>= :: Info -> Info -> Bool
>= :: Info -> Info -> Bool
$cmax :: Info -> Info -> Info
max :: Info -> Info -> Info
$cmin :: Info -> Info -> Info
min :: Info -> Info -> Info
Ord, Typeable Info
Typeable Info =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Info -> c Info)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Info)
-> (Info -> Constr)
-> (Info -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Info))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Info))
-> ((forall b. Data b => b -> b) -> Info -> Info)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r)
-> (forall u. (forall d. Data d => d -> u) -> Info -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Info -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Info -> m Info)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Info -> m Info)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Info -> m Info)
-> Data Info
Info -> Constr
Info -> DataType
(forall b. Data b => b -> b) -> Info -> Info
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Info -> u
forall u. (forall d. Data d => d -> u) -> Info -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Info -> m Info
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Info -> m Info
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Info
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Info -> c Info
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Info)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Info)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Info -> c Info
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Info -> c Info
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Info
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Info
$ctoConstr :: Info -> Constr
toConstr :: Info -> Constr
$cdataTypeOf :: Info -> DataType
dataTypeOf :: Info -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Info)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Info)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Info)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Info)
$cgmapT :: (forall b. Data b => b -> b) -> Info -> Info
gmapT :: (forall b. Data b => b -> b) -> Info -> Info
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Info -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Info -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Info -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Info -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Info -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Info -> m Info
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Info -> m Info
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Info -> m Info
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Info -> m Info
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Info -> m Info
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Info -> m Info
Data, (forall x. Info -> Rep Info x)
-> (forall x. Rep Info x -> Info) -> Generic Info
forall x. Rep Info x -> Info
forall x. Info -> Rep Info x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Info -> Rep Info x
from :: forall x. Info -> Rep Info x
$cto :: forall x. Rep Info x -> Info
to :: forall x. Rep Info x -> Info
Generic )

-- | Obtained from 'reifyModule' in the 'Q' Monad.
data ModuleInfo =
  -- | Contains the import list of the module.
  ModuleInfo [Module]
  deriving( Int -> ModuleInfo -> FilePath -> FilePath
[ModuleInfo] -> FilePath -> FilePath
ModuleInfo -> FilePath
(Int -> ModuleInfo -> FilePath -> FilePath)
-> (ModuleInfo -> FilePath)
-> ([ModuleInfo] -> FilePath -> FilePath)
-> Show ModuleInfo
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> ModuleInfo -> FilePath -> FilePath
showsPrec :: Int -> ModuleInfo -> FilePath -> FilePath
$cshow :: ModuleInfo -> FilePath
show :: ModuleInfo -> FilePath
$cshowList :: [ModuleInfo] -> FilePath -> FilePath
showList :: [ModuleInfo] -> FilePath -> FilePath
Show, ModuleInfo -> ModuleInfo -> Bool
(ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> Bool) -> Eq ModuleInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModuleInfo -> ModuleInfo -> Bool
== :: ModuleInfo -> ModuleInfo -> Bool
$c/= :: ModuleInfo -> ModuleInfo -> Bool
/= :: ModuleInfo -> ModuleInfo -> Bool
Eq, Eq ModuleInfo
Eq ModuleInfo =>
(ModuleInfo -> ModuleInfo -> Ordering)
-> (ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> Bool)
-> (ModuleInfo -> ModuleInfo -> ModuleInfo)
-> (ModuleInfo -> ModuleInfo -> ModuleInfo)
-> Ord ModuleInfo
ModuleInfo -> ModuleInfo -> Bool
ModuleInfo -> ModuleInfo -> Ordering
ModuleInfo -> ModuleInfo -> ModuleInfo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ModuleInfo -> ModuleInfo -> Ordering
compare :: ModuleInfo -> ModuleInfo -> Ordering
$c< :: ModuleInfo -> ModuleInfo -> Bool
< :: ModuleInfo -> ModuleInfo -> Bool
$c<= :: ModuleInfo -> ModuleInfo -> Bool
<= :: ModuleInfo -> ModuleInfo -> Bool
$c> :: ModuleInfo -> ModuleInfo -> Bool
> :: ModuleInfo -> ModuleInfo -> Bool
$c>= :: ModuleInfo -> ModuleInfo -> Bool
>= :: ModuleInfo -> ModuleInfo -> Bool
$cmax :: ModuleInfo -> ModuleInfo -> ModuleInfo
max :: ModuleInfo -> ModuleInfo -> ModuleInfo
$cmin :: ModuleInfo -> ModuleInfo -> ModuleInfo
min :: ModuleInfo -> ModuleInfo -> ModuleInfo
Ord, Typeable ModuleInfo
Typeable ModuleInfo =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ModuleInfo)
-> (ModuleInfo -> Constr)
-> (ModuleInfo -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ModuleInfo))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ModuleInfo))
-> ((forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r)
-> (forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo)
-> Data ModuleInfo
ModuleInfo -> Constr
ModuleInfo -> DataType
(forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ModuleInfo -> c ModuleInfo
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModuleInfo
$ctoConstr :: ModuleInfo -> Constr
toConstr :: ModuleInfo -> Constr
$cdataTypeOf :: ModuleInfo -> DataType
dataTypeOf :: ModuleInfo -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ModuleInfo)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleInfo)
$cgmapT :: (forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
gmapT :: (forall b. Data b => b -> b) -> ModuleInfo -> ModuleInfo
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ModuleInfo -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ModuleInfo -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ModuleInfo -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ModuleInfo -> m ModuleInfo
Data, (forall x. ModuleInfo -> Rep ModuleInfo x)
-> (forall x. Rep ModuleInfo x -> ModuleInfo) -> Generic ModuleInfo
forall x. Rep ModuleInfo x -> ModuleInfo
forall x. ModuleInfo -> Rep ModuleInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ModuleInfo -> Rep ModuleInfo x
from :: forall x. ModuleInfo -> Rep ModuleInfo x
$cto :: forall x. Rep ModuleInfo x -> ModuleInfo
to :: forall x. Rep ModuleInfo x -> ModuleInfo
Generic )

{- |
In 'ClassOpI' and 'DataConI', name of the parent class or type
-}
type ParentName = Name

-- | In 'UnboxedSumE' and 'UnboxedSumP', the number associated with a
-- particular data constructor. 'SumAlt's are one-indexed and should never
-- exceed the value of its corresponding 'SumArity'. For example:
--
-- * @(\#_|\#)@ has 'SumAlt' 1 (out of a total 'SumArity' of 2)
--
-- * @(\#|_\#)@ has 'SumAlt' 2 (out of a total 'SumArity' of 2)
type SumAlt = Int

-- | In 'UnboxedSumE', 'UnboxedSumT', and 'UnboxedSumP', the total number of
-- 'SumAlt's. For example, @(\#|\#)@ has a 'SumArity' of 2.
type SumArity = Int

-- | In 'PrimTyConI', arity of the type constructor
type Arity = Int

-- | In 'PrimTyConI', is the type constructor unlifted?
type Unlifted = Bool

-- | 'InstanceDec' describes a single instance of a class or type function.
-- It is just a 'Dec', but guaranteed to be one of the following:
--
--   * 'InstanceD' (with empty @['Dec']@)
--
--   * 'DataInstD' or 'NewtypeInstD' (with empty derived @['Name']@)
--
--   * 'TySynInstD'
type InstanceDec = Dec

data Fixity          = Fixity Int FixityDirection
    deriving( Fixity -> Fixity -> Bool
(Fixity -> Fixity -> Bool)
-> (Fixity -> Fixity -> Bool) -> Eq Fixity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Fixity -> Fixity -> Bool
== :: Fixity -> Fixity -> Bool
$c/= :: Fixity -> Fixity -> Bool
/= :: Fixity -> Fixity -> Bool
Eq, Eq Fixity
Eq Fixity =>
(Fixity -> Fixity -> Ordering)
-> (Fixity -> Fixity -> Bool)
-> (Fixity -> Fixity -> Bool)
-> (Fixity -> Fixity -> Bool)
-> (Fixity -> Fixity -> Bool)
-> (Fixity -> Fixity -> Fixity)
-> (Fixity -> Fixity -> Fixity)
-> Ord Fixity
Fixity -> Fixity -> Bool
Fixity -> Fixity -> Ordering
Fixity -> Fixity -> Fixity
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Fixity -> Fixity -> Ordering
compare :: Fixity -> Fixity -> Ordering
$c< :: Fixity -> Fixity -> Bool
< :: Fixity -> Fixity -> Bool
$c<= :: Fixity -> Fixity -> Bool
<= :: Fixity -> Fixity -> Bool
$c> :: Fixity -> Fixity -> Bool
> :: Fixity -> Fixity -> Bool
$c>= :: Fixity -> Fixity -> Bool
>= :: Fixity -> Fixity -> Bool
$cmax :: Fixity -> Fixity -> Fixity
max :: Fixity -> Fixity -> Fixity
$cmin :: Fixity -> Fixity -> Fixity
min :: Fixity -> Fixity -> Fixity
Ord, Int -> Fixity -> FilePath -> FilePath
[Fixity] -> FilePath -> FilePath
Fixity -> FilePath
(Int -> Fixity -> FilePath -> FilePath)
-> (Fixity -> FilePath)
-> ([Fixity] -> FilePath -> FilePath)
-> Show Fixity
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Fixity -> FilePath -> FilePath
showsPrec :: Int -> Fixity -> FilePath -> FilePath
$cshow :: Fixity -> FilePath
show :: Fixity -> FilePath
$cshowList :: [Fixity] -> FilePath -> FilePath
showList :: [Fixity] -> FilePath -> FilePath
Show, Typeable Fixity
Typeable Fixity =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Fixity -> c Fixity)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Fixity)
-> (Fixity -> Constr)
-> (Fixity -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Fixity))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity))
-> ((forall b. Data b => b -> b) -> Fixity -> Fixity)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Fixity -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Fixity -> r)
-> (forall u. (forall d. Data d => d -> u) -> Fixity -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Fixity -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Fixity -> m Fixity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Fixity -> m Fixity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Fixity -> m Fixity)
-> Data Fixity
Fixity -> Constr
Fixity -> DataType
(forall b. Data b => b -> b) -> Fixity -> Fixity
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Fixity -> u
forall u. (forall d. Data d => d -> u) -> Fixity -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Fixity
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Fixity -> c Fixity
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Fixity)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Fixity -> c Fixity
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Fixity -> c Fixity
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Fixity
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Fixity
$ctoConstr :: Fixity -> Constr
toConstr :: Fixity -> Constr
$cdataTypeOf :: Fixity -> DataType
dataTypeOf :: Fixity -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Fixity)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Fixity)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity)
$cgmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity
gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Fixity -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Fixity -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Fixity -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Fixity -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Fixity -> m Fixity
Data, (forall x. Fixity -> Rep Fixity x)
-> (forall x. Rep Fixity x -> Fixity) -> Generic Fixity
forall x. Rep Fixity x -> Fixity
forall x. Fixity -> Rep Fixity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Fixity -> Rep Fixity x
from :: forall x. Fixity -> Rep Fixity x
$cto :: forall x. Rep Fixity x -> Fixity
to :: forall x. Rep Fixity x -> Fixity
Generic )
data FixityDirection = InfixL | InfixR | InfixN
    deriving( FixityDirection -> FixityDirection -> Bool
(FixityDirection -> FixityDirection -> Bool)
-> (FixityDirection -> FixityDirection -> Bool)
-> Eq FixityDirection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FixityDirection -> FixityDirection -> Bool
== :: FixityDirection -> FixityDirection -> Bool
$c/= :: FixityDirection -> FixityDirection -> Bool
/= :: FixityDirection -> FixityDirection -> Bool
Eq, Eq FixityDirection
Eq FixityDirection =>
(FixityDirection -> FixityDirection -> Ordering)
-> (FixityDirection -> FixityDirection -> Bool)
-> (FixityDirection -> FixityDirection -> Bool)
-> (FixityDirection -> FixityDirection -> Bool)
-> (FixityDirection -> FixityDirection -> Bool)
-> (FixityDirection -> FixityDirection -> FixityDirection)
-> (FixityDirection -> FixityDirection -> FixityDirection)
-> Ord FixityDirection
FixityDirection -> FixityDirection -> Bool
FixityDirection -> FixityDirection -> Ordering
FixityDirection -> FixityDirection -> FixityDirection
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FixityDirection -> FixityDirection -> Ordering
compare :: FixityDirection -> FixityDirection -> Ordering
$c< :: FixityDirection -> FixityDirection -> Bool
< :: FixityDirection -> FixityDirection -> Bool
$c<= :: FixityDirection -> FixityDirection -> Bool
<= :: FixityDirection -> FixityDirection -> Bool
$c> :: FixityDirection -> FixityDirection -> Bool
> :: FixityDirection -> FixityDirection -> Bool
$c>= :: FixityDirection -> FixityDirection -> Bool
>= :: FixityDirection -> FixityDirection -> Bool
$cmax :: FixityDirection -> FixityDirection -> FixityDirection
max :: FixityDirection -> FixityDirection -> FixityDirection
$cmin :: FixityDirection -> FixityDirection -> FixityDirection
min :: FixityDirection -> FixityDirection -> FixityDirection
Ord, Int -> FixityDirection -> FilePath -> FilePath
[FixityDirection] -> FilePath -> FilePath
FixityDirection -> FilePath
(Int -> FixityDirection -> FilePath -> FilePath)
-> (FixityDirection -> FilePath)
-> ([FixityDirection] -> FilePath -> FilePath)
-> Show FixityDirection
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> FixityDirection -> FilePath -> FilePath
showsPrec :: Int -> FixityDirection -> FilePath -> FilePath
$cshow :: FixityDirection -> FilePath
show :: FixityDirection -> FilePath
$cshowList :: [FixityDirection] -> FilePath -> FilePath
showList :: [FixityDirection] -> FilePath -> FilePath
Show, Typeable FixityDirection
Typeable FixityDirection =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> FixityDirection -> c FixityDirection)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c FixityDirection)
-> (FixityDirection -> Constr)
-> (FixityDirection -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c FixityDirection))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c FixityDirection))
-> ((forall b. Data b => b -> b)
    -> FixityDirection -> FixityDirection)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> FixityDirection -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FixityDirection -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> FixityDirection -> m FixityDirection)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FixityDirection -> m FixityDirection)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FixityDirection -> m FixityDirection)
-> Data FixityDirection
FixityDirection -> Constr
FixityDirection -> DataType
(forall b. Data b => b -> b) -> FixityDirection -> FixityDirection
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> FixityDirection -> u
forall u. (forall d. Data d => d -> u) -> FixityDirection -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FixityDirection
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FixityDirection -> c FixityDirection
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FixityDirection)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FixityDirection)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FixityDirection -> c FixityDirection
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FixityDirection -> c FixityDirection
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FixityDirection
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FixityDirection
$ctoConstr :: FixityDirection -> Constr
toConstr :: FixityDirection -> Constr
$cdataTypeOf :: FixityDirection -> DataType
dataTypeOf :: FixityDirection -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FixityDirection)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FixityDirection)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FixityDirection)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FixityDirection)
$cgmapT :: (forall b. Data b => b -> b) -> FixityDirection -> FixityDirection
gmapT :: (forall b. Data b => b -> b) -> FixityDirection -> FixityDirection
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FixityDirection -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> FixityDirection -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> FixityDirection -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> FixityDirection -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> FixityDirection -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FixityDirection -> m FixityDirection
Data, (forall x. FixityDirection -> Rep FixityDirection x)
-> (forall x. Rep FixityDirection x -> FixityDirection)
-> Generic FixityDirection
forall x. Rep FixityDirection x -> FixityDirection
forall x. FixityDirection -> Rep FixityDirection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FixityDirection -> Rep FixityDirection x
from :: forall x. FixityDirection -> Rep FixityDirection x
$cto :: forall x. Rep FixityDirection x -> FixityDirection
to :: forall x. Rep FixityDirection x -> FixityDirection
Generic )

-- | Highest allowed operator precedence for 'Fixity' constructor (answer: 9)
maxPrecedence :: Int
maxPrecedence :: Int
maxPrecedence = (Int
9::Int)

-- | Default fixity: @infixl 9@
defaultFixity :: Fixity
defaultFixity :: Fixity
defaultFixity = Int -> FixityDirection -> Fixity
Fixity Int
maxPrecedence FixityDirection
InfixL


{-
Note [Unresolved infix]
~~~~~~~~~~~~~~~~~~~~~~~
-}
{- $infix #infix#

When implementing antiquotation for quasiquoters, one often wants
to parse strings into expressions:

> parse :: String -> Maybe Exp

But how should we parse @a + b * c@? If we don't know the fixities of
@+@ and @*@, we don't know whether to parse it as @a + (b * c)@ or @(a
+ b) * c@.

In cases like this, use 'UInfixE', 'UInfixP', 'UInfixT', or 'PromotedUInfixT',
which stand for \"unresolved infix expression/pattern/type/promoted
constructor\", respectively. When the compiler is given a splice containing a
tree of @UInfixE@ applications such as

> UInfixE
>   (UInfixE e1 op1 e2)
>   op2
>   (UInfixE e3 op3 e4)

it will look up and the fixities of the relevant operators and
reassociate the tree as necessary.

  * trees will not be reassociated across 'ParensE', 'ParensP', or 'ParensT',
    which are of use for parsing expressions like

    > (a + b * c) + d * e

  * 'InfixE', 'InfixP', 'InfixT', and 'PromotedInfixT' expressions are never
    reassociated.

  * The 'UInfixE' constructor doesn't support sections. Sections
    such as @(a *)@ have no ambiguity, so 'InfixE' suffices. For longer
    sections such as @(a + b * c -)@, use an 'InfixE' constructor for the
    outer-most section, and use 'UInfixE' constructors for all
    other operators:

    > InfixE
    >   Just (UInfixE ...a + b * c...)
    >   op
    >   Nothing

    Sections such as @(a + b +)@ and @((a + b) +)@ should be rendered
    into 'Exp's differently:

    > (+ a + b)   ---> InfixE Nothing + (Just $ UInfixE a + b)
    >                    -- will result in a fixity error if (+) is left-infix
    > (+ (a + b)) ---> InfixE Nothing + (Just $ ParensE $ UInfixE a + b)
    >                    -- no fixity errors

  * Quoted expressions such as

    > [| a * b + c |] :: Q Exp
    > [p| a : b : c |] :: Q Pat
    > [t| T + T |] :: Q Type

    will never contain 'UInfixE', 'UInfixP', 'UInfixT', 'PromotedUInfixT',
    'InfixT', 'PromotedInfixT, 'ParensE', 'ParensP', or 'ParensT' constructors.

-}

-----------------------------------------------------
--
--      The main syntax data types
--
-----------------------------------------------------

data Lit = CharL Char
         | StringL String
         | IntegerL Integer     -- ^ Used for overloaded and non-overloaded
                                -- literals. We don't have a good way to
                                -- represent non-overloaded literals at
                                -- the moment. Maybe that doesn't matter?
         | RationalL Rational   -- Ditto
         | IntPrimL Integer
         | WordPrimL Integer
         | FloatPrimL Rational
         | DoublePrimL Rational
         | StringPrimL [Word8]  -- ^ A primitive C-style string, type 'Addr#'
         | BytesPrimL Bytes     -- ^ Some raw bytes, type 'Addr#':
         | CharPrimL Char
    deriving( Int -> Lit -> FilePath -> FilePath
[Lit] -> FilePath -> FilePath
Lit -> FilePath
(Int -> Lit -> FilePath -> FilePath)
-> (Lit -> FilePath) -> ([Lit] -> FilePath -> FilePath) -> Show Lit
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Lit -> FilePath -> FilePath
showsPrec :: Int -> Lit -> FilePath -> FilePath
$cshow :: Lit -> FilePath
show :: Lit -> FilePath
$cshowList :: [Lit] -> FilePath -> FilePath
showList :: [Lit] -> FilePath -> FilePath
Show, Lit -> Lit -> Bool
(Lit -> Lit -> Bool) -> (Lit -> Lit -> Bool) -> Eq Lit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Lit -> Lit -> Bool
== :: Lit -> Lit -> Bool
$c/= :: Lit -> Lit -> Bool
/= :: Lit -> Lit -> Bool
Eq, Eq Lit
Eq Lit =>
(Lit -> Lit -> Ordering)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Lit)
-> (Lit -> Lit -> Lit)
-> Ord Lit
Lit -> Lit -> Bool
Lit -> Lit -> Ordering
Lit -> Lit -> Lit
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Lit -> Lit -> Ordering
compare :: Lit -> Lit -> Ordering
$c< :: Lit -> Lit -> Bool
< :: Lit -> Lit -> Bool
$c<= :: Lit -> Lit -> Bool
<= :: Lit -> Lit -> Bool
$c> :: Lit -> Lit -> Bool
> :: Lit -> Lit -> Bool
$c>= :: Lit -> Lit -> Bool
>= :: Lit -> Lit -> Bool
$cmax :: Lit -> Lit -> Lit
max :: Lit -> Lit -> Lit
$cmin :: Lit -> Lit -> Lit
min :: Lit -> Lit -> Lit
Ord, Typeable Lit
Typeable Lit =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Lit -> c Lit)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Lit)
-> (Lit -> Constr)
-> (Lit -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Lit))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit))
-> ((forall b. Data b => b -> b) -> Lit -> Lit)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r)
-> (forall u. (forall d. Data d => d -> u) -> Lit -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> Data Lit
Lit -> Constr
Lit -> DataType
(forall b. Data b => b -> b) -> Lit -> Lit
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u
forall u. (forall d. Data d => d -> u) -> Lit -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Lit)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
$ctoConstr :: Lit -> Constr
toConstr :: Lit -> Constr
$cdataTypeOf :: Lit -> DataType
dataTypeOf :: Lit -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Lit)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Lit)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
$cgmapT :: (forall b. Data b => b -> b) -> Lit -> Lit
gmapT :: (forall b. Data b => b -> b) -> Lit -> Lit
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Lit -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Lit -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
Data, (forall x. Lit -> Rep Lit x)
-> (forall x. Rep Lit x -> Lit) -> Generic Lit
forall x. Rep Lit x -> Lit
forall x. Lit -> Rep Lit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Lit -> Rep Lit x
from :: forall x. Lit -> Rep Lit x
$cto :: forall x. Rep Lit x -> Lit
to :: forall x. Rep Lit x -> Lit
Generic )

    -- We could add Int, Float, Double etc, as we do in HsLit,
    -- but that could complicate the
    -- supposedly-simple TH.Syntax literal type

-- | Raw bytes embedded into the binary.
--
-- Avoid using Bytes constructor directly as it is likely to change in the
-- future. Use helpers such as `mkBytes` in Language.Haskell.TH.Lib instead.
data Bytes = Bytes
   { Bytes -> ForeignPtr Word8
bytesPtr    :: ForeignPtr Word8 -- ^ Pointer to the data
   , Bytes -> Word
bytesOffset :: Word             -- ^ Offset from the pointer
   , Bytes -> Word
bytesSize   :: Word             -- ^ Number of bytes

   -- Maybe someday:
   -- , bytesAlignement  :: Word -- ^ Alignement constraint
   -- , bytesReadOnly    :: Bool -- ^ Shall we embed into a read-only
   --                            --   section or not
   -- , bytesInitialized :: Bool -- ^ False: only use `bytesSize` to allocate
   --                            --   an uninitialized region
   }
   deriving (Typeable Bytes
Typeable Bytes =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Bytes -> c Bytes)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Bytes)
-> (Bytes -> Constr)
-> (Bytes -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Bytes))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bytes))
-> ((forall b. Data b => b -> b) -> Bytes -> Bytes)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r)
-> (forall u. (forall d. Data d => d -> u) -> Bytes -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Bytes -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Bytes -> m Bytes)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bytes -> m Bytes)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bytes -> m Bytes)
-> Data Bytes
Bytes -> Constr
Bytes -> DataType
(forall b. Data b => b -> b) -> Bytes -> Bytes
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Bytes -> u
forall u. (forall d. Data d => d -> u) -> Bytes -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bytes
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bytes -> c Bytes
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bytes)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bytes)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bytes -> c Bytes
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bytes -> c Bytes
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bytes
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bytes
$ctoConstr :: Bytes -> Constr
toConstr :: Bytes -> Constr
$cdataTypeOf :: Bytes -> DataType
dataTypeOf :: Bytes -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bytes)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bytes)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bytes)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bytes)
$cgmapT :: (forall b. Data b => b -> b) -> Bytes -> Bytes
gmapT :: (forall b. Data b => b -> b) -> Bytes -> Bytes
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bytes -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Bytes -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Bytes -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Bytes -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Bytes -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bytes -> m Bytes
Data,(forall x. Bytes -> Rep Bytes x)
-> (forall x. Rep Bytes x -> Bytes) -> Generic Bytes
forall x. Rep Bytes x -> Bytes
forall x. Bytes -> Rep Bytes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Bytes -> Rep Bytes x
from :: forall x. Bytes -> Rep Bytes x
$cto :: forall x. Rep Bytes x -> Bytes
to :: forall x. Rep Bytes x -> Bytes
Generic)

-- We can't derive Show instance for Bytes because we don't want to show the
-- pointer value but the actual bytes (similarly to what ByteString does). See
-- #16457.
instance Show Bytes where
   show :: Bytes -> FilePath
show Bytes
b = IO FilePath -> FilePath
forall a. IO a -> a
unsafePerformIO (IO FilePath -> FilePath) -> IO FilePath -> FilePath
forall a b. (a -> b) -> a -> b
$ ForeignPtr Word8 -> (Ptr Word8 -> IO FilePath) -> IO FilePath
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr (Bytes -> ForeignPtr Word8
bytesPtr Bytes
b) ((Ptr Word8 -> IO FilePath) -> IO FilePath)
-> (Ptr Word8 -> IO FilePath) -> IO FilePath
forall a b. (a -> b) -> a -> b
$ \Ptr Word8
ptr ->
               CStringLen -> IO FilePath
peekCStringLen ( Ptr Word8
ptr Ptr Word8 -> Int -> Ptr CChar
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Bytes -> Word
bytesOffset Bytes
b)
                              , Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Bytes -> Word
bytesSize Bytes
b)
                              )

-- We can't derive Eq and Ord instances for Bytes because we don't want to
-- compare pointer values but the actual bytes (similarly to what ByteString
-- does).  See #16457
instance Eq Bytes where
   == :: Bytes -> Bytes -> Bool
(==) = Bytes -> Bytes -> Bool
eqBytes

instance Ord Bytes where
   compare :: Bytes -> Bytes -> Ordering
compare = Bytes -> Bytes -> Ordering
compareBytes

eqBytes :: Bytes -> Bytes -> Bool
eqBytes :: Bytes -> Bytes -> Bool
eqBytes a :: Bytes
a@(Bytes ForeignPtr Word8
fp Word
off Word
len) b :: Bytes
b@(Bytes ForeignPtr Word8
fp' Word
off' Word
len')
  | Word
len Word -> Word -> Bool
forall a. Eq a => a -> a -> Bool
/= Word
len'              = Bool
False    -- short cut on length
  | ForeignPtr Word8
fp ForeignPtr Word8 -> ForeignPtr Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== ForeignPtr Word8
fp' Bool -> Bool -> Bool
&& Word
off Word -> Word -> Bool
forall a. Eq a => a -> a -> Bool
== Word
off' = Bool
True     -- short cut for the same bytes
  | Bool
otherwise                = Bytes -> Bytes -> Ordering
compareBytes Bytes
a Bytes
b Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
EQ

compareBytes :: Bytes -> Bytes -> Ordering
compareBytes :: Bytes -> Bytes -> Ordering
compareBytes (Bytes ForeignPtr Word8
_   Word
_    Word
0)    (Bytes ForeignPtr Word8
_   Word
_    Word
0)    = Ordering
EQ  -- short cut for empty Bytes
compareBytes (Bytes ForeignPtr Word8
fp1 Word
off1 Word
len1) (Bytes ForeignPtr Word8
fp2 Word
off2 Word
len2) =
    IO Ordering -> Ordering
forall a. IO a -> a
unsafePerformIO (IO Ordering -> Ordering) -> IO Ordering -> Ordering
forall a b. (a -> b) -> a -> b
$
      ForeignPtr Word8 -> (Ptr Word8 -> IO Ordering) -> IO Ordering
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Word8
fp1 ((Ptr Word8 -> IO Ordering) -> IO Ordering)
-> (Ptr Word8 -> IO Ordering) -> IO Ordering
forall a b. (a -> b) -> a -> b
$ \Ptr Word8
p1 ->
      ForeignPtr Word8 -> (Ptr Word8 -> IO Ordering) -> IO Ordering
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Word8
fp2 ((Ptr Word8 -> IO Ordering) -> IO Ordering)
-> (Ptr Word8 -> IO Ordering) -> IO Ordering
forall a b. (a -> b) -> a -> b
$ \Ptr Word8
p2 -> do
        CInt
i <- Ptr Any -> Ptr Any -> CSize -> IO CInt
forall a b. Ptr a -> Ptr b -> CSize -> IO CInt
memcmp (Ptr Word8
p1 Ptr Word8 -> Int -> Ptr Any
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
off1)
                    (Ptr Word8
p2 Ptr Word8 -> Int -> Ptr Any
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
off2)
                    (Word -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word -> Word -> Word
forall a. Ord a => a -> a -> a
min Word
len1 Word
len2))
        Ordering -> IO Ordering
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ordering -> IO Ordering) -> Ordering -> IO Ordering
forall a b. (a -> b) -> a -> b
$! (CInt
i CInt -> CInt -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` CInt
0) Ordering -> Ordering -> Ordering
forall a. Semigroup a => a -> a -> a
<> (Word
len1 Word -> Word -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` Word
len2)

foreign import ccall unsafe "memcmp"
  memcmp :: Ptr a -> Ptr b -> CSize -> IO CInt


-- | Pattern in Haskell given in @{}@
data Pat
  = LitP Lit                        -- ^ @{ 5 or \'c\' }@
  | VarP Name                       -- ^ @{ x }@
  | TupP [Pat]                      -- ^ @{ (p1,p2) }@
  | UnboxedTupP [Pat]               -- ^ @{ (\# p1,p2 \#) }@
  | UnboxedSumP Pat SumAlt SumArity -- ^ @{ (\#|p|\#) }@
  | ConP Name [Type] [Pat]          -- ^ @data T1 = C1 t1 t2; {C1 \@ty1 p1 p2} = e@
  | InfixP Pat Name Pat             -- ^ @foo ({x :+ y}) = e@
  | UInfixP Pat Name Pat            -- ^ @foo ({x :+ y}) = e@
                                    --
                                    -- See "Language.Haskell.TH.Syntax#infix"
  | ParensP Pat                     -- ^ @{(p)}@
                                    --
                                    -- See "Language.Haskell.TH.Syntax#infix"
  | TildeP Pat                      -- ^ @{ ~p }@
  | BangP Pat                       -- ^ @{ !p }@
  | AsP Name Pat                    -- ^ @{ x \@ p }@
  | WildP                           -- ^ @{ _ }@
  | RecP Name [FieldPat]            -- ^ @f (Pt { pointx = x }) = g x@
  | ListP [ Pat ]                   -- ^ @{ [1,2,3] }@
  | SigP Pat Type                   -- ^ @{ p :: t }@
  | ViewP Exp Pat                   -- ^ @{ e -> p }@
  deriving( Int -> Pat -> FilePath -> FilePath
[Pat] -> FilePath -> FilePath
Pat -> FilePath
(Int -> Pat -> FilePath -> FilePath)
-> (Pat -> FilePath) -> ([Pat] -> FilePath -> FilePath) -> Show Pat
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Pat -> FilePath -> FilePath
showsPrec :: Int -> Pat -> FilePath -> FilePath
$cshow :: Pat -> FilePath
show :: Pat -> FilePath
$cshowList :: [Pat] -> FilePath -> FilePath
showList :: [Pat] -> FilePath -> FilePath
Show, Pat -> Pat -> Bool
(Pat -> Pat -> Bool) -> (Pat -> Pat -> Bool) -> Eq Pat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Pat -> Pat -> Bool
== :: Pat -> Pat -> Bool
$c/= :: Pat -> Pat -> Bool
/= :: Pat -> Pat -> Bool
Eq, Eq Pat
Eq Pat =>
(Pat -> Pat -> Ordering)
-> (Pat -> Pat -> Bool)
-> (Pat -> Pat -> Bool)
-> (Pat -> Pat -> Bool)
-> (Pat -> Pat -> Bool)
-> (Pat -> Pat -> Pat)
-> (Pat -> Pat -> Pat)
-> Ord Pat
Pat -> Pat -> Bool
Pat -> Pat -> Ordering
Pat -> Pat -> Pat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Pat -> Pat -> Ordering
compare :: Pat -> Pat -> Ordering
$c< :: Pat -> Pat -> Bool
< :: Pat -> Pat -> Bool
$c<= :: Pat -> Pat -> Bool
<= :: Pat -> Pat -> Bool
$c> :: Pat -> Pat -> Bool
> :: Pat -> Pat -> Bool
$c>= :: Pat -> Pat -> Bool
>= :: Pat -> Pat -> Bool
$cmax :: Pat -> Pat -> Pat
max :: Pat -> Pat -> Pat
$cmin :: Pat -> Pat -> Pat
min :: Pat -> Pat -> Pat
Ord, Typeable Pat
Typeable Pat =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Pat -> c Pat)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Pat)
-> (Pat -> Constr)
-> (Pat -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Pat))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pat))
-> ((forall b. Data b => b -> b) -> Pat -> Pat)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r)
-> (forall u. (forall d. Data d => d -> u) -> Pat -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Pat -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Pat -> m Pat)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pat -> m Pat)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pat -> m Pat)
-> Data Pat
Pat -> Constr
Pat -> DataType
(forall b. Data b => b -> b) -> Pat -> Pat
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Pat -> u
forall u. (forall d. Data d => d -> u) -> Pat -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pat
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pat -> c Pat
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pat)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pat)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pat -> c Pat
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pat -> c Pat
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pat
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pat
$ctoConstr :: Pat -> Constr
toConstr :: Pat -> Constr
$cdataTypeOf :: Pat -> DataType
dataTypeOf :: Pat -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pat)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pat)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pat)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pat)
$cgmapT :: (forall b. Data b => b -> b) -> Pat -> Pat
gmapT :: (forall b. Data b => b -> b) -> Pat -> Pat
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pat -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Pat -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Pat -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pat -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pat -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pat -> m Pat
Data, (forall x. Pat -> Rep Pat x)
-> (forall x. Rep Pat x -> Pat) -> Generic Pat
forall x. Rep Pat x -> Pat
forall x. Pat -> Rep Pat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Pat -> Rep Pat x
from :: forall x. Pat -> Rep Pat x
$cto :: forall x. Rep Pat x -> Pat
to :: forall x. Rep Pat x -> Pat
Generic )

type FieldPat = (Name,Pat)

data Match = Match Pat Body [Dec] -- ^ @case e of { pat -> body where decs }@
    deriving( Int -> Match -> FilePath -> FilePath
[Match] -> FilePath -> FilePath
Match -> FilePath
(Int -> Match -> FilePath -> FilePath)
-> (Match -> FilePath)
-> ([Match] -> FilePath -> FilePath)
-> Show Match
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Match -> FilePath -> FilePath
showsPrec :: Int -> Match -> FilePath -> FilePath
$cshow :: Match -> FilePath
show :: Match -> FilePath
$cshowList :: [Match] -> FilePath -> FilePath
showList :: [Match] -> FilePath -> FilePath
Show, Match -> Match -> Bool
(Match -> Match -> Bool) -> (Match -> Match -> Bool) -> Eq Match
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Match -> Match -> Bool
== :: Match -> Match -> Bool
$c/= :: Match -> Match -> Bool
/= :: Match -> Match -> Bool
Eq, Eq Match
Eq Match =>
(Match -> Match -> Ordering)
-> (Match -> Match -> Bool)
-> (Match -> Match -> Bool)
-> (Match -> Match -> Bool)
-> (Match -> Match -> Bool)
-> (Match -> Match -> Match)
-> (Match -> Match -> Match)
-> Ord Match
Match -> Match -> Bool
Match -> Match -> Ordering
Match -> Match -> Match
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Match -> Match -> Ordering
compare :: Match -> Match -> Ordering
$c< :: Match -> Match -> Bool
< :: Match -> Match -> Bool
$c<= :: Match -> Match -> Bool
<= :: Match -> Match -> Bool
$c> :: Match -> Match -> Bool
> :: Match -> Match -> Bool
$c>= :: Match -> Match -> Bool
>= :: Match -> Match -> Bool
$cmax :: Match -> Match -> Match
max :: Match -> Match -> Match
$cmin :: Match -> Match -> Match
min :: Match -> Match -> Match
Ord, Typeable Match
Typeable Match =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Match -> c Match)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Match)
-> (Match -> Constr)
-> (Match -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Match))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Match))
-> ((forall b. Data b => b -> b) -> Match -> Match)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r)
-> (forall u. (forall d. Data d => d -> u) -> Match -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Match -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Match -> m Match)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Match -> m Match)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Match -> m Match)
-> Data Match
Match -> Constr
Match -> DataType
(forall b. Data b => b -> b) -> Match -> Match
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Match -> u
forall u. (forall d. Data d => d -> u) -> Match -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Match -> m Match
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Match -> m Match
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Match
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Match -> c Match
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Match)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Match)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Match -> c Match
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Match -> c Match
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Match
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Match
$ctoConstr :: Match -> Constr
toConstr :: Match -> Constr
$cdataTypeOf :: Match -> DataType
dataTypeOf :: Match -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Match)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Match)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Match)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Match)
$cgmapT :: (forall b. Data b => b -> b) -> Match -> Match
gmapT :: (forall b. Data b => b -> b) -> Match -> Match
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Match -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Match -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Match -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Match -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Match -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Match -> m Match
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Match -> m Match
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Match -> m Match
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Match -> m Match
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Match -> m Match
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Match -> m Match
Data, (forall x. Match -> Rep Match x)
-> (forall x. Rep Match x -> Match) -> Generic Match
forall x. Rep Match x -> Match
forall x. Match -> Rep Match x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Match -> Rep Match x
from :: forall x. Match -> Rep Match x
$cto :: forall x. Rep Match x -> Match
to :: forall x. Rep Match x -> Match
Generic )

data Clause = Clause [Pat] Body [Dec]
                                  -- ^ @f { p1 p2 = body where decs }@
    deriving( Int -> Clause -> FilePath -> FilePath
[Clause] -> FilePath -> FilePath
Clause -> FilePath
(Int -> Clause -> FilePath -> FilePath)
-> (Clause -> FilePath)
-> ([Clause] -> FilePath -> FilePath)
-> Show Clause
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Clause -> FilePath -> FilePath
showsPrec :: Int -> Clause -> FilePath -> FilePath
$cshow :: Clause -> FilePath
show :: Clause -> FilePath
$cshowList :: [Clause] -> FilePath -> FilePath
showList :: [Clause] -> FilePath -> FilePath
Show, Clause -> Clause -> Bool
(Clause -> Clause -> Bool)
-> (Clause -> Clause -> Bool) -> Eq Clause
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Clause -> Clause -> Bool
== :: Clause -> Clause -> Bool
$c/= :: Clause -> Clause -> Bool
/= :: Clause -> Clause -> Bool
Eq, Eq Clause
Eq Clause =>
(Clause -> Clause -> Ordering)
-> (Clause -> Clause -> Bool)
-> (Clause -> Clause -> Bool)
-> (Clause -> Clause -> Bool)
-> (Clause -> Clause -> Bool)
-> (Clause -> Clause -> Clause)
-> (Clause -> Clause -> Clause)
-> Ord Clause
Clause -> Clause -> Bool
Clause -> Clause -> Ordering
Clause -> Clause -> Clause
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Clause -> Clause -> Ordering
compare :: Clause -> Clause -> Ordering
$c< :: Clause -> Clause -> Bool
< :: Clause -> Clause -> Bool
$c<= :: Clause -> Clause -> Bool
<= :: Clause -> Clause -> Bool
$c> :: Clause -> Clause -> Bool
> :: Clause -> Clause -> Bool
$c>= :: Clause -> Clause -> Bool
>= :: Clause -> Clause -> Bool
$cmax :: Clause -> Clause -> Clause
max :: Clause -> Clause -> Clause
$cmin :: Clause -> Clause -> Clause
min :: Clause -> Clause -> Clause
Ord, Typeable Clause
Typeable Clause =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Clause -> c Clause)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Clause)
-> (Clause -> Constr)
-> (Clause -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Clause))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause))
-> ((forall b. Data b => b -> b) -> Clause -> Clause)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Clause -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Clause -> r)
-> (forall u. (forall d. Data d => d -> u) -> Clause -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Clause -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Clause -> m Clause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Clause -> m Clause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Clause -> m Clause)
-> Data Clause
Clause -> Constr
Clause -> DataType
(forall b. Data b => b -> b) -> Clause -> Clause
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Clause -> u
forall u. (forall d. Data d => d -> u) -> Clause -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Clause
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Clause -> c Clause
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Clause)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Clause -> c Clause
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Clause -> c Clause
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Clause
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Clause
$ctoConstr :: Clause -> Constr
toConstr :: Clause -> Constr
$cdataTypeOf :: Clause -> DataType
dataTypeOf :: Clause -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Clause)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Clause)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Clause)
$cgmapT :: (forall b. Data b => b -> b) -> Clause -> Clause
gmapT :: (forall b. Data b => b -> b) -> Clause -> Clause
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Clause -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Clause -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Clause -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Clause -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Clause -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Clause -> m Clause
Data, (forall x. Clause -> Rep Clause x)
-> (forall x. Rep Clause x -> Clause) -> Generic Clause
forall x. Rep Clause x -> Clause
forall x. Clause -> Rep Clause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Clause -> Rep Clause x
from :: forall x. Clause -> Rep Clause x
$cto :: forall x. Rep Clause x -> Clause
to :: forall x. Rep Clause x -> Clause
Generic )

data Exp
  = VarE Name                          -- ^ @{ x }@
  | ConE Name                          -- ^ @data T1 = C1 t1 t2; p = {C1} e1 e2  @
  | LitE Lit                           -- ^ @{ 5 or \'c\'}@
  | AppE Exp Exp                       -- ^ @{ f x }@
  | AppTypeE Exp Type                  -- ^ @{ f \@Int }@

  | InfixE (Maybe Exp) Exp (Maybe Exp) -- ^ @{x + y} or {(x+)} or {(+ x)} or {(+)}@

    -- It's a bit gruesome to use an Exp as the operator when a Name
    -- would suffice. Historically, Exp was used to make it easier to
    -- distinguish between infix constructors and non-constructors.
    -- This is a bit overkill, since one could just as well call
    -- `startsConId` or `startsConSym` (from `GHC.Lexeme`) on a Name.
    -- Unfortunately, changing this design now would involve lots of
    -- code churn for consumers of the TH API, so we continue to use
    -- an Exp as the operator and perform an extra check during conversion
    -- to ensure that the Exp is a constructor or a variable (#16895).

  | UInfixE Exp Exp Exp                -- ^ @{x + y}@
                                       --
                                       -- See "Language.Haskell.TH.Syntax#infix"
  | ParensE Exp                        -- ^ @{ (e) }@
                                       --
                                       -- See "Language.Haskell.TH.Syntax#infix"
  | LamE [Pat] Exp                     -- ^ @{ \\ p1 p2 -> e }@
  | LamCaseE [Match]                   -- ^ @{ \\case m1; m2 }@
  | LamCasesE [Clause]                 -- ^ @{ \\cases m1; m2 }@
  | TupE [Maybe Exp]                   -- ^ @{ (e1,e2) }  @
                                       --
                                       -- The 'Maybe' is necessary for handling
                                       -- tuple sections.
                                       --
                                       -- > (1,)
                                       --
                                       -- translates to
                                       --
                                       -- > TupE [Just (LitE (IntegerL 1)),Nothing]

  | UnboxedTupE [Maybe Exp]            -- ^ @{ (\# e1,e2 \#) }  @
                                       --
                                       -- The 'Maybe' is necessary for handling
                                       -- tuple sections.
                                       --
                                       -- > (# 'c', #)
                                       --
                                       -- translates to
                                       --
                                       -- > UnboxedTupE [Just (LitE (CharL 'c')),Nothing]

  | UnboxedSumE Exp SumAlt SumArity    -- ^ @{ (\#|e|\#) }@
  | CondE Exp Exp Exp                  -- ^ @{ if e1 then e2 else e3 }@
  | MultiIfE [(Guard, Exp)]            -- ^ @{ if | g1 -> e1 | g2 -> e2 }@
  | LetE [Dec] Exp                     -- ^ @{ let { x=e1; y=e2 } in e3 }@
  | CaseE Exp [Match]                  -- ^ @{ case e of m1; m2 }@
  | DoE (Maybe ModName) [Stmt]         -- ^ @{ do { p <- e1; e2 }  }@ or a qualified do if
                                       -- the module name is present
  | MDoE (Maybe ModName) [Stmt]        -- ^ @{ mdo { x <- e1 y; y <- e2 x; } }@ or a qualified
                                       -- mdo if the module name is present
  | CompE [Stmt]                       -- ^ @{ [ (x,y) | x <- xs, y <- ys ] }@
      --
      -- The result expression of the comprehension is
      -- the /last/ of the @'Stmt'@s, and should be a 'NoBindS'.
      --
      -- E.g. translation:
      --
      -- > [ f x | x <- xs ]
      --
      -- > CompE [BindS (VarP x) (VarE xs), NoBindS (AppE (VarE f) (VarE x))]

  | ArithSeqE Range                    -- ^ @{ [ 1 ,2 .. 10 ] }@
  | ListE [ Exp ]                      -- ^ @{ [1,2,3] }@
  | SigE Exp Type                      -- ^ @{ e :: t }@
  | RecConE Name [FieldExp]            -- ^ @{ T { x = y, z = w } }@
  | RecUpdE Exp [FieldExp]             -- ^ @{ (f x) { z = w } }@
  | StaticE Exp                        -- ^ @{ static e }@
  | UnboundVarE Name                   -- ^ @{ _x }@
                                       --
                                       -- This is used for holes or unresolved
                                       -- identifiers in AST quotes. Note that
                                       -- it could either have a variable name
                                       -- or constructor name.
  | LabelE String                      -- ^ @{ #x }@ ( Overloaded label )
  | ImplicitParamVarE String           -- ^ @{ ?x }@ ( Implicit parameter )
  | GetFieldE Exp String               -- ^ @{ exp.field }@ ( Overloaded Record Dot )
  | ProjectionE (NonEmpty String)      -- ^ @(.x)@ or @(.x.y)@ (Record projections)
  | TypedBracketE Exp                  -- ^ @[|| e ||]@
  | TypedSpliceE Exp                   -- ^ @$$e@
  deriving( Int -> Exp -> FilePath -> FilePath
[Exp] -> FilePath -> FilePath
Exp -> FilePath
(Int -> Exp -> FilePath -> FilePath)
-> (Exp -> FilePath) -> ([Exp] -> FilePath -> FilePath) -> Show Exp
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Exp -> FilePath -> FilePath
showsPrec :: Int -> Exp -> FilePath -> FilePath
$cshow :: Exp -> FilePath
show :: Exp -> FilePath
$cshowList :: [Exp] -> FilePath -> FilePath
showList :: [Exp] -> FilePath -> FilePath
Show, Exp -> Exp -> Bool
(Exp -> Exp -> Bool) -> (Exp -> Exp -> Bool) -> Eq Exp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Exp -> Exp -> Bool
== :: Exp -> Exp -> Bool
$c/= :: Exp -> Exp -> Bool
/= :: Exp -> Exp -> Bool
Eq, Eq Exp
Eq Exp =>
(Exp -> Exp -> Ordering)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Bool)
-> (Exp -> Exp -> Exp)
-> (Exp -> Exp -> Exp)
-> Ord Exp
Exp -> Exp -> Bool
Exp -> Exp -> Ordering
Exp -> Exp -> Exp
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Exp -> Exp -> Ordering
compare :: Exp -> Exp -> Ordering
$c< :: Exp -> Exp -> Bool
< :: Exp -> Exp -> Bool
$c<= :: Exp -> Exp -> Bool
<= :: Exp -> Exp -> Bool
$c> :: Exp -> Exp -> Bool
> :: Exp -> Exp -> Bool
$c>= :: Exp -> Exp -> Bool
>= :: Exp -> Exp -> Bool
$cmax :: Exp -> Exp -> Exp
max :: Exp -> Exp -> Exp
$cmin :: Exp -> Exp -> Exp
min :: Exp -> Exp -> Exp
Ord, Typeable Exp
Typeable Exp =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Exp -> c Exp)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Exp)
-> (Exp -> Constr)
-> (Exp -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Exp))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Exp))
-> ((forall b. Data b => b -> b) -> Exp -> Exp)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r)
-> (forall u. (forall d. Data d => d -> u) -> Exp -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Exp -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Exp -> m Exp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Exp -> m Exp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Exp -> m Exp)
-> Data Exp
Exp -> Constr
Exp -> DataType
(forall b. Data b => b -> b) -> Exp -> Exp
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Exp -> u
forall u. (forall d. Data d => d -> u) -> Exp -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Exp
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Exp -> c Exp
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Exp)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Exp)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Exp -> c Exp
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Exp -> c Exp
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Exp
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Exp
$ctoConstr :: Exp -> Constr
toConstr :: Exp -> Constr
$cdataTypeOf :: Exp -> DataType
dataTypeOf :: Exp -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Exp)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Exp)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Exp)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Exp)
$cgmapT :: (forall b. Data b => b -> b) -> Exp -> Exp
gmapT :: (forall b. Data b => b -> b) -> Exp -> Exp
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Exp -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Exp -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Exp -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Exp -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Exp -> m Exp
Data, (forall x. Exp -> Rep Exp x)
-> (forall x. Rep Exp x -> Exp) -> Generic Exp
forall x. Rep Exp x -> Exp
forall x. Exp -> Rep Exp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Exp -> Rep Exp x
from :: forall x. Exp -> Rep Exp x
$cto :: forall x. Rep Exp x -> Exp
to :: forall x. Rep Exp x -> Exp
Generic )

type FieldExp = (Name,Exp)

-- Omitted: implicit parameters

data Body
  = GuardedB [(Guard,Exp)]   -- ^ @f p { | e1 = e2
                                 --      | e3 = e4 }
                                 -- where ds@
  | NormalB Exp              -- ^ @f p { = e } where ds@
  deriving( Int -> Body -> FilePath -> FilePath
[Body] -> FilePath -> FilePath
Body -> FilePath
(Int -> Body -> FilePath -> FilePath)
-> (Body -> FilePath)
-> ([Body] -> FilePath -> FilePath)
-> Show Body
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Body -> FilePath -> FilePath
showsPrec :: Int -> Body -> FilePath -> FilePath
$cshow :: Body -> FilePath
show :: Body -> FilePath
$cshowList :: [Body] -> FilePath -> FilePath
showList :: [Body] -> FilePath -> FilePath
Show, Body -> Body -> Bool
(Body -> Body -> Bool) -> (Body -> Body -> Bool) -> Eq Body
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Body -> Body -> Bool
== :: Body -> Body -> Bool
$c/= :: Body -> Body -> Bool
/= :: Body -> Body -> Bool
Eq, Eq Body
Eq Body =>
(Body -> Body -> Ordering)
-> (Body -> Body -> Bool)
-> (Body -> Body -> Bool)
-> (Body -> Body -> Bool)
-> (Body -> Body -> Bool)
-> (Body -> Body -> Body)
-> (Body -> Body -> Body)
-> Ord Body
Body -> Body -> Bool
Body -> Body -> Ordering
Body -> Body -> Body
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Body -> Body -> Ordering
compare :: Body -> Body -> Ordering
$c< :: Body -> Body -> Bool
< :: Body -> Body -> Bool
$c<= :: Body -> Body -> Bool
<= :: Body -> Body -> Bool
$c> :: Body -> Body -> Bool
> :: Body -> Body -> Bool
$c>= :: Body -> Body -> Bool
>= :: Body -> Body -> Bool
$cmax :: Body -> Body -> Body
max :: Body -> Body -> Body
$cmin :: Body -> Body -> Body
min :: Body -> Body -> Body
Ord, Typeable Body
Typeable Body =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Body -> c Body)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Body)
-> (Body -> Constr)
-> (Body -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Body))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Body))
-> ((forall b. Data b => b -> b) -> Body -> Body)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r)
-> (forall u. (forall d. Data d => d -> u) -> Body -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Body -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Body -> m Body)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Body -> m Body)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Body -> m Body)
-> Data Body
Body -> Constr
Body -> DataType
(forall b. Data b => b -> b) -> Body -> Body
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Body -> u
forall u. (forall d. Data d => d -> u) -> Body -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Body -> m Body
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Body -> m Body
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Body
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Body -> c Body
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Body)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Body)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Body -> c Body
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Body -> c Body
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Body
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Body
$ctoConstr :: Body -> Constr
toConstr :: Body -> Constr
$cdataTypeOf :: Body -> DataType
dataTypeOf :: Body -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Body)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Body)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Body)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Body)
$cgmapT :: (forall b. Data b => b -> b) -> Body -> Body
gmapT :: (forall b. Data b => b -> b) -> Body -> Body
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Body -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Body -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Body -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Body -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Body -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Body -> m Body
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Body -> m Body
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Body -> m Body
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Body -> m Body
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Body -> m Body
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Body -> m Body
Data, (forall x. Body -> Rep Body x)
-> (forall x. Rep Body x -> Body) -> Generic Body
forall x. Rep Body x -> Body
forall x. Body -> Rep Body x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Body -> Rep Body x
from :: forall x. Body -> Rep Body x
$cto :: forall x. Rep Body x -> Body
to :: forall x. Rep Body x -> Body
Generic )

data Guard
  = NormalG Exp -- ^ @f x { | odd x } = x@
  | PatG [Stmt] -- ^ @f x { | Just y <- x, Just z <- y } = z@
  deriving( Int -> Guard -> FilePath -> FilePath
[Guard] -> FilePath -> FilePath
Guard -> FilePath
(Int -> Guard -> FilePath -> FilePath)
-> (Guard -> FilePath)
-> ([Guard] -> FilePath -> FilePath)
-> Show Guard
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Guard -> FilePath -> FilePath
showsPrec :: Int -> Guard -> FilePath -> FilePath
$cshow :: Guard -> FilePath
show :: Guard -> FilePath
$cshowList :: [Guard] -> FilePath -> FilePath
showList :: [Guard] -> FilePath -> FilePath
Show, Guard -> Guard -> Bool
(Guard -> Guard -> Bool) -> (Guard -> Guard -> Bool) -> Eq Guard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Guard -> Guard -> Bool
== :: Guard -> Guard -> Bool
$c/= :: Guard -> Guard -> Bool
/= :: Guard -> Guard -> Bool
Eq, Eq Guard
Eq Guard =>
(Guard -> Guard -> Ordering)
-> (Guard -> Guard -> Bool)
-> (Guard -> Guard -> Bool)
-> (Guard -> Guard -> Bool)
-> (Guard -> Guard -> Bool)
-> (Guard -> Guard -> Guard)
-> (Guard -> Guard -> Guard)
-> Ord Guard
Guard -> Guard -> Bool
Guard -> Guard -> Ordering
Guard -> Guard -> Guard
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Guard -> Guard -> Ordering
compare :: Guard -> Guard -> Ordering
$c< :: Guard -> Guard -> Bool
< :: Guard -> Guard -> Bool
$c<= :: Guard -> Guard -> Bool
<= :: Guard -> Guard -> Bool
$c> :: Guard -> Guard -> Bool
> :: Guard -> Guard -> Bool
$c>= :: Guard -> Guard -> Bool
>= :: Guard -> Guard -> Bool
$cmax :: Guard -> Guard -> Guard
max :: Guard -> Guard -> Guard
$cmin :: Guard -> Guard -> Guard
min :: Guard -> Guard -> Guard
Ord, Typeable Guard
Typeable Guard =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Guard -> c Guard)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Guard)
-> (Guard -> Constr)
-> (Guard -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Guard))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Guard))
-> ((forall b. Data b => b -> b) -> Guard -> Guard)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r)
-> (forall u. (forall d. Data d => d -> u) -> Guard -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Guard -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Guard -> m Guard)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Guard -> m Guard)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Guard -> m Guard)
-> Data Guard
Guard -> Constr
Guard -> DataType
(forall b. Data b => b -> b) -> Guard -> Guard
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Guard -> u
forall u. (forall d. Data d => d -> u) -> Guard -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Guard
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Guard -> c Guard
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Guard)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Guard)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Guard -> c Guard
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Guard -> c Guard
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Guard
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Guard
$ctoConstr :: Guard -> Constr
toConstr :: Guard -> Constr
$cdataTypeOf :: Guard -> DataType
dataTypeOf :: Guard -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Guard)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Guard)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Guard)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Guard)
$cgmapT :: (forall b. Data b => b -> b) -> Guard -> Guard
gmapT :: (forall b. Data b => b -> b) -> Guard -> Guard
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Guard -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Guard -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Guard -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Guard -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Guard -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Guard -> m Guard
Data, (forall x. Guard -> Rep Guard x)
-> (forall x. Rep Guard x -> Guard) -> Generic Guard
forall x. Rep Guard x -> Guard
forall x. Guard -> Rep Guard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Guard -> Rep Guard x
from :: forall x. Guard -> Rep Guard x
$cto :: forall x. Rep Guard x -> Guard
to :: forall x. Rep Guard x -> Guard
Generic )

data Stmt
  = BindS Pat Exp -- ^ @p <- e@
  | LetS [ Dec ]  -- ^ @{ let { x=e1; y=e2 } }@
  | NoBindS Exp   -- ^ @e@
  | ParS [[Stmt]] -- ^ @x <- e1 | s2, s3 | s4@ (in 'CompE')
  | RecS [Stmt]   -- ^ @rec { s1; s2 }@
  deriving( Int -> Stmt -> FilePath -> FilePath
[Stmt] -> FilePath -> FilePath
Stmt -> FilePath
(Int -> Stmt -> FilePath -> FilePath)
-> (Stmt -> FilePath)
-> ([Stmt] -> FilePath -> FilePath)
-> Show Stmt
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Stmt -> FilePath -> FilePath
showsPrec :: Int -> Stmt -> FilePath -> FilePath
$cshow :: Stmt -> FilePath
show :: Stmt -> FilePath
$cshowList :: [Stmt] -> FilePath -> FilePath
showList :: [Stmt] -> FilePath -> FilePath
Show, Stmt -> Stmt -> Bool
(Stmt -> Stmt -> Bool) -> (Stmt -> Stmt -> Bool) -> Eq Stmt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Stmt -> Stmt -> Bool
== :: Stmt -> Stmt -> Bool
$c/= :: Stmt -> Stmt -> Bool
/= :: Stmt -> Stmt -> Bool
Eq, Eq Stmt
Eq Stmt =>
(Stmt -> Stmt -> Ordering)
-> (Stmt -> Stmt -> Bool)
-> (Stmt -> Stmt -> Bool)
-> (Stmt -> Stmt -> Bool)
-> (Stmt -> Stmt -> Bool)
-> (Stmt -> Stmt -> Stmt)
-> (Stmt -> Stmt -> Stmt)
-> Ord Stmt
Stmt -> Stmt -> Bool
Stmt -> Stmt -> Ordering
Stmt -> Stmt -> Stmt
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Stmt -> Stmt -> Ordering
compare :: Stmt -> Stmt -> Ordering
$c< :: Stmt -> Stmt -> Bool
< :: Stmt -> Stmt -> Bool
$c<= :: Stmt -> Stmt -> Bool
<= :: Stmt -> Stmt -> Bool
$c> :: Stmt -> Stmt -> Bool
> :: Stmt -> Stmt -> Bool
$c>= :: Stmt -> Stmt -> Bool
>= :: Stmt -> Stmt -> Bool
$cmax :: Stmt -> Stmt -> Stmt
max :: Stmt -> Stmt -> Stmt
$cmin :: Stmt -> Stmt -> Stmt
min :: Stmt -> Stmt -> Stmt
Ord, Typeable Stmt
Typeable Stmt =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Stmt -> c Stmt)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Stmt)
-> (Stmt -> Constr)
-> (Stmt -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Stmt))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Stmt))
-> ((forall b. Data b => b -> b) -> Stmt -> Stmt)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r)
-> (forall u. (forall d. Data d => d -> u) -> Stmt -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Stmt -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Stmt -> m Stmt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Stmt -> m Stmt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Stmt -> m Stmt)
-> Data Stmt
Stmt -> Constr
Stmt -> DataType
(forall b. Data b => b -> b) -> Stmt -> Stmt
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Stmt -> u
forall u. (forall d. Data d => d -> u) -> Stmt -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Stmt
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Stmt -> c Stmt
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Stmt)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Stmt)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Stmt -> c Stmt
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Stmt -> c Stmt
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Stmt
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Stmt
$ctoConstr :: Stmt -> Constr
toConstr :: Stmt -> Constr
$cdataTypeOf :: Stmt -> DataType
dataTypeOf :: Stmt -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Stmt)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Stmt)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Stmt)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Stmt)
$cgmapT :: (forall b. Data b => b -> b) -> Stmt -> Stmt
gmapT :: (forall b. Data b => b -> b) -> Stmt -> Stmt
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Stmt -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Stmt -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Stmt -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Stmt -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Stmt -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Stmt -> m Stmt
Data, (forall x. Stmt -> Rep Stmt x)
-> (forall x. Rep Stmt x -> Stmt) -> Generic Stmt
forall x. Rep Stmt x -> Stmt
forall x. Stmt -> Rep Stmt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Stmt -> Rep Stmt x
from :: forall x. Stmt -> Rep Stmt x
$cto :: forall x. Rep Stmt x -> Stmt
to :: forall x. Rep Stmt x -> Stmt
Generic )

data Range = FromR Exp | FromThenR Exp Exp
           | FromToR Exp Exp | FromThenToR Exp Exp Exp
          deriving( Int -> Range -> FilePath -> FilePath
[Range] -> FilePath -> FilePath
Range -> FilePath
(Int -> Range -> FilePath -> FilePath)
-> (Range -> FilePath)
-> ([Range] -> FilePath -> FilePath)
-> Show Range
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Range -> FilePath -> FilePath
showsPrec :: Int -> Range -> FilePath -> FilePath
$cshow :: Range -> FilePath
show :: Range -> FilePath
$cshowList :: [Range] -> FilePath -> FilePath
showList :: [Range] -> FilePath -> FilePath
Show, Range -> Range -> Bool
(Range -> Range -> Bool) -> (Range -> Range -> Bool) -> Eq Range
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Range -> Range -> Bool
== :: Range -> Range -> Bool
$c/= :: Range -> Range -> Bool
/= :: Range -> Range -> Bool
Eq, Eq Range
Eq Range =>
(Range -> Range -> Ordering)
-> (Range -> Range -> Bool)
-> (Range -> Range -> Bool)
-> (Range -> Range -> Bool)
-> (Range -> Range -> Bool)
-> (Range -> Range -> Range)
-> (Range -> Range -> Range)
-> Ord Range
Range -> Range -> Bool
Range -> Range -> Ordering
Range -> Range -> Range
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Range -> Range -> Ordering
compare :: Range -> Range -> Ordering
$c< :: Range -> Range -> Bool
< :: Range -> Range -> Bool
$c<= :: Range -> Range -> Bool
<= :: Range -> Range -> Bool
$c> :: Range -> Range -> Bool
> :: Range -> Range -> Bool
$c>= :: Range -> Range -> Bool
>= :: Range -> Range -> Bool
$cmax :: Range -> Range -> Range
max :: Range -> Range -> Range
$cmin :: Range -> Range -> Range
min :: Range -> Range -> Range
Ord, Typeable Range
Typeable Range =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Range -> c Range)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Range)
-> (Range -> Constr)
-> (Range -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Range))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range))
-> ((forall b. Data b => b -> b) -> Range -> Range)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r)
-> (forall u. (forall d. Data d => d -> u) -> Range -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Range -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Range -> m Range)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Range -> m Range)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Range -> m Range)
-> Data Range
Range -> Constr
Range -> DataType
(forall b. Data b => b -> b) -> Range -> Range
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Range -> u
forall u. (forall d. Data d => d -> u) -> Range -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Range -> m Range
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Range -> m Range
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Range
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Range -> c Range
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Range)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Range -> c Range
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Range -> c Range
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Range
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Range
$ctoConstr :: Range -> Constr
toConstr :: Range -> Constr
$cdataTypeOf :: Range -> DataType
dataTypeOf :: Range -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Range)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Range)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Range)
$cgmapT :: (forall b. Data b => b -> b) -> Range -> Range
gmapT :: (forall b. Data b => b -> b) -> Range -> Range
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Range -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Range -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Range -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Range -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Range -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Range -> m Range
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Range -> m Range
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Range -> m Range
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Range -> m Range
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Range -> m Range
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Range -> m Range
Data, (forall x. Range -> Rep Range x)
-> (forall x. Rep Range x -> Range) -> Generic Range
forall x. Rep Range x -> Range
forall x. Range -> Rep Range x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Range -> Rep Range x
from :: forall x. Range -> Rep Range x
$cto :: forall x. Rep Range x -> Range
to :: forall x. Rep Range x -> Range
Generic )

data Dec
  = FunD Name [Clause]            -- ^ @{ f p1 p2 = b where decs }@
  | ValD Pat Body [Dec]           -- ^ @{ p = b where decs }@
  | DataD Cxt Name [TyVarBndr BndrVis]
          (Maybe Kind)            -- Kind signature (allowed only for GADTs)
          [Con] [DerivClause]
                                  -- ^ @{ data Cxt x => T x = A x | B (T x)
                                  --       deriving (Z,W)
                                  --       deriving stock Eq }@
  | NewtypeD Cxt Name [TyVarBndr BndrVis]
             (Maybe Kind)         -- Kind signature
             Con [DerivClause]    -- ^ @{ newtype Cxt x => T x = A (B x)
                                  --       deriving (Z,W Q)
                                  --       deriving stock Eq }@
  | TypeDataD Name [TyVarBndr BndrVis]
          (Maybe Kind)            -- Kind signature (allowed only for GADTs)
          [Con]                   -- ^ @{ type data T x = A x | B (T x) }@
  | TySynD Name [TyVarBndr BndrVis] Type -- ^ @{ type T x = (x,x) }@
  | ClassD Cxt Name [TyVarBndr BndrVis]
         [FunDep] [Dec]           -- ^ @{ class Eq a => Ord a where ds }@
  | InstanceD (Maybe Overlap) Cxt Type [Dec]
                                  -- ^ @{ instance {\-\# OVERLAPS \#-\}
                                  --        Show w => Show [w] where ds }@
  | SigD Name Type                -- ^ @{ length :: [a] -> Int }@
  | KiSigD Name Kind              -- ^ @{ type TypeRep :: k -> Type }@
  | ForeignD Foreign              -- ^ @{ foreign import ... }
                                  --{ foreign export ... }@

  | InfixD Fixity Name            -- ^ @{ infix 3 foo }@
  | DefaultD [Type]               -- ^ @{ default (Integer, Double) }@

  -- | pragmas
  | PragmaD Pragma                -- ^ @{ {\-\# INLINE [1] foo \#-\} }@

  -- | data families (may also appear in [Dec] of 'ClassD' and 'InstanceD')
  | DataFamilyD Name [TyVarBndr BndrVis]
               (Maybe Kind)
         -- ^ @{ data family T a b c :: * }@

  | DataInstD Cxt (Maybe [TyVarBndr ()]) Type
             (Maybe Kind)         -- Kind signature
             [Con] [DerivClause]  -- ^ @{ data instance Cxt x => T [x]
                                  --       = A x | B (T x)
                                  --       deriving (Z,W)
                                  --       deriving stock Eq }@

  | NewtypeInstD Cxt (Maybe [TyVarBndr ()]) Type -- Quantified type vars
                 (Maybe Kind)      -- Kind signature
                 Con [DerivClause] -- ^ @{ newtype instance Cxt x => T [x]
                                   --        = A (B x)
                                   --        deriving (Z,W)
                                   --        deriving stock Eq }@
  | TySynInstD TySynEqn            -- ^ @{ type instance ... }@

  -- | open type families (may also appear in [Dec] of 'ClassD' and 'InstanceD')
  | OpenTypeFamilyD TypeFamilyHead
         -- ^ @{ type family T a b c = (r :: *) | r -> a b }@

  | ClosedTypeFamilyD TypeFamilyHead [TySynEqn]
       -- ^ @{ type family F a b = (r :: *) | r -> a where ... }@

  | RoleAnnotD Name [Role]     -- ^ @{ type role T nominal representational }@
  | StandaloneDerivD (Maybe DerivStrategy) Cxt Type
       -- ^ @{ deriving stock instance Ord a => Ord (Foo a) }@
  | DefaultSigD Name Type      -- ^ @{ default size :: Data a => a -> Int }@

  -- | Pattern Synonyms
  | PatSynD Name PatSynArgs PatSynDir Pat
      -- ^ @{ pattern P v1 v2 .. vn <- p }@  unidirectional           or
      --   @{ pattern P v1 v2 .. vn = p  }@  implicit bidirectional   or
      --   @{ pattern P v1 v2 .. vn <- p
      --        where P v1 v2 .. vn = e  }@  explicit bidirectional
      --
      -- also, besides prefix pattern synonyms, both infix and record
      -- pattern synonyms are supported. See 'PatSynArgs' for details

  | PatSynSigD Name PatSynType  -- ^ A pattern synonym's type signature.

  | ImplicitParamBindD String Exp
      -- ^ @{ ?x = expr }@
      --
      -- Implicit parameter binding declaration. Can only be used in let
      -- and where clauses which consist entirely of implicit bindings.
  deriving( Int -> Dec -> FilePath -> FilePath
[Dec] -> FilePath -> FilePath
Dec -> FilePath
(Int -> Dec -> FilePath -> FilePath)
-> (Dec -> FilePath) -> ([Dec] -> FilePath -> FilePath) -> Show Dec
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Dec -> FilePath -> FilePath
showsPrec :: Int -> Dec -> FilePath -> FilePath
$cshow :: Dec -> FilePath
show :: Dec -> FilePath
$cshowList :: [Dec] -> FilePath -> FilePath
showList :: [Dec] -> FilePath -> FilePath
Show, Dec -> Dec -> Bool
(Dec -> Dec -> Bool) -> (Dec -> Dec -> Bool) -> Eq Dec
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Dec -> Dec -> Bool
== :: Dec -> Dec -> Bool
$c/= :: Dec -> Dec -> Bool
/= :: Dec -> Dec -> Bool
Eq, Eq Dec
Eq Dec =>
(Dec -> Dec -> Ordering)
-> (Dec -> Dec -> Bool)
-> (Dec -> Dec -> Bool)
-> (Dec -> Dec -> Bool)
-> (Dec -> Dec -> Bool)
-> (Dec -> Dec -> Dec)
-> (Dec -> Dec -> Dec)
-> Ord Dec
Dec -> Dec -> Bool
Dec -> Dec -> Ordering
Dec -> Dec -> Dec
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Dec -> Dec -> Ordering
compare :: Dec -> Dec -> Ordering
$c< :: Dec -> Dec -> Bool
< :: Dec -> Dec -> Bool
$c<= :: Dec -> Dec -> Bool
<= :: Dec -> Dec -> Bool
$c> :: Dec -> Dec -> Bool
> :: Dec -> Dec -> Bool
$c>= :: Dec -> Dec -> Bool
>= :: Dec -> Dec -> Bool
$cmax :: Dec -> Dec -> Dec
max :: Dec -> Dec -> Dec
$cmin :: Dec -> Dec -> Dec
min :: Dec -> Dec -> Dec
Ord, Typeable Dec
Typeable Dec =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Dec -> c Dec)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Dec)
-> (Dec -> Constr)
-> (Dec -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Dec))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dec))
-> ((forall b. Data b => b -> b) -> Dec -> Dec)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r)
-> (forall u. (forall d. Data d => d -> u) -> Dec -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Dec -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Dec -> m Dec)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Dec -> m Dec)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Dec -> m Dec)
-> Data Dec
Dec -> Constr
Dec -> DataType
(forall b. Data b => b -> b) -> Dec -> Dec
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Dec -> u
forall u. (forall d. Data d => d -> u) -> Dec -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Dec
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Dec -> c Dec
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Dec)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dec)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Dec -> c Dec
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Dec -> c Dec
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Dec
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Dec
$ctoConstr :: Dec -> Constr
toConstr :: Dec -> Constr
$cdataTypeOf :: Dec -> DataType
dataTypeOf :: Dec -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Dec)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Dec)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dec)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dec)
$cgmapT :: (forall b. Data b => b -> b) -> Dec -> Dec
gmapT :: (forall b. Data b => b -> b) -> Dec -> Dec
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dec -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Dec -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Dec -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Dec -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Dec -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Dec -> m Dec
Data, (forall x. Dec -> Rep Dec x)
-> (forall x. Rep Dec x -> Dec) -> Generic Dec
forall x. Rep Dec x -> Dec
forall x. Dec -> Rep Dec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Dec -> Rep Dec x
from :: forall x. Dec -> Rep Dec x
$cto :: forall x. Rep Dec x -> Dec
to :: forall x. Rep Dec x -> Dec
Generic )

-- | Varieties of allowed instance overlap.
data Overlap = Overlappable   -- ^ May be overlapped by more specific instances
             | Overlapping    -- ^ May overlap a more general instance
             | Overlaps       -- ^ Both 'Overlapping' and 'Overlappable'
             | Incoherent     -- ^ Both 'Overlapping' and 'Overlappable', and
                              -- pick an arbitrary one if multiple choices are
                              -- available.
  deriving( Int -> Overlap -> FilePath -> FilePath
[Overlap] -> FilePath -> FilePath
Overlap -> FilePath
(Int -> Overlap -> FilePath -> FilePath)
-> (Overlap -> FilePath)
-> ([Overlap] -> FilePath -> FilePath)
-> Show Overlap
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Overlap -> FilePath -> FilePath
showsPrec :: Int -> Overlap -> FilePath -> FilePath
$cshow :: Overlap -> FilePath
show :: Overlap -> FilePath
$cshowList :: [Overlap] -> FilePath -> FilePath
showList :: [Overlap] -> FilePath -> FilePath
Show, Overlap -> Overlap -> Bool
(Overlap -> Overlap -> Bool)
-> (Overlap -> Overlap -> Bool) -> Eq Overlap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Overlap -> Overlap -> Bool
== :: Overlap -> Overlap -> Bool
$c/= :: Overlap -> Overlap -> Bool
/= :: Overlap -> Overlap -> Bool
Eq, Eq Overlap
Eq Overlap =>
(Overlap -> Overlap -> Ordering)
-> (Overlap -> Overlap -> Bool)
-> (Overlap -> Overlap -> Bool)
-> (Overlap -> Overlap -> Bool)
-> (Overlap -> Overlap -> Bool)
-> (Overlap -> Overlap -> Overlap)
-> (Overlap -> Overlap -> Overlap)
-> Ord Overlap
Overlap -> Overlap -> Bool
Overlap -> Overlap -> Ordering
Overlap -> Overlap -> Overlap
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Overlap -> Overlap -> Ordering
compare :: Overlap -> Overlap -> Ordering
$c< :: Overlap -> Overlap -> Bool
< :: Overlap -> Overlap -> Bool
$c<= :: Overlap -> Overlap -> Bool
<= :: Overlap -> Overlap -> Bool
$c> :: Overlap -> Overlap -> Bool
> :: Overlap -> Overlap -> Bool
$c>= :: Overlap -> Overlap -> Bool
>= :: Overlap -> Overlap -> Bool
$cmax :: Overlap -> Overlap -> Overlap
max :: Overlap -> Overlap -> Overlap
$cmin :: Overlap -> Overlap -> Overlap
min :: Overlap -> Overlap -> Overlap
Ord, Typeable Overlap
Typeable Overlap =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Overlap -> c Overlap)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Overlap)
-> (Overlap -> Constr)
-> (Overlap -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Overlap))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap))
-> ((forall b. Data b => b -> b) -> Overlap -> Overlap)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Overlap -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Overlap -> r)
-> (forall u. (forall d. Data d => d -> u) -> Overlap -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Overlap -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Overlap -> m Overlap)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Overlap -> m Overlap)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Overlap -> m Overlap)
-> Data Overlap
Overlap -> Constr
Overlap -> DataType
(forall b. Data b => b -> b) -> Overlap -> Overlap
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Overlap -> u
forall u. (forall d. Data d => d -> u) -> Overlap -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Overlap
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Overlap -> c Overlap
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Overlap)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Overlap -> c Overlap
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Overlap -> c Overlap
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Overlap
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Overlap
$ctoConstr :: Overlap -> Constr
toConstr :: Overlap -> Constr
$cdataTypeOf :: Overlap -> DataType
dataTypeOf :: Overlap -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Overlap)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Overlap)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Overlap)
$cgmapT :: (forall b. Data b => b -> b) -> Overlap -> Overlap
gmapT :: (forall b. Data b => b -> b) -> Overlap -> Overlap
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Overlap -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Overlap -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Overlap -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Overlap -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Overlap -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Overlap -> m Overlap
Data, (forall x. Overlap -> Rep Overlap x)
-> (forall x. Rep Overlap x -> Overlap) -> Generic Overlap
forall x. Rep Overlap x -> Overlap
forall x. Overlap -> Rep Overlap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Overlap -> Rep Overlap x
from :: forall x. Overlap -> Rep Overlap x
$cto :: forall x. Rep Overlap x -> Overlap
to :: forall x. Rep Overlap x -> Overlap
Generic )

-- | A single @deriving@ clause at the end of a datatype.
data DerivClause = DerivClause (Maybe DerivStrategy) Cxt
    -- ^ @{ deriving stock (Eq, Ord) }@
  deriving( Int -> DerivClause -> FilePath -> FilePath
[DerivClause] -> FilePath -> FilePath
DerivClause -> FilePath
(Int -> DerivClause -> FilePath -> FilePath)
-> (DerivClause -> FilePath)
-> ([DerivClause] -> FilePath -> FilePath)
-> Show DerivClause
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> DerivClause -> FilePath -> FilePath
showsPrec :: Int -> DerivClause -> FilePath -> FilePath
$cshow :: DerivClause -> FilePath
show :: DerivClause -> FilePath
$cshowList :: [DerivClause] -> FilePath -> FilePath
showList :: [DerivClause] -> FilePath -> FilePath
Show, DerivClause -> DerivClause -> Bool
(DerivClause -> DerivClause -> Bool)
-> (DerivClause -> DerivClause -> Bool) -> Eq DerivClause
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DerivClause -> DerivClause -> Bool
== :: DerivClause -> DerivClause -> Bool
$c/= :: DerivClause -> DerivClause -> Bool
/= :: DerivClause -> DerivClause -> Bool
Eq, Eq DerivClause
Eq DerivClause =>
(DerivClause -> DerivClause -> Ordering)
-> (DerivClause -> DerivClause -> Bool)
-> (DerivClause -> DerivClause -> Bool)
-> (DerivClause -> DerivClause -> Bool)
-> (DerivClause -> DerivClause -> Bool)
-> (DerivClause -> DerivClause -> DerivClause)
-> (DerivClause -> DerivClause -> DerivClause)
-> Ord DerivClause
DerivClause -> DerivClause -> Bool
DerivClause -> DerivClause -> Ordering
DerivClause -> DerivClause -> DerivClause
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DerivClause -> DerivClause -> Ordering
compare :: DerivClause -> DerivClause -> Ordering
$c< :: DerivClause -> DerivClause -> Bool
< :: DerivClause -> DerivClause -> Bool
$c<= :: DerivClause -> DerivClause -> Bool
<= :: DerivClause -> DerivClause -> Bool
$c> :: DerivClause -> DerivClause -> Bool
> :: DerivClause -> DerivClause -> Bool
$c>= :: DerivClause -> DerivClause -> Bool
>= :: DerivClause -> DerivClause -> Bool
$cmax :: DerivClause -> DerivClause -> DerivClause
max :: DerivClause -> DerivClause -> DerivClause
$cmin :: DerivClause -> DerivClause -> DerivClause
min :: DerivClause -> DerivClause -> DerivClause
Ord, Typeable DerivClause
Typeable DerivClause =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> DerivClause -> c DerivClause)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DerivClause)
-> (DerivClause -> Constr)
-> (DerivClause -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DerivClause))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c DerivClause))
-> ((forall b. Data b => b -> b) -> DerivClause -> DerivClause)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DerivClause -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DerivClause -> r)
-> (forall u. (forall d. Data d => d -> u) -> DerivClause -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DerivClause -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DerivClause -> m DerivClause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DerivClause -> m DerivClause)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DerivClause -> m DerivClause)
-> Data DerivClause
DerivClause -> Constr
DerivClause -> DataType
(forall b. Data b => b -> b) -> DerivClause -> DerivClause
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DerivClause -> u
forall u. (forall d. Data d => d -> u) -> DerivClause -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivClause
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivClause -> c DerivClause
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivClause)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivClause)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivClause -> c DerivClause
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivClause -> c DerivClause
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivClause
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivClause
$ctoConstr :: DerivClause -> Constr
toConstr :: DerivClause -> Constr
$cdataTypeOf :: DerivClause -> DataType
dataTypeOf :: DerivClause -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivClause)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivClause)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivClause)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivClause)
$cgmapT :: (forall b. Data b => b -> b) -> DerivClause -> DerivClause
gmapT :: (forall b. Data b => b -> b) -> DerivClause -> DerivClause
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivClause -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DerivClause -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DerivClause -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DerivClause -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DerivClause -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivClause -> m DerivClause
Data, (forall x. DerivClause -> Rep DerivClause x)
-> (forall x. Rep DerivClause x -> DerivClause)
-> Generic DerivClause
forall x. Rep DerivClause x -> DerivClause
forall x. DerivClause -> Rep DerivClause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DerivClause -> Rep DerivClause x
from :: forall x. DerivClause -> Rep DerivClause x
$cto :: forall x. Rep DerivClause x -> DerivClause
to :: forall x. Rep DerivClause x -> DerivClause
Generic )

-- | What the user explicitly requests when deriving an instance.
data DerivStrategy = StockStrategy    -- ^ A \"standard\" derived instance
                   | AnyclassStrategy -- ^ @-XDeriveAnyClass@
                   | NewtypeStrategy  -- ^ @-XGeneralizedNewtypeDeriving@
                   | ViaStrategy Type -- ^ @-XDerivingVia@
  deriving( Int -> DerivStrategy -> FilePath -> FilePath
[DerivStrategy] -> FilePath -> FilePath
DerivStrategy -> FilePath
(Int -> DerivStrategy -> FilePath -> FilePath)
-> (DerivStrategy -> FilePath)
-> ([DerivStrategy] -> FilePath -> FilePath)
-> Show DerivStrategy
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> DerivStrategy -> FilePath -> FilePath
showsPrec :: Int -> DerivStrategy -> FilePath -> FilePath
$cshow :: DerivStrategy -> FilePath
show :: DerivStrategy -> FilePath
$cshowList :: [DerivStrategy] -> FilePath -> FilePath
showList :: [DerivStrategy] -> FilePath -> FilePath
Show, DerivStrategy -> DerivStrategy -> Bool
(DerivStrategy -> DerivStrategy -> Bool)
-> (DerivStrategy -> DerivStrategy -> Bool) -> Eq DerivStrategy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DerivStrategy -> DerivStrategy -> Bool
== :: DerivStrategy -> DerivStrategy -> Bool
$c/= :: DerivStrategy -> DerivStrategy -> Bool
/= :: DerivStrategy -> DerivStrategy -> Bool
Eq, Eq DerivStrategy
Eq DerivStrategy =>
(DerivStrategy -> DerivStrategy -> Ordering)
-> (DerivStrategy -> DerivStrategy -> Bool)
-> (DerivStrategy -> DerivStrategy -> Bool)
-> (DerivStrategy -> DerivStrategy -> Bool)
-> (DerivStrategy -> DerivStrategy -> Bool)
-> (DerivStrategy -> DerivStrategy -> DerivStrategy)
-> (DerivStrategy -> DerivStrategy -> DerivStrategy)
-> Ord DerivStrategy
DerivStrategy -> DerivStrategy -> Bool
DerivStrategy -> DerivStrategy -> Ordering
DerivStrategy -> DerivStrategy -> DerivStrategy
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DerivStrategy -> DerivStrategy -> Ordering
compare :: DerivStrategy -> DerivStrategy -> Ordering
$c< :: DerivStrategy -> DerivStrategy -> Bool
< :: DerivStrategy -> DerivStrategy -> Bool
$c<= :: DerivStrategy -> DerivStrategy -> Bool
<= :: DerivStrategy -> DerivStrategy -> Bool
$c> :: DerivStrategy -> DerivStrategy -> Bool
> :: DerivStrategy -> DerivStrategy -> Bool
$c>= :: DerivStrategy -> DerivStrategy -> Bool
>= :: DerivStrategy -> DerivStrategy -> Bool
$cmax :: DerivStrategy -> DerivStrategy -> DerivStrategy
max :: DerivStrategy -> DerivStrategy -> DerivStrategy
$cmin :: DerivStrategy -> DerivStrategy -> DerivStrategy
min :: DerivStrategy -> DerivStrategy -> DerivStrategy
Ord, Typeable DerivStrategy
Typeable DerivStrategy =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> DerivStrategy -> c DerivStrategy)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DerivStrategy)
-> (DerivStrategy -> Constr)
-> (DerivStrategy -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DerivStrategy))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c DerivStrategy))
-> ((forall b. Data b => b -> b) -> DerivStrategy -> DerivStrategy)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r)
-> (forall u. (forall d. Data d => d -> u) -> DerivStrategy -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DerivStrategy -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy)
-> Data DerivStrategy
DerivStrategy -> Constr
DerivStrategy -> DataType
(forall b. Data b => b -> b) -> DerivStrategy -> DerivStrategy
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DerivStrategy -> u
forall u. (forall d. Data d => d -> u) -> DerivStrategy -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivStrategy
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivStrategy -> c DerivStrategy
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivStrategy)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivStrategy)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivStrategy -> c DerivStrategy
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DerivStrategy -> c DerivStrategy
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivStrategy
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DerivStrategy
$ctoConstr :: DerivStrategy -> Constr
toConstr :: DerivStrategy -> Constr
$cdataTypeOf :: DerivStrategy -> DataType
dataTypeOf :: DerivStrategy -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivStrategy)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DerivStrategy)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivStrategy)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DerivStrategy)
$cgmapT :: (forall b. Data b => b -> b) -> DerivStrategy -> DerivStrategy
gmapT :: (forall b. Data b => b -> b) -> DerivStrategy -> DerivStrategy
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DerivStrategy -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DerivStrategy -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DerivStrategy -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DerivStrategy -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy
Data, (forall x. DerivStrategy -> Rep DerivStrategy x)
-> (forall x. Rep DerivStrategy x -> DerivStrategy)
-> Generic DerivStrategy
forall x. Rep DerivStrategy x -> DerivStrategy
forall x. DerivStrategy -> Rep DerivStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DerivStrategy -> Rep DerivStrategy x
from :: forall x. DerivStrategy -> Rep DerivStrategy x
$cto :: forall x. Rep DerivStrategy x -> DerivStrategy
to :: forall x. Rep DerivStrategy x -> DerivStrategy
Generic )

-- | A pattern synonym's type. Note that a pattern synonym's /fully/
-- specified type has a peculiar shape coming with two forall
-- quantifiers and two constraint contexts. For example, consider the
-- pattern synonym
--
-- > pattern P x1 x2 ... xn = <some-pattern>
--
-- P's complete type is of the following form
--
-- > pattern P :: forall universals.   required constraints
-- >           => forall existentials. provided constraints
-- >           => t1 -> t2 -> ... -> tn -> t
--
-- consisting of four parts:
--
--   1. the (possibly empty lists of) universally quantified type
--      variables and required constraints on them.
--   2. the (possibly empty lists of) existentially quantified
--      type variables and the provided constraints on them.
--   3. the types @t1@, @t2@, .., @tn@ of @x1@, @x2@, .., @xn@, respectively
--   4. the type @t@ of @\<some-pattern\>@, mentioning only universals.
--
-- Pattern synonym types interact with TH when (a) reifying a pattern
-- synonym, (b) pretty printing, or (c) specifying a pattern synonym's
-- type signature explicitly:
--
--   * Reification always returns a pattern synonym's /fully/ specified
--     type in abstract syntax.
--
--   * Pretty printing via 'Language.Haskell.TH.Ppr.pprPatSynType' abbreviates
--     a pattern synonym's type unambiguously in concrete syntax: The rule of
--     thumb is to print initial empty universals and the required
--     context as @() =>@, if existentials and a provided context
--     follow. If only universals and their required context, but no
--     existentials are specified, only the universals and their
--     required context are printed. If both or none are specified, so
--     both (or none) are printed.
--
--   * When specifying a pattern synonym's type explicitly with
--     'PatSynSigD' either one of the universals, the existentials, or
--     their contexts may be left empty.
--
-- See the GHC user's guide for more information on pattern synonyms
-- and their types:
-- <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#pattern-synonyms>.
type PatSynType = Type

-- | Common elements of 'OpenTypeFamilyD' and 'ClosedTypeFamilyD'. By
-- analogy with "head" for type classes and type class instances as
-- defined in /Type classes: an exploration of the design space/, the
-- @TypeFamilyHead@ is defined to be the elements of the declaration
-- between @type family@ and @where@.
data TypeFamilyHead =
  TypeFamilyHead Name [TyVarBndr BndrVis] FamilyResultSig (Maybe InjectivityAnn)
  deriving( Int -> TypeFamilyHead -> FilePath -> FilePath
[TypeFamilyHead] -> FilePath -> FilePath
TypeFamilyHead -> FilePath
(Int -> TypeFamilyHead -> FilePath -> FilePath)
-> (TypeFamilyHead -> FilePath)
-> ([TypeFamilyHead] -> FilePath -> FilePath)
-> Show TypeFamilyHead
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> TypeFamilyHead -> FilePath -> FilePath
showsPrec :: Int -> TypeFamilyHead -> FilePath -> FilePath
$cshow :: TypeFamilyHead -> FilePath
show :: TypeFamilyHead -> FilePath
$cshowList :: [TypeFamilyHead] -> FilePath -> FilePath
showList :: [TypeFamilyHead] -> FilePath -> FilePath
Show, TypeFamilyHead -> TypeFamilyHead -> Bool
(TypeFamilyHead -> TypeFamilyHead -> Bool)
-> (TypeFamilyHead -> TypeFamilyHead -> Bool) -> Eq TypeFamilyHead
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TypeFamilyHead -> TypeFamilyHead -> Bool
== :: TypeFamilyHead -> TypeFamilyHead -> Bool
$c/= :: TypeFamilyHead -> TypeFamilyHead -> Bool
/= :: TypeFamilyHead -> TypeFamilyHead -> Bool
Eq, Eq TypeFamilyHead
Eq TypeFamilyHead =>
(TypeFamilyHead -> TypeFamilyHead -> Ordering)
-> (TypeFamilyHead -> TypeFamilyHead -> Bool)
-> (TypeFamilyHead -> TypeFamilyHead -> Bool)
-> (TypeFamilyHead -> TypeFamilyHead -> Bool)
-> (TypeFamilyHead -> TypeFamilyHead -> Bool)
-> (TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead)
-> (TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead)
-> Ord TypeFamilyHead
TypeFamilyHead -> TypeFamilyHead -> Bool
TypeFamilyHead -> TypeFamilyHead -> Ordering
TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TypeFamilyHead -> TypeFamilyHead -> Ordering
compare :: TypeFamilyHead -> TypeFamilyHead -> Ordering
$c< :: TypeFamilyHead -> TypeFamilyHead -> Bool
< :: TypeFamilyHead -> TypeFamilyHead -> Bool
$c<= :: TypeFamilyHead -> TypeFamilyHead -> Bool
<= :: TypeFamilyHead -> TypeFamilyHead -> Bool
$c> :: TypeFamilyHead -> TypeFamilyHead -> Bool
> :: TypeFamilyHead -> TypeFamilyHead -> Bool
$c>= :: TypeFamilyHead -> TypeFamilyHead -> Bool
>= :: TypeFamilyHead -> TypeFamilyHead -> Bool
$cmax :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead
max :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead
$cmin :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead
min :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead
Ord, Typeable TypeFamilyHead
Typeable TypeFamilyHead =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> TypeFamilyHead -> c TypeFamilyHead)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TypeFamilyHead)
-> (TypeFamilyHead -> Constr)
-> (TypeFamilyHead -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TypeFamilyHead))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TypeFamilyHead))
-> ((forall b. Data b => b -> b)
    -> TypeFamilyHead -> TypeFamilyHead)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> TypeFamilyHead -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TypeFamilyHead -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> TypeFamilyHead -> m TypeFamilyHead)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TypeFamilyHead -> m TypeFamilyHead)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TypeFamilyHead -> m TypeFamilyHead)
-> Data TypeFamilyHead
TypeFamilyHead -> Constr
TypeFamilyHead -> DataType
(forall b. Data b => b -> b) -> TypeFamilyHead -> TypeFamilyHead
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> TypeFamilyHead -> u
forall u. (forall d. Data d => d -> u) -> TypeFamilyHead -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TypeFamilyHead
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypeFamilyHead -> c TypeFamilyHead
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TypeFamilyHead)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TypeFamilyHead)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypeFamilyHead -> c TypeFamilyHead
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TypeFamilyHead -> c TypeFamilyHead
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TypeFamilyHead
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TypeFamilyHead
$ctoConstr :: TypeFamilyHead -> Constr
toConstr :: TypeFamilyHead -> Constr
$cdataTypeOf :: TypeFamilyHead -> DataType
dataTypeOf :: TypeFamilyHead -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TypeFamilyHead)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TypeFamilyHead)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TypeFamilyHead)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TypeFamilyHead)
$cgmapT :: (forall b. Data b => b -> b) -> TypeFamilyHead -> TypeFamilyHead
gmapT :: (forall b. Data b => b -> b) -> TypeFamilyHead -> TypeFamilyHead
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TypeFamilyHead -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TypeFamilyHead -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TypeFamilyHead -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TypeFamilyHead -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TypeFamilyHead -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TypeFamilyHead -> m TypeFamilyHead
Data, (forall x. TypeFamilyHead -> Rep TypeFamilyHead x)
-> (forall x. Rep TypeFamilyHead x -> TypeFamilyHead)
-> Generic TypeFamilyHead
forall x. Rep TypeFamilyHead x -> TypeFamilyHead
forall x. TypeFamilyHead -> Rep TypeFamilyHead x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TypeFamilyHead -> Rep TypeFamilyHead x
from :: forall x. TypeFamilyHead -> Rep TypeFamilyHead x
$cto :: forall x. Rep TypeFamilyHead x -> TypeFamilyHead
to :: forall x. Rep TypeFamilyHead x -> TypeFamilyHead
Generic )

-- | One equation of a type family instance or closed type family. The
-- arguments are the left-hand-side type and the right-hand-side result.
--
-- For instance, if you had the following type family:
--
-- @
-- type family Foo (a :: k) :: k where
--   forall k (a :: k). Foo \@k a = a
-- @
--
-- The @Foo \@k a = a@ equation would be represented as follows:
--
-- @
-- 'TySynEqn' ('Just' ['PlainTV' k, 'KindedTV' a ('VarT' k)])
--            ('AppT' ('AppKindT' ('ConT' ''Foo) ('VarT' k)) ('VarT' a))
--            ('VarT' a)
-- @
data TySynEqn = TySynEqn (Maybe [TyVarBndr ()]) Type Type
  deriving( Int -> TySynEqn -> FilePath -> FilePath
[TySynEqn] -> FilePath -> FilePath
TySynEqn -> FilePath
(Int -> TySynEqn -> FilePath -> FilePath)
-> (TySynEqn -> FilePath)
-> ([TySynEqn] -> FilePath -> FilePath)
-> Show TySynEqn
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> TySynEqn -> FilePath -> FilePath
showsPrec :: Int -> TySynEqn -> FilePath -> FilePath
$cshow :: TySynEqn -> FilePath
show :: TySynEqn -> FilePath
$cshowList :: [TySynEqn] -> FilePath -> FilePath
showList :: [TySynEqn] -> FilePath -> FilePath
Show, TySynEqn -> TySynEqn -> Bool
(TySynEqn -> TySynEqn -> Bool)
-> (TySynEqn -> TySynEqn -> Bool) -> Eq TySynEqn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TySynEqn -> TySynEqn -> Bool
== :: TySynEqn -> TySynEqn -> Bool
$c/= :: TySynEqn -> TySynEqn -> Bool
/= :: TySynEqn -> TySynEqn -> Bool
Eq, Eq TySynEqn
Eq TySynEqn =>
(TySynEqn -> TySynEqn -> Ordering)
-> (TySynEqn -> TySynEqn -> Bool)
-> (TySynEqn -> TySynEqn -> Bool)
-> (TySynEqn -> TySynEqn -> Bool)
-> (TySynEqn -> TySynEqn -> Bool)
-> (TySynEqn -> TySynEqn -> TySynEqn)
-> (TySynEqn -> TySynEqn -> TySynEqn)
-> Ord TySynEqn
TySynEqn -> TySynEqn -> Bool
TySynEqn -> TySynEqn -> Ordering
TySynEqn -> TySynEqn -> TySynEqn
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TySynEqn -> TySynEqn -> Ordering
compare :: TySynEqn -> TySynEqn -> Ordering
$c< :: TySynEqn -> TySynEqn -> Bool
< :: TySynEqn -> TySynEqn -> Bool
$c<= :: TySynEqn -> TySynEqn -> Bool
<= :: TySynEqn -> TySynEqn -> Bool
$c> :: TySynEqn -> TySynEqn -> Bool
> :: TySynEqn -> TySynEqn -> Bool
$c>= :: TySynEqn -> TySynEqn -> Bool
>= :: TySynEqn -> TySynEqn -> Bool
$cmax :: TySynEqn -> TySynEqn -> TySynEqn
max :: TySynEqn -> TySynEqn -> TySynEqn
$cmin :: TySynEqn -> TySynEqn -> TySynEqn
min :: TySynEqn -> TySynEqn -> TySynEqn
Ord, Typeable TySynEqn
Typeable TySynEqn =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> TySynEqn -> c TySynEqn)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TySynEqn)
-> (TySynEqn -> Constr)
-> (TySynEqn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TySynEqn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TySynEqn))
-> ((forall b. Data b => b -> b) -> TySynEqn -> TySynEqn)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TySynEqn -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TySynEqn -> r)
-> (forall u. (forall d. Data d => d -> u) -> TySynEqn -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> TySynEqn -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn)
-> Data TySynEqn
TySynEqn -> Constr
TySynEqn -> DataType
(forall b. Data b => b -> b) -> TySynEqn -> TySynEqn
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> TySynEqn -> u
forall u. (forall d. Data d => d -> u) -> TySynEqn -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TySynEqn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TySynEqn -> c TySynEqn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TySynEqn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TySynEqn)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TySynEqn -> c TySynEqn
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TySynEqn -> c TySynEqn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TySynEqn
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TySynEqn
$ctoConstr :: TySynEqn -> Constr
toConstr :: TySynEqn -> Constr
$cdataTypeOf :: TySynEqn -> DataType
dataTypeOf :: TySynEqn -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TySynEqn)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TySynEqn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TySynEqn)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TySynEqn)
$cgmapT :: (forall b. Data b => b -> b) -> TySynEqn -> TySynEqn
gmapT :: (forall b. Data b => b -> b) -> TySynEqn -> TySynEqn
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TySynEqn -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TySynEqn -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TySynEqn -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TySynEqn -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TySynEqn -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TySynEqn -> m TySynEqn
Data, (forall x. TySynEqn -> Rep TySynEqn x)
-> (forall x. Rep TySynEqn x -> TySynEqn) -> Generic TySynEqn
forall x. Rep TySynEqn x -> TySynEqn
forall x. TySynEqn -> Rep TySynEqn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TySynEqn -> Rep TySynEqn x
from :: forall x. TySynEqn -> Rep TySynEqn x
$cto :: forall x. Rep TySynEqn x -> TySynEqn
to :: forall x. Rep TySynEqn x -> TySynEqn
Generic )

data FunDep = FunDep [Name] [Name]
  deriving( Int -> FunDep -> FilePath -> FilePath
[FunDep] -> FilePath -> FilePath
FunDep -> FilePath
(Int -> FunDep -> FilePath -> FilePath)
-> (FunDep -> FilePath)
-> ([FunDep] -> FilePath -> FilePath)
-> Show FunDep
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> FunDep -> FilePath -> FilePath
showsPrec :: Int -> FunDep -> FilePath -> FilePath
$cshow :: FunDep -> FilePath
show :: FunDep -> FilePath
$cshowList :: [FunDep] -> FilePath -> FilePath
showList :: [FunDep] -> FilePath -> FilePath
Show, FunDep -> FunDep -> Bool
(FunDep -> FunDep -> Bool)
-> (FunDep -> FunDep -> Bool) -> Eq FunDep
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FunDep -> FunDep -> Bool
== :: FunDep -> FunDep -> Bool
$c/= :: FunDep -> FunDep -> Bool
/= :: FunDep -> FunDep -> Bool
Eq, Eq FunDep
Eq FunDep =>
(FunDep -> FunDep -> Ordering)
-> (FunDep -> FunDep -> Bool)
-> (FunDep -> FunDep -> Bool)
-> (FunDep -> FunDep -> Bool)
-> (FunDep -> FunDep -> Bool)
-> (FunDep -> FunDep -> FunDep)
-> (FunDep -> FunDep -> FunDep)
-> Ord FunDep
FunDep -> FunDep -> Bool
FunDep -> FunDep -> Ordering
FunDep -> FunDep -> FunDep
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FunDep -> FunDep -> Ordering
compare :: FunDep -> FunDep -> Ordering
$c< :: FunDep -> FunDep -> Bool
< :: FunDep -> FunDep -> Bool
$c<= :: FunDep -> FunDep -> Bool
<= :: FunDep -> FunDep -> Bool
$c> :: FunDep -> FunDep -> Bool
> :: FunDep -> FunDep -> Bool
$c>= :: FunDep -> FunDep -> Bool
>= :: FunDep -> FunDep -> Bool
$cmax :: FunDep -> FunDep -> FunDep
max :: FunDep -> FunDep -> FunDep
$cmin :: FunDep -> FunDep -> FunDep
min :: FunDep -> FunDep -> FunDep
Ord, Typeable FunDep
Typeable FunDep =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> FunDep -> c FunDep)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c FunDep)
-> (FunDep -> Constr)
-> (FunDep -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c FunDep))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDep))
-> ((forall b. Data b => b -> b) -> FunDep -> FunDep)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FunDep -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FunDep -> r)
-> (forall u. (forall d. Data d => d -> u) -> FunDep -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> FunDep -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> FunDep -> m FunDep)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FunDep -> m FunDep)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FunDep -> m FunDep)
-> Data FunDep
FunDep -> Constr
FunDep -> DataType
(forall b. Data b => b -> b) -> FunDep -> FunDep
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> FunDep -> u
forall u. (forall d. Data d => d -> u) -> FunDep -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FunDep
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FunDep -> c FunDep
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FunDep)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDep)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FunDep -> c FunDep
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FunDep -> c FunDep
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FunDep
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FunDep
$ctoConstr :: FunDep -> Constr
toConstr :: FunDep -> Constr
$cdataTypeOf :: FunDep -> DataType
dataTypeOf :: FunDep -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FunDep)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FunDep)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDep)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunDep)
$cgmapT :: (forall b. Data b => b -> b) -> FunDep -> FunDep
gmapT :: (forall b. Data b => b -> b) -> FunDep -> FunDep
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunDep -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> FunDep -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> FunDep -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> FunDep -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> FunDep -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FunDep -> m FunDep
Data, (forall x. FunDep -> Rep FunDep x)
-> (forall x. Rep FunDep x -> FunDep) -> Generic FunDep
forall x. Rep FunDep x -> FunDep
forall x. FunDep -> Rep FunDep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FunDep -> Rep FunDep x
from :: forall x. FunDep -> Rep FunDep x
$cto :: forall x. Rep FunDep x -> FunDep
to :: forall x. Rep FunDep x -> FunDep
Generic )

data Foreign = ImportF Callconv Safety String Name Type
             | ExportF Callconv        String Name Type
         deriving( Int -> Foreign -> FilePath -> FilePath
[Foreign] -> FilePath -> FilePath
Foreign -> FilePath
(Int -> Foreign -> FilePath -> FilePath)
-> (Foreign -> FilePath)
-> ([Foreign] -> FilePath -> FilePath)
-> Show Foreign
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Foreign -> FilePath -> FilePath
showsPrec :: Int -> Foreign -> FilePath -> FilePath
$cshow :: Foreign -> FilePath
show :: Foreign -> FilePath
$cshowList :: [Foreign] -> FilePath -> FilePath
showList :: [Foreign] -> FilePath -> FilePath
Show, Foreign -> Foreign -> Bool
(Foreign -> Foreign -> Bool)
-> (Foreign -> Foreign -> Bool) -> Eq Foreign
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Foreign -> Foreign -> Bool
== :: Foreign -> Foreign -> Bool
$c/= :: Foreign -> Foreign -> Bool
/= :: Foreign -> Foreign -> Bool
Eq, Eq Foreign
Eq Foreign =>
(Foreign -> Foreign -> Ordering)
-> (Foreign -> Foreign -> Bool)
-> (Foreign -> Foreign -> Bool)
-> (Foreign -> Foreign -> Bool)
-> (Foreign -> Foreign -> Bool)
-> (Foreign -> Foreign -> Foreign)
-> (Foreign -> Foreign -> Foreign)
-> Ord Foreign
Foreign -> Foreign -> Bool
Foreign -> Foreign -> Ordering
Foreign -> Foreign -> Foreign
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Foreign -> Foreign -> Ordering
compare :: Foreign -> Foreign -> Ordering
$c< :: Foreign -> Foreign -> Bool
< :: Foreign -> Foreign -> Bool
$c<= :: Foreign -> Foreign -> Bool
<= :: Foreign -> Foreign -> Bool
$c> :: Foreign -> Foreign -> Bool
> :: Foreign -> Foreign -> Bool
$c>= :: Foreign -> Foreign -> Bool
>= :: Foreign -> Foreign -> Bool
$cmax :: Foreign -> Foreign -> Foreign
max :: Foreign -> Foreign -> Foreign
$cmin :: Foreign -> Foreign -> Foreign
min :: Foreign -> Foreign -> Foreign
Ord, Typeable Foreign
Typeable Foreign =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Foreign -> c Foreign)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Foreign)
-> (Foreign -> Constr)
-> (Foreign -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Foreign))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Foreign))
-> ((forall b. Data b => b -> b) -> Foreign -> Foreign)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Foreign -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Foreign -> r)
-> (forall u. (forall d. Data d => d -> u) -> Foreign -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Foreign -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Foreign -> m Foreign)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Foreign -> m Foreign)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Foreign -> m Foreign)
-> Data Foreign
Foreign -> Constr
Foreign -> DataType
(forall b. Data b => b -> b) -> Foreign -> Foreign
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Foreign -> u
forall u. (forall d. Data d => d -> u) -> Foreign -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Foreign
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Foreign -> c Foreign
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Foreign)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Foreign)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Foreign -> c Foreign
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Foreign -> c Foreign
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Foreign
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Foreign
$ctoConstr :: Foreign -> Constr
toConstr :: Foreign -> Constr
$cdataTypeOf :: Foreign -> DataType
dataTypeOf :: Foreign -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Foreign)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Foreign)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Foreign)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Foreign)
$cgmapT :: (forall b. Data b => b -> b) -> Foreign -> Foreign
gmapT :: (forall b. Data b => b -> b) -> Foreign -> Foreign
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Foreign -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Foreign -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Foreign -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Foreign -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Foreign -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Foreign -> m Foreign
Data, (forall x. Foreign -> Rep Foreign x)
-> (forall x. Rep Foreign x -> Foreign) -> Generic Foreign
forall x. Rep Foreign x -> Foreign
forall x. Foreign -> Rep Foreign x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Foreign -> Rep Foreign x
from :: forall x. Foreign -> Rep Foreign x
$cto :: forall x. Rep Foreign x -> Foreign
to :: forall x. Rep Foreign x -> Foreign
Generic )

-- keep Callconv in sync with module ForeignCall in ghc/compiler/GHC/Types/ForeignCall.hs
data Callconv = CCall | StdCall | CApi | Prim | JavaScript
          deriving( Int -> Callconv -> FilePath -> FilePath
[Callconv] -> FilePath -> FilePath
Callconv -> FilePath
(Int -> Callconv -> FilePath -> FilePath)
-> (Callconv -> FilePath)
-> ([Callconv] -> FilePath -> FilePath)
-> Show Callconv
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Callconv -> FilePath -> FilePath
showsPrec :: Int -> Callconv -> FilePath -> FilePath
$cshow :: Callconv -> FilePath
show :: Callconv -> FilePath
$cshowList :: [Callconv] -> FilePath -> FilePath
showList :: [Callconv] -> FilePath -> FilePath
Show, Callconv -> Callconv -> Bool
(Callconv -> Callconv -> Bool)
-> (Callconv -> Callconv -> Bool) -> Eq Callconv
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Callconv -> Callconv -> Bool
== :: Callconv -> Callconv -> Bool
$c/= :: Callconv -> Callconv -> Bool
/= :: Callconv -> Callconv -> Bool
Eq, Eq Callconv
Eq Callconv =>
(Callconv -> Callconv -> Ordering)
-> (Callconv -> Callconv -> Bool)
-> (Callconv -> Callconv -> Bool)
-> (Callconv -> Callconv -> Bool)
-> (Callconv -> Callconv -> Bool)
-> (Callconv -> Callconv -> Callconv)
-> (Callconv -> Callconv -> Callconv)
-> Ord Callconv
Callconv -> Callconv -> Bool
Callconv -> Callconv -> Ordering
Callconv -> Callconv -> Callconv
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Callconv -> Callconv -> Ordering
compare :: Callconv -> Callconv -> Ordering
$c< :: Callconv -> Callconv -> Bool
< :: Callconv -> Callconv -> Bool
$c<= :: Callconv -> Callconv -> Bool
<= :: Callconv -> Callconv -> Bool
$c> :: Callconv -> Callconv -> Bool
> :: Callconv -> Callconv -> Bool
$c>= :: Callconv -> Callconv -> Bool
>= :: Callconv -> Callconv -> Bool
$cmax :: Callconv -> Callconv -> Callconv
max :: Callconv -> Callconv -> Callconv
$cmin :: Callconv -> Callconv -> Callconv
min :: Callconv -> Callconv -> Callconv
Ord, Typeable Callconv
Typeable Callconv =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Callconv -> c Callconv)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Callconv)
-> (Callconv -> Constr)
-> (Callconv -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Callconv))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Callconv))
-> ((forall b. Data b => b -> b) -> Callconv -> Callconv)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Callconv -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Callconv -> r)
-> (forall u. (forall d. Data d => d -> u) -> Callconv -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Callconv -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Callconv -> m Callconv)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Callconv -> m Callconv)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Callconv -> m Callconv)
-> Data Callconv
Callconv -> Constr
Callconv -> DataType
(forall b. Data b => b -> b) -> Callconv -> Callconv
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Callconv -> u
forall u. (forall d. Data d => d -> u) -> Callconv -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Callconv
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Callconv -> c Callconv
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Callconv)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Callconv)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Callconv -> c Callconv
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Callconv -> c Callconv
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Callconv
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Callconv
$ctoConstr :: Callconv -> Constr
toConstr :: Callconv -> Constr
$cdataTypeOf :: Callconv -> DataType
dataTypeOf :: Callconv -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Callconv)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Callconv)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Callconv)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Callconv)
$cgmapT :: (forall b. Data b => b -> b) -> Callconv -> Callconv
gmapT :: (forall b. Data b => b -> b) -> Callconv -> Callconv
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Callconv -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Callconv -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Callconv -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Callconv -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Callconv -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Callconv -> m Callconv
Data, (forall x. Callconv -> Rep Callconv x)
-> (forall x. Rep Callconv x -> Callconv) -> Generic Callconv
forall x. Rep Callconv x -> Callconv
forall x. Callconv -> Rep Callconv x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Callconv -> Rep Callconv x
from :: forall x. Callconv -> Rep Callconv x
$cto :: forall x. Rep Callconv x -> Callconv
to :: forall x. Rep Callconv x -> Callconv
Generic )

data Safety = Unsafe | Safe | Interruptible
        deriving( Int -> Safety -> FilePath -> FilePath
[Safety] -> FilePath -> FilePath
Safety -> FilePath
(Int -> Safety -> FilePath -> FilePath)
-> (Safety -> FilePath)
-> ([Safety] -> FilePath -> FilePath)
-> Show Safety
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Safety -> FilePath -> FilePath
showsPrec :: Int -> Safety -> FilePath -> FilePath
$cshow :: Safety -> FilePath
show :: Safety -> FilePath
$cshowList :: [Safety] -> FilePath -> FilePath
showList :: [Safety] -> FilePath -> FilePath
Show, Safety -> Safety -> Bool
(Safety -> Safety -> Bool)
-> (Safety -> Safety -> Bool) -> Eq Safety
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Safety -> Safety -> Bool
== :: Safety -> Safety -> Bool
$c/= :: Safety -> Safety -> Bool
/= :: Safety -> Safety -> Bool
Eq, Eq Safety
Eq Safety =>
(Safety -> Safety -> Ordering)
-> (Safety -> Safety -> Bool)
-> (Safety -> Safety -> Bool)
-> (Safety -> Safety -> Bool)
-> (Safety -> Safety -> Bool)
-> (Safety -> Safety -> Safety)
-> (Safety -> Safety -> Safety)
-> Ord Safety
Safety -> Safety -> Bool
Safety -> Safety -> Ordering
Safety -> Safety -> Safety
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Safety -> Safety -> Ordering
compare :: Safety -> Safety -> Ordering
$c< :: Safety -> Safety -> Bool
< :: Safety -> Safety -> Bool
$c<= :: Safety -> Safety -> Bool
<= :: Safety -> Safety -> Bool
$c> :: Safety -> Safety -> Bool
> :: Safety -> Safety -> Bool
$c>= :: Safety -> Safety -> Bool
>= :: Safety -> Safety -> Bool
$cmax :: Safety -> Safety -> Safety
max :: Safety -> Safety -> Safety
$cmin :: Safety -> Safety -> Safety
min :: Safety -> Safety -> Safety
Ord, Typeable Safety
Typeable Safety =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Safety -> c Safety)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Safety)
-> (Safety -> Constr)
-> (Safety -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Safety))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Safety))
-> ((forall b. Data b => b -> b) -> Safety -> Safety)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Safety -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Safety -> r)
-> (forall u. (forall d. Data d => d -> u) -> Safety -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Safety -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Safety -> m Safety)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Safety -> m Safety)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Safety -> m Safety)
-> Data Safety
Safety -> Constr
Safety -> DataType
(forall b. Data b => b -> b) -> Safety -> Safety
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Safety -> u
forall u. (forall d. Data d => d -> u) -> Safety -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Safety
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Safety -> c Safety
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Safety)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Safety)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Safety -> c Safety
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Safety -> c Safety
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Safety
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Safety
$ctoConstr :: Safety -> Constr
toConstr :: Safety -> Constr
$cdataTypeOf :: Safety -> DataType
dataTypeOf :: Safety -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Safety)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Safety)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Safety)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Safety)
$cgmapT :: (forall b. Data b => b -> b) -> Safety -> Safety
gmapT :: (forall b. Data b => b -> b) -> Safety -> Safety
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Safety -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Safety -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Safety -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Safety -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Safety -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Safety -> m Safety
Data, (forall x. Safety -> Rep Safety x)
-> (forall x. Rep Safety x -> Safety) -> Generic Safety
forall x. Rep Safety x -> Safety
forall x. Safety -> Rep Safety x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Safety -> Rep Safety x
from :: forall x. Safety -> Rep Safety x
$cto :: forall x. Rep Safety x -> Safety
to :: forall x. Rep Safety x -> Safety
Generic )

data Pragma = InlineP         Name Inline RuleMatch Phases
            | OpaqueP         Name
            | SpecialiseP     Name Type (Maybe Inline) Phases
            | SpecialiseInstP Type
            | RuleP           String (Maybe [TyVarBndr ()]) [RuleBndr] Exp Exp Phases
            | AnnP            AnnTarget Exp
            | LineP           Int String
            | CompleteP       [Name] (Maybe Name)
                -- ^ @{ {\-\# COMPLETE C_1, ..., C_i [ :: T ] \#-} }@
        deriving( Int -> Pragma -> FilePath -> FilePath
[Pragma] -> FilePath -> FilePath
Pragma -> FilePath
(Int -> Pragma -> FilePath -> FilePath)
-> (Pragma -> FilePath)
-> ([Pragma] -> FilePath -> FilePath)
-> Show Pragma
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Pragma -> FilePath -> FilePath
showsPrec :: Int -> Pragma -> FilePath -> FilePath
$cshow :: Pragma -> FilePath
show :: Pragma -> FilePath
$cshowList :: [Pragma] -> FilePath -> FilePath
showList :: [Pragma] -> FilePath -> FilePath
Show, Pragma -> Pragma -> Bool
(Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Bool) -> Eq Pragma
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Pragma -> Pragma -> Bool
== :: Pragma -> Pragma -> Bool
$c/= :: Pragma -> Pragma -> Bool
/= :: Pragma -> Pragma -> Bool
Eq, Eq Pragma
Eq Pragma =>
(Pragma -> Pragma -> Ordering)
-> (Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Bool)
-> (Pragma -> Pragma -> Pragma)
-> (Pragma -> Pragma -> Pragma)
-> Ord Pragma
Pragma -> Pragma -> Bool
Pragma -> Pragma -> Ordering
Pragma -> Pragma -> Pragma
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Pragma -> Pragma -> Ordering
compare :: Pragma -> Pragma -> Ordering
$c< :: Pragma -> Pragma -> Bool
< :: Pragma -> Pragma -> Bool
$c<= :: Pragma -> Pragma -> Bool
<= :: Pragma -> Pragma -> Bool
$c> :: Pragma -> Pragma -> Bool
> :: Pragma -> Pragma -> Bool
$c>= :: Pragma -> Pragma -> Bool
>= :: Pragma -> Pragma -> Bool
$cmax :: Pragma -> Pragma -> Pragma
max :: Pragma -> Pragma -> Pragma
$cmin :: Pragma -> Pragma -> Pragma
min :: Pragma -> Pragma -> Pragma
Ord, Typeable Pragma
Typeable Pragma =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Pragma -> c Pragma)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Pragma)
-> (Pragma -> Constr)
-> (Pragma -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Pragma))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma))
-> ((forall b. Data b => b -> b) -> Pragma -> Pragma)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Pragma -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Pragma -> r)
-> (forall u. (forall d. Data d => d -> u) -> Pragma -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pragma -> m Pragma)
-> Data Pragma
Pragma -> Constr
Pragma -> DataType
(forall b. Data b => b -> b) -> Pragma -> Pragma
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u
forall u. (forall d. Data d => d -> u) -> Pragma -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pragma)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pragma -> c Pragma
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pragma
$ctoConstr :: Pragma -> Constr
toConstr :: Pragma -> Constr
$cdataTypeOf :: Pragma -> DataType
dataTypeOf :: Pragma -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pragma)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pragma)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pragma)
$cgmapT :: (forall b. Data b => b -> b) -> Pragma -> Pragma
gmapT :: (forall b. Data b => b -> b) -> Pragma -> Pragma
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pragma -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Pragma -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Pragma -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pragma -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pragma -> m Pragma
Data, (forall x. Pragma -> Rep Pragma x)
-> (forall x. Rep Pragma x -> Pragma) -> Generic Pragma
forall x. Rep Pragma x -> Pragma
forall x. Pragma -> Rep Pragma x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Pragma -> Rep Pragma x
from :: forall x. Pragma -> Rep Pragma x
$cto :: forall x. Rep Pragma x -> Pragma
to :: forall x. Rep Pragma x -> Pragma
Generic )

data Inline = NoInline
            | Inline
            | Inlinable
            deriving (Int -> Inline -> FilePath -> FilePath
[Inline] -> FilePath -> FilePath
Inline -> FilePath
(Int -> Inline -> FilePath -> FilePath)
-> (Inline -> FilePath)
-> ([Inline] -> FilePath -> FilePath)
-> Show Inline
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Inline -> FilePath -> FilePath
showsPrec :: Int -> Inline -> FilePath -> FilePath
$cshow :: Inline -> FilePath
show :: Inline -> FilePath
$cshowList :: [Inline] -> FilePath -> FilePath
showList :: [Inline] -> FilePath -> FilePath
Show, Inline -> Inline -> Bool
(Inline -> Inline -> Bool)
-> (Inline -> Inline -> Bool) -> Eq Inline
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Inline -> Inline -> Bool
== :: Inline -> Inline -> Bool
$c/= :: Inline -> Inline -> Bool
/= :: Inline -> Inline -> Bool
Eq, Eq Inline
Eq Inline =>
(Inline -> Inline -> Ordering)
-> (Inline -> Inline -> Bool)
-> (Inline -> Inline -> Bool)
-> (Inline -> Inline -> Bool)
-> (Inline -> Inline -> Bool)
-> (Inline -> Inline -> Inline)
-> (Inline -> Inline -> Inline)
-> Ord Inline
Inline -> Inline -> Bool
Inline -> Inline -> Ordering
Inline -> Inline -> Inline
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Inline -> Inline -> Ordering
compare :: Inline -> Inline -> Ordering
$c< :: Inline -> Inline -> Bool
< :: Inline -> Inline -> Bool
$c<= :: Inline -> Inline -> Bool
<= :: Inline -> Inline -> Bool
$c> :: Inline -> Inline -> Bool
> :: Inline -> Inline -> Bool
$c>= :: Inline -> Inline -> Bool
>= :: Inline -> Inline -> Bool
$cmax :: Inline -> Inline -> Inline
max :: Inline -> Inline -> Inline
$cmin :: Inline -> Inline -> Inline
min :: Inline -> Inline -> Inline
Ord, Typeable Inline
Typeable Inline =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Inline -> c Inline)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Inline)
-> (Inline -> Constr)
-> (Inline -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Inline))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Inline))
-> ((forall b. Data b => b -> b) -> Inline -> Inline)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Inline -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Inline -> r)
-> (forall u. (forall d. Data d => d -> u) -> Inline -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Inline -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Inline -> m Inline)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Inline -> m Inline)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Inline -> m Inline)
-> Data Inline
Inline -> Constr
Inline -> DataType
(forall b. Data b => b -> b) -> Inline -> Inline
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Inline -> u
forall u. (forall d. Data d => d -> u) -> Inline -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Inline
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Inline -> c Inline
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Inline)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Inline)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Inline -> c Inline
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Inline -> c Inline
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Inline
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Inline
$ctoConstr :: Inline -> Constr
toConstr :: Inline -> Constr
$cdataTypeOf :: Inline -> DataType
dataTypeOf :: Inline -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Inline)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Inline)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Inline)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Inline)
$cgmapT :: (forall b. Data b => b -> b) -> Inline -> Inline
gmapT :: (forall b. Data b => b -> b) -> Inline -> Inline
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Inline -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Inline -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Inline -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Inline -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Inline -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Inline -> m Inline
Data, (forall x. Inline -> Rep Inline x)
-> (forall x. Rep Inline x -> Inline) -> Generic Inline
forall x. Rep Inline x -> Inline
forall x. Inline -> Rep Inline x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Inline -> Rep Inline x
from :: forall x. Inline -> Rep Inline x
$cto :: forall x. Rep Inline x -> Inline
to :: forall x. Rep Inline x -> Inline
Generic)

data RuleMatch = ConLike
               | FunLike
               deriving (Int -> RuleMatch -> FilePath -> FilePath
[RuleMatch] -> FilePath -> FilePath
RuleMatch -> FilePath
(Int -> RuleMatch -> FilePath -> FilePath)
-> (RuleMatch -> FilePath)
-> ([RuleMatch] -> FilePath -> FilePath)
-> Show RuleMatch
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> RuleMatch -> FilePath -> FilePath
showsPrec :: Int -> RuleMatch -> FilePath -> FilePath
$cshow :: RuleMatch -> FilePath
show :: RuleMatch -> FilePath
$cshowList :: [RuleMatch] -> FilePath -> FilePath
showList :: [RuleMatch] -> FilePath -> FilePath
Show, RuleMatch -> RuleMatch -> Bool
(RuleMatch -> RuleMatch -> Bool)
-> (RuleMatch -> RuleMatch -> Bool) -> Eq RuleMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RuleMatch -> RuleMatch -> Bool
== :: RuleMatch -> RuleMatch -> Bool
$c/= :: RuleMatch -> RuleMatch -> Bool
/= :: RuleMatch -> RuleMatch -> Bool
Eq, Eq RuleMatch
Eq RuleMatch =>
(RuleMatch -> RuleMatch -> Ordering)
-> (RuleMatch -> RuleMatch -> Bool)
-> (RuleMatch -> RuleMatch -> Bool)
-> (RuleMatch -> RuleMatch -> Bool)
-> (RuleMatch -> RuleMatch -> Bool)
-> (RuleMatch -> RuleMatch -> RuleMatch)
-> (RuleMatch -> RuleMatch -> RuleMatch)
-> Ord RuleMatch
RuleMatch -> RuleMatch -> Bool
RuleMatch -> RuleMatch -> Ordering
RuleMatch -> RuleMatch -> RuleMatch
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: RuleMatch -> RuleMatch -> Ordering
compare :: RuleMatch -> RuleMatch -> Ordering
$c< :: RuleMatch -> RuleMatch -> Bool
< :: RuleMatch -> RuleMatch -> Bool
$c<= :: RuleMatch -> RuleMatch -> Bool
<= :: RuleMatch -> RuleMatch -> Bool
$c> :: RuleMatch -> RuleMatch -> Bool
> :: RuleMatch -> RuleMatch -> Bool
$c>= :: RuleMatch -> RuleMatch -> Bool
>= :: RuleMatch -> RuleMatch -> Bool
$cmax :: RuleMatch -> RuleMatch -> RuleMatch
max :: RuleMatch -> RuleMatch -> RuleMatch
$cmin :: RuleMatch -> RuleMatch -> RuleMatch
min :: RuleMatch -> RuleMatch -> RuleMatch
Ord, Typeable RuleMatch
Typeable RuleMatch =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> RuleMatch -> c RuleMatch)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RuleMatch)
-> (RuleMatch -> Constr)
-> (RuleMatch -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RuleMatch))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatch))
-> ((forall b. Data b => b -> b) -> RuleMatch -> RuleMatch)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RuleMatch -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RuleMatch -> r)
-> (forall u. (forall d. Data d => d -> u) -> RuleMatch -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RuleMatch -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch)
-> Data RuleMatch
RuleMatch -> Constr
RuleMatch -> DataType
(forall b. Data b => b -> b) -> RuleMatch -> RuleMatch
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> RuleMatch -> u
forall u. (forall d. Data d => d -> u) -> RuleMatch -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleMatch
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleMatch -> c RuleMatch
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleMatch)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatch)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleMatch -> c RuleMatch
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleMatch -> c RuleMatch
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleMatch
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleMatch
$ctoConstr :: RuleMatch -> Constr
toConstr :: RuleMatch -> Constr
$cdataTypeOf :: RuleMatch -> DataType
dataTypeOf :: RuleMatch -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleMatch)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleMatch)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatch)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatch)
$cgmapT :: (forall b. Data b => b -> b) -> RuleMatch -> RuleMatch
gmapT :: (forall b. Data b => b -> b) -> RuleMatch -> RuleMatch
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleMatch -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RuleMatch -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RuleMatch -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RuleMatch -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RuleMatch -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleMatch -> m RuleMatch
Data, (forall x. RuleMatch -> Rep RuleMatch x)
-> (forall x. Rep RuleMatch x -> RuleMatch) -> Generic RuleMatch
forall x. Rep RuleMatch x -> RuleMatch
forall x. RuleMatch -> Rep RuleMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RuleMatch -> Rep RuleMatch x
from :: forall x. RuleMatch -> Rep RuleMatch x
$cto :: forall x. Rep RuleMatch x -> RuleMatch
to :: forall x. Rep RuleMatch x -> RuleMatch
Generic)

data Phases = AllPhases
            | FromPhase Int
            | BeforePhase Int
            deriving (Int -> Phases -> FilePath -> FilePath
[Phases] -> FilePath -> FilePath
Phases -> FilePath
(Int -> Phases -> FilePath -> FilePath)
-> (Phases -> FilePath)
-> ([Phases] -> FilePath -> FilePath)
-> Show Phases
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Phases -> FilePath -> FilePath
showsPrec :: Int -> Phases -> FilePath -> FilePath
$cshow :: Phases -> FilePath
show :: Phases -> FilePath
$cshowList :: [Phases] -> FilePath -> FilePath
showList :: [Phases] -> FilePath -> FilePath
Show, Phases -> Phases -> Bool
(Phases -> Phases -> Bool)
-> (Phases -> Phases -> Bool) -> Eq Phases
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Phases -> Phases -> Bool
== :: Phases -> Phases -> Bool
$c/= :: Phases -> Phases -> Bool
/= :: Phases -> Phases -> Bool
Eq, Eq Phases
Eq Phases =>
(Phases -> Phases -> Ordering)
-> (Phases -> Phases -> Bool)
-> (Phases -> Phases -> Bool)
-> (Phases -> Phases -> Bool)
-> (Phases -> Phases -> Bool)
-> (Phases -> Phases -> Phases)
-> (Phases -> Phases -> Phases)
-> Ord Phases
Phases -> Phases -> Bool
Phases -> Phases -> Ordering
Phases -> Phases -> Phases
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Phases -> Phases -> Ordering
compare :: Phases -> Phases -> Ordering
$c< :: Phases -> Phases -> Bool
< :: Phases -> Phases -> Bool
$c<= :: Phases -> Phases -> Bool
<= :: Phases -> Phases -> Bool
$c> :: Phases -> Phases -> Bool
> :: Phases -> Phases -> Bool
$c>= :: Phases -> Phases -> Bool
>= :: Phases -> Phases -> Bool
$cmax :: Phases -> Phases -> Phases
max :: Phases -> Phases -> Phases
$cmin :: Phases -> Phases -> Phases
min :: Phases -> Phases -> Phases
Ord, Typeable Phases
Typeable Phases =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Phases -> c Phases)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Phases)
-> (Phases -> Constr)
-> (Phases -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Phases))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Phases))
-> ((forall b. Data b => b -> b) -> Phases -> Phases)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Phases -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Phases -> r)
-> (forall u. (forall d. Data d => d -> u) -> Phases -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Phases -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Phases -> m Phases)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Phases -> m Phases)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Phases -> m Phases)
-> Data Phases
Phases -> Constr
Phases -> DataType
(forall b. Data b => b -> b) -> Phases -> Phases
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Phases -> u
forall u. (forall d. Data d => d -> u) -> Phases -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Phases
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Phases -> c Phases
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Phases)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Phases)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Phases -> c Phases
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Phases -> c Phases
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Phases
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Phases
$ctoConstr :: Phases -> Constr
toConstr :: Phases -> Constr
$cdataTypeOf :: Phases -> DataType
dataTypeOf :: Phases -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Phases)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Phases)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Phases)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Phases)
$cgmapT :: (forall b. Data b => b -> b) -> Phases -> Phases
gmapT :: (forall b. Data b => b -> b) -> Phases -> Phases
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Phases -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Phases -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Phases -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Phases -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Phases -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Phases -> m Phases
Data, (forall x. Phases -> Rep Phases x)
-> (forall x. Rep Phases x -> Phases) -> Generic Phases
forall x. Rep Phases x -> Phases
forall x. Phases -> Rep Phases x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Phases -> Rep Phases x
from :: forall x. Phases -> Rep Phases x
$cto :: forall x. Rep Phases x -> Phases
to :: forall x. Rep Phases x -> Phases
Generic)

data RuleBndr = RuleVar Name
              | TypedRuleVar Name Type
              deriving (Int -> RuleBndr -> FilePath -> FilePath
[RuleBndr] -> FilePath -> FilePath
RuleBndr -> FilePath
(Int -> RuleBndr -> FilePath -> FilePath)
-> (RuleBndr -> FilePath)
-> ([RuleBndr] -> FilePath -> FilePath)
-> Show RuleBndr
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> RuleBndr -> FilePath -> FilePath
showsPrec :: Int -> RuleBndr -> FilePath -> FilePath
$cshow :: RuleBndr -> FilePath
show :: RuleBndr -> FilePath
$cshowList :: [RuleBndr] -> FilePath -> FilePath
showList :: [RuleBndr] -> FilePath -> FilePath
Show, RuleBndr -> RuleBndr -> Bool
(RuleBndr -> RuleBndr -> Bool)
-> (RuleBndr -> RuleBndr -> Bool) -> Eq RuleBndr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RuleBndr -> RuleBndr -> Bool
== :: RuleBndr -> RuleBndr -> Bool
$c/= :: RuleBndr -> RuleBndr -> Bool
/= :: RuleBndr -> RuleBndr -> Bool
Eq, Eq RuleBndr
Eq RuleBndr =>
(RuleBndr -> RuleBndr -> Ordering)
-> (RuleBndr -> RuleBndr -> Bool)
-> (RuleBndr -> RuleBndr -> Bool)
-> (RuleBndr -> RuleBndr -> Bool)
-> (RuleBndr -> RuleBndr -> Bool)
-> (RuleBndr -> RuleBndr -> RuleBndr)
-> (RuleBndr -> RuleBndr -> RuleBndr)
-> Ord RuleBndr
RuleBndr -> RuleBndr -> Bool
RuleBndr -> RuleBndr -> Ordering
RuleBndr -> RuleBndr -> RuleBndr
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: RuleBndr -> RuleBndr -> Ordering
compare :: RuleBndr -> RuleBndr -> Ordering
$c< :: RuleBndr -> RuleBndr -> Bool
< :: RuleBndr -> RuleBndr -> Bool
$c<= :: RuleBndr -> RuleBndr -> Bool
<= :: RuleBndr -> RuleBndr -> Bool
$c> :: RuleBndr -> RuleBndr -> Bool
> :: RuleBndr -> RuleBndr -> Bool
$c>= :: RuleBndr -> RuleBndr -> Bool
>= :: RuleBndr -> RuleBndr -> Bool
$cmax :: RuleBndr -> RuleBndr -> RuleBndr
max :: RuleBndr -> RuleBndr -> RuleBndr
$cmin :: RuleBndr -> RuleBndr -> RuleBndr
min :: RuleBndr -> RuleBndr -> RuleBndr
Ord, Typeable RuleBndr
Typeable RuleBndr =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> RuleBndr -> c RuleBndr)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RuleBndr)
-> (RuleBndr -> Constr)
-> (RuleBndr -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RuleBndr))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleBndr))
-> ((forall b. Data b => b -> b) -> RuleBndr -> RuleBndr)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RuleBndr -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RuleBndr -> r)
-> (forall u. (forall d. Data d => d -> u) -> RuleBndr -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> RuleBndr -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr)
-> Data RuleBndr
RuleBndr -> Constr
RuleBndr -> DataType
(forall b. Data b => b -> b) -> RuleBndr -> RuleBndr
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> RuleBndr -> u
forall u. (forall d. Data d => d -> u) -> RuleBndr -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleBndr
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleBndr -> c RuleBndr
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleBndr)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleBndr)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleBndr -> c RuleBndr
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RuleBndr -> c RuleBndr
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleBndr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RuleBndr
$ctoConstr :: RuleBndr -> Constr
toConstr :: RuleBndr -> Constr
$cdataTypeOf :: RuleBndr -> DataType
dataTypeOf :: RuleBndr -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleBndr)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RuleBndr)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleBndr)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleBndr)
$cgmapT :: (forall b. Data b => b -> b) -> RuleBndr -> RuleBndr
gmapT :: (forall b. Data b => b -> b) -> RuleBndr -> RuleBndr
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RuleBndr -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RuleBndr -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> RuleBndr -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RuleBndr -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> RuleBndr -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> RuleBndr -> m RuleBndr
Data, (forall x. RuleBndr -> Rep RuleBndr x)
-> (forall x. Rep RuleBndr x -> RuleBndr) -> Generic RuleBndr
forall x. Rep RuleBndr x -> RuleBndr
forall x. RuleBndr -> Rep RuleBndr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RuleBndr -> Rep RuleBndr x
from :: forall x. RuleBndr -> Rep RuleBndr x
$cto :: forall x. Rep RuleBndr x -> RuleBndr
to :: forall x. Rep RuleBndr x -> RuleBndr
Generic)

data AnnTarget = ModuleAnnotation
               | TypeAnnotation Name
               | ValueAnnotation Name
              deriving (Int -> AnnTarget -> FilePath -> FilePath
[AnnTarget] -> FilePath -> FilePath
AnnTarget -> FilePath
(Int -> AnnTarget -> FilePath -> FilePath)
-> (AnnTarget -> FilePath)
-> ([AnnTarget] -> FilePath -> FilePath)
-> Show AnnTarget
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> AnnTarget -> FilePath -> FilePath
showsPrec :: Int -> AnnTarget -> FilePath -> FilePath
$cshow :: AnnTarget -> FilePath
show :: AnnTarget -> FilePath
$cshowList :: [AnnTarget] -> FilePath -> FilePath
showList :: [AnnTarget] -> FilePath -> FilePath
Show, AnnTarget -> AnnTarget -> Bool
(AnnTarget -> AnnTarget -> Bool)
-> (AnnTarget -> AnnTarget -> Bool) -> Eq AnnTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AnnTarget -> AnnTarget -> Bool
== :: AnnTarget -> AnnTarget -> Bool
$c/= :: AnnTarget -> AnnTarget -> Bool
/= :: AnnTarget -> AnnTarget -> Bool
Eq, Eq AnnTarget
Eq AnnTarget =>
(AnnTarget -> AnnTarget -> Ordering)
-> (AnnTarget -> AnnTarget -> Bool)
-> (AnnTarget -> AnnTarget -> Bool)
-> (AnnTarget -> AnnTarget -> Bool)
-> (AnnTarget -> AnnTarget -> Bool)
-> (AnnTarget -> AnnTarget -> AnnTarget)
-> (AnnTarget -> AnnTarget -> AnnTarget)
-> Ord AnnTarget
AnnTarget -> AnnTarget -> Bool
AnnTarget -> AnnTarget -> Ordering
AnnTarget -> AnnTarget -> AnnTarget
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AnnTarget -> AnnTarget -> Ordering
compare :: AnnTarget -> AnnTarget -> Ordering
$c< :: AnnTarget -> AnnTarget -> Bool
< :: AnnTarget -> AnnTarget -> Bool
$c<= :: AnnTarget -> AnnTarget -> Bool
<= :: AnnTarget -> AnnTarget -> Bool
$c> :: AnnTarget -> AnnTarget -> Bool
> :: AnnTarget -> AnnTarget -> Bool
$c>= :: AnnTarget -> AnnTarget -> Bool
>= :: AnnTarget -> AnnTarget -> Bool
$cmax :: AnnTarget -> AnnTarget -> AnnTarget
max :: AnnTarget -> AnnTarget -> AnnTarget
$cmin :: AnnTarget -> AnnTarget -> AnnTarget
min :: AnnTarget -> AnnTarget -> AnnTarget
Ord, Typeable AnnTarget
Typeable AnnTarget =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> AnnTarget -> c AnnTarget)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c AnnTarget)
-> (AnnTarget -> Constr)
-> (AnnTarget -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c AnnTarget))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget))
-> ((forall b. Data b => b -> b) -> AnnTarget -> AnnTarget)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AnnTarget -> r)
-> (forall u. (forall d. Data d => d -> u) -> AnnTarget -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> AnnTarget -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget)
-> Data AnnTarget
AnnTarget -> Constr
AnnTarget -> DataType
(forall b. Data b => b -> b) -> AnnTarget -> AnnTarget
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> AnnTarget -> u
forall u. (forall d. Data d => d -> u) -> AnnTarget -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnTarget
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnTarget -> c AnnTarget
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnTarget)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnTarget -> c AnnTarget
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnTarget -> c AnnTarget
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnTarget
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnTarget
$ctoConstr :: AnnTarget -> Constr
toConstr :: AnnTarget -> Constr
$cdataTypeOf :: AnnTarget -> DataType
dataTypeOf :: AnnTarget -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnTarget)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnTarget)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnTarget)
$cgmapT :: (forall b. Data b => b -> b) -> AnnTarget -> AnnTarget
gmapT :: (forall b. Data b => b -> b) -> AnnTarget -> AnnTarget
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnTarget -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> AnnTarget -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> AnnTarget -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnnTarget -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnnTarget -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnTarget -> m AnnTarget
Data, (forall x. AnnTarget -> Rep AnnTarget x)
-> (forall x. Rep AnnTarget x -> AnnTarget) -> Generic AnnTarget
forall x. Rep AnnTarget x -> AnnTarget
forall x. AnnTarget -> Rep AnnTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AnnTarget -> Rep AnnTarget x
from :: forall x. AnnTarget -> Rep AnnTarget x
$cto :: forall x. Rep AnnTarget x -> AnnTarget
to :: forall x. Rep AnnTarget x -> AnnTarget
Generic)

type Cxt = [Pred]                 -- ^ @(Eq a, Ord b)@

-- | Since the advent of @ConstraintKinds@, constraints are really just types.
-- Equality constraints use the 'EqualityT' constructor. Constraints may also
-- be tuples of other constraints.
type Pred = Type

-- | 'SourceUnpackedness' corresponds to unpack annotations found in the source code.
--
-- This may not agree with the annotations returned by 'reifyConStrictness'.
-- See 'reifyConStrictness' for more information.
data SourceUnpackedness
  = NoSourceUnpackedness -- ^ @C a@
  | SourceNoUnpack       -- ^ @C { {\-\# NOUNPACK \#-\} } a@
  | SourceUnpack         -- ^ @C { {\-\# UNPACK \#-\} } a@
        deriving (Int -> SourceUnpackedness -> FilePath -> FilePath
[SourceUnpackedness] -> FilePath -> FilePath
SourceUnpackedness -> FilePath
(Int -> SourceUnpackedness -> FilePath -> FilePath)
-> (SourceUnpackedness -> FilePath)
-> ([SourceUnpackedness] -> FilePath -> FilePath)
-> Show SourceUnpackedness
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> SourceUnpackedness -> FilePath -> FilePath
showsPrec :: Int -> SourceUnpackedness -> FilePath -> FilePath
$cshow :: SourceUnpackedness -> FilePath
show :: SourceUnpackedness -> FilePath
$cshowList :: [SourceUnpackedness] -> FilePath -> FilePath
showList :: [SourceUnpackedness] -> FilePath -> FilePath
Show, SourceUnpackedness -> SourceUnpackedness -> Bool
(SourceUnpackedness -> SourceUnpackedness -> Bool)
-> (SourceUnpackedness -> SourceUnpackedness -> Bool)
-> Eq SourceUnpackedness
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SourceUnpackedness -> SourceUnpackedness -> Bool
== :: SourceUnpackedness -> SourceUnpackedness -> Bool
$c/= :: SourceUnpackedness -> SourceUnpackedness -> Bool
/= :: SourceUnpackedness -> SourceUnpackedness -> Bool
Eq, Eq SourceUnpackedness
Eq SourceUnpackedness =>
(SourceUnpackedness -> SourceUnpackedness -> Ordering)
-> (SourceUnpackedness -> SourceUnpackedness -> Bool)
-> (SourceUnpackedness -> SourceUnpackedness -> Bool)
-> (SourceUnpackedness -> SourceUnpackedness -> Bool)
-> (SourceUnpackedness -> SourceUnpackedness -> Bool)
-> (SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness)
-> (SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness)
-> Ord SourceUnpackedness
SourceUnpackedness -> SourceUnpackedness -> Bool
SourceUnpackedness -> SourceUnpackedness -> Ordering
SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SourceUnpackedness -> SourceUnpackedness -> Ordering
compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering
$c< :: SourceUnpackedness -> SourceUnpackedness -> Bool
< :: SourceUnpackedness -> SourceUnpackedness -> Bool
$c<= :: SourceUnpackedness -> SourceUnpackedness -> Bool
<= :: SourceUnpackedness -> SourceUnpackedness -> Bool
$c> :: SourceUnpackedness -> SourceUnpackedness -> Bool
> :: SourceUnpackedness -> SourceUnpackedness -> Bool
$c>= :: SourceUnpackedness -> SourceUnpackedness -> Bool
>= :: SourceUnpackedness -> SourceUnpackedness -> Bool
$cmax :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness
max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness
$cmin :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness
min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness
Ord, Typeable SourceUnpackedness
Typeable SourceUnpackedness =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SourceUnpackedness
 -> c SourceUnpackedness)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SourceUnpackedness)
-> (SourceUnpackedness -> Constr)
-> (SourceUnpackedness -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SourceUnpackedness))
-> ((forall b. Data b => b -> b)
    -> SourceUnpackedness -> SourceUnpackedness)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SourceUnpackedness -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SourceUnpackedness -> m SourceUnpackedness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SourceUnpackedness -> m SourceUnpackedness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SourceUnpackedness -> m SourceUnpackedness)
-> Data SourceUnpackedness
SourceUnpackedness -> Constr
SourceUnpackedness -> DataType
(forall b. Data b => b -> b)
-> SourceUnpackedness -> SourceUnpackedness
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u
forall u. (forall d. Data d => d -> u) -> SourceUnpackedness -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceUnpackedness
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SourceUnpackedness
-> c SourceUnpackedness
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceUnpackedness)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SourceUnpackedness
-> c SourceUnpackedness
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SourceUnpackedness
-> c SourceUnpackedness
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceUnpackedness
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceUnpackedness
$ctoConstr :: SourceUnpackedness -> Constr
toConstr :: SourceUnpackedness -> Constr
$cdataTypeOf :: SourceUnpackedness -> DataType
dataTypeOf :: SourceUnpackedness -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceUnpackedness)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceUnpackedness)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceUnpackedness)
$cgmapT :: (forall b. Data b => b -> b)
-> SourceUnpackedness -> SourceUnpackedness
gmapT :: (forall b. Data b => b -> b)
-> SourceUnpackedness -> SourceUnpackedness
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceUnpackedness -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SourceUnpackedness -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SourceUnpackedness -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SourceUnpackedness -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceUnpackedness -> m SourceUnpackedness
Data, (forall x. SourceUnpackedness -> Rep SourceUnpackedness x)
-> (forall x. Rep SourceUnpackedness x -> SourceUnpackedness)
-> Generic SourceUnpackedness
forall x. Rep SourceUnpackedness x -> SourceUnpackedness
forall x. SourceUnpackedness -> Rep SourceUnpackedness x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SourceUnpackedness -> Rep SourceUnpackedness x
from :: forall x. SourceUnpackedness -> Rep SourceUnpackedness x
$cto :: forall x. Rep SourceUnpackedness x -> SourceUnpackedness
to :: forall x. Rep SourceUnpackedness x -> SourceUnpackedness
Generic)

-- | 'SourceStrictness' corresponds to strictness annotations found in the source code.
--
-- This may not agree with the annotations returned by 'reifyConStrictness'.
-- See 'reifyConStrictness' for more information.
data SourceStrictness = NoSourceStrictness    -- ^ @C a@
                      | SourceLazy            -- ^ @C {~}a@
                      | SourceStrict          -- ^ @C {!}a@
        deriving (Int -> SourceStrictness -> FilePath -> FilePath
[SourceStrictness] -> FilePath -> FilePath
SourceStrictness -> FilePath
(Int -> SourceStrictness -> FilePath -> FilePath)
-> (SourceStrictness -> FilePath)
-> ([SourceStrictness] -> FilePath -> FilePath)
-> Show SourceStrictness
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> SourceStrictness -> FilePath -> FilePath
showsPrec :: Int -> SourceStrictness -> FilePath -> FilePath
$cshow :: SourceStrictness -> FilePath
show :: SourceStrictness -> FilePath
$cshowList :: [SourceStrictness] -> FilePath -> FilePath
showList :: [SourceStrictness] -> FilePath -> FilePath
Show, SourceStrictness -> SourceStrictness -> Bool
(SourceStrictness -> SourceStrictness -> Bool)
-> (SourceStrictness -> SourceStrictness -> Bool)
-> Eq SourceStrictness
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SourceStrictness -> SourceStrictness -> Bool
== :: SourceStrictness -> SourceStrictness -> Bool
$c/= :: SourceStrictness -> SourceStrictness -> Bool
/= :: SourceStrictness -> SourceStrictness -> Bool
Eq, Eq SourceStrictness
Eq SourceStrictness =>
(SourceStrictness -> SourceStrictness -> Ordering)
-> (SourceStrictness -> SourceStrictness -> Bool)
-> (SourceStrictness -> SourceStrictness -> Bool)
-> (SourceStrictness -> SourceStrictness -> Bool)
-> (SourceStrictness -> SourceStrictness -> Bool)
-> (SourceStrictness -> SourceStrictness -> SourceStrictness)
-> (SourceStrictness -> SourceStrictness -> SourceStrictness)
-> Ord SourceStrictness
SourceStrictness -> SourceStrictness -> Bool
SourceStrictness -> SourceStrictness -> Ordering
SourceStrictness -> SourceStrictness -> SourceStrictness
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SourceStrictness -> SourceStrictness -> Ordering
compare :: SourceStrictness -> SourceStrictness -> Ordering
$c< :: SourceStrictness -> SourceStrictness -> Bool
< :: SourceStrictness -> SourceStrictness -> Bool
$c<= :: SourceStrictness -> SourceStrictness -> Bool
<= :: SourceStrictness -> SourceStrictness -> Bool
$c> :: SourceStrictness -> SourceStrictness -> Bool
> :: SourceStrictness -> SourceStrictness -> Bool
$c>= :: SourceStrictness -> SourceStrictness -> Bool
>= :: SourceStrictness -> SourceStrictness -> Bool
$cmax :: SourceStrictness -> SourceStrictness -> SourceStrictness
max :: SourceStrictness -> SourceStrictness -> SourceStrictness
$cmin :: SourceStrictness -> SourceStrictness -> SourceStrictness
min :: SourceStrictness -> SourceStrictness -> SourceStrictness
Ord, Typeable SourceStrictness
Typeable SourceStrictness =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SourceStrictness)
-> (SourceStrictness -> Constr)
-> (SourceStrictness -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SourceStrictness))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SourceStrictness))
-> ((forall b. Data b => b -> b)
    -> SourceStrictness -> SourceStrictness)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SourceStrictness -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SourceStrictness -> m SourceStrictness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SourceStrictness -> m SourceStrictness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SourceStrictness -> m SourceStrictness)
-> Data SourceStrictness
SourceStrictness -> Constr
SourceStrictness -> DataType
(forall b. Data b => b -> b)
-> SourceStrictness -> SourceStrictness
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u
forall u. (forall d. Data d => d -> u) -> SourceStrictness -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceStrictness
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceStrictness)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceStrictness)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SourceStrictness -> c SourceStrictness
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceStrictness
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SourceStrictness
$ctoConstr :: SourceStrictness -> Constr
toConstr :: SourceStrictness -> Constr
$cdataTypeOf :: SourceStrictness -> DataType
dataTypeOf :: SourceStrictness -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceStrictness)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SourceStrictness)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceStrictness)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SourceStrictness)
$cgmapT :: (forall b. Data b => b -> b)
-> SourceStrictness -> SourceStrictness
gmapT :: (forall b. Data b => b -> b)
-> SourceStrictness -> SourceStrictness
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SourceStrictness -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SourceStrictness -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SourceStrictness -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SourceStrictness -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SourceStrictness -> m SourceStrictness
Data, (forall x. SourceStrictness -> Rep SourceStrictness x)
-> (forall x. Rep SourceStrictness x -> SourceStrictness)
-> Generic SourceStrictness
forall x. Rep SourceStrictness x -> SourceStrictness
forall x. SourceStrictness -> Rep SourceStrictness x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SourceStrictness -> Rep SourceStrictness x
from :: forall x. SourceStrictness -> Rep SourceStrictness x
$cto :: forall x. Rep SourceStrictness x -> SourceStrictness
to :: forall x. Rep SourceStrictness x -> SourceStrictness
Generic)

-- | Unlike 'SourceStrictness' and 'SourceUnpackedness', 'DecidedStrictness'
-- refers to the strictness annotations that the compiler chooses for a data constructor
-- field, which may be different from what is written in source code.
--
-- Note that non-unpacked strict fields are assigned 'DecidedLazy' when a bang would be inappropriate,
-- such as the field of a newtype constructor and fields that have an unlifted type.
--
-- See 'reifyConStrictness' for more information.
data DecidedStrictness = DecidedLazy -- ^ Field inferred to not have a bang.
                       | DecidedStrict -- ^ Field inferred to have a bang.
                       | DecidedUnpack -- ^ Field inferred to be unpacked.
        deriving (Int -> DecidedStrictness -> FilePath -> FilePath
[DecidedStrictness] -> FilePath -> FilePath
DecidedStrictness -> FilePath
(Int -> DecidedStrictness -> FilePath -> FilePath)
-> (DecidedStrictness -> FilePath)
-> ([DecidedStrictness] -> FilePath -> FilePath)
-> Show DecidedStrictness
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> DecidedStrictness -> FilePath -> FilePath
showsPrec :: Int -> DecidedStrictness -> FilePath -> FilePath
$cshow :: DecidedStrictness -> FilePath
show :: DecidedStrictness -> FilePath
$cshowList :: [DecidedStrictness] -> FilePath -> FilePath
showList :: [DecidedStrictness] -> FilePath -> FilePath
Show, DecidedStrictness -> DecidedStrictness -> Bool
(DecidedStrictness -> DecidedStrictness -> Bool)
-> (DecidedStrictness -> DecidedStrictness -> Bool)
-> Eq DecidedStrictness
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DecidedStrictness -> DecidedStrictness -> Bool
== :: DecidedStrictness -> DecidedStrictness -> Bool
$c/= :: DecidedStrictness -> DecidedStrictness -> Bool
/= :: DecidedStrictness -> DecidedStrictness -> Bool
Eq, Eq DecidedStrictness
Eq DecidedStrictness =>
(DecidedStrictness -> DecidedStrictness -> Ordering)
-> (DecidedStrictness -> DecidedStrictness -> Bool)
-> (DecidedStrictness -> DecidedStrictness -> Bool)
-> (DecidedStrictness -> DecidedStrictness -> Bool)
-> (DecidedStrictness -> DecidedStrictness -> Bool)
-> (DecidedStrictness -> DecidedStrictness -> DecidedStrictness)
-> (DecidedStrictness -> DecidedStrictness -> DecidedStrictness)
-> Ord DecidedStrictness
DecidedStrictness -> DecidedStrictness -> Bool
DecidedStrictness -> DecidedStrictness -> Ordering
DecidedStrictness -> DecidedStrictness -> DecidedStrictness
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DecidedStrictness -> DecidedStrictness -> Ordering
compare :: DecidedStrictness -> DecidedStrictness -> Ordering
$c< :: DecidedStrictness -> DecidedStrictness -> Bool
< :: DecidedStrictness -> DecidedStrictness -> Bool
$c<= :: DecidedStrictness -> DecidedStrictness -> Bool
<= :: DecidedStrictness -> DecidedStrictness -> Bool
$c> :: DecidedStrictness -> DecidedStrictness -> Bool
> :: DecidedStrictness -> DecidedStrictness -> Bool
$c>= :: DecidedStrictness -> DecidedStrictness -> Bool
>= :: DecidedStrictness -> DecidedStrictness -> Bool
$cmax :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness
max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness
$cmin :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness
min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness
Ord, Typeable DecidedStrictness
Typeable DecidedStrictness =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> DecidedStrictness
 -> c DecidedStrictness)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DecidedStrictness)
-> (DecidedStrictness -> Constr)
-> (DecidedStrictness -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DecidedStrictness))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c DecidedStrictness))
-> ((forall b. Data b => b -> b)
    -> DecidedStrictness -> DecidedStrictness)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> DecidedStrictness -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DecidedStrictness -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> DecidedStrictness -> m DecidedStrictness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DecidedStrictness -> m DecidedStrictness)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DecidedStrictness -> m DecidedStrictness)
-> Data DecidedStrictness
DecidedStrictness -> Constr
DecidedStrictness -> DataType
(forall b. Data b => b -> b)
-> DecidedStrictness -> DecidedStrictness
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> DecidedStrictness -> u
forall u. (forall d. Data d => d -> u) -> DecidedStrictness -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DecidedStrictness
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DecidedStrictness -> c DecidedStrictness
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DecidedStrictness)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DecidedStrictness)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DecidedStrictness -> c DecidedStrictness
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DecidedStrictness -> c DecidedStrictness
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DecidedStrictness
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DecidedStrictness
$ctoConstr :: DecidedStrictness -> Constr
toConstr :: DecidedStrictness -> Constr
$cdataTypeOf :: DecidedStrictness -> DataType
dataTypeOf :: DecidedStrictness -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DecidedStrictness)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DecidedStrictness)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DecidedStrictness)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c DecidedStrictness)
$cgmapT :: (forall b. Data b => b -> b)
-> DecidedStrictness -> DecidedStrictness
gmapT :: (forall b. Data b => b -> b)
-> DecidedStrictness -> DecidedStrictness
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DecidedStrictness -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DecidedStrictness -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DecidedStrictness -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> DecidedStrictness -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> DecidedStrictness -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DecidedStrictness -> m DecidedStrictness
Data, (forall x. DecidedStrictness -> Rep DecidedStrictness x)
-> (forall x. Rep DecidedStrictness x -> DecidedStrictness)
-> Generic DecidedStrictness
forall x. Rep DecidedStrictness x -> DecidedStrictness
forall x. DecidedStrictness -> Rep DecidedStrictness x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DecidedStrictness -> Rep DecidedStrictness x
from :: forall x. DecidedStrictness -> Rep DecidedStrictness x
$cto :: forall x. Rep DecidedStrictness x -> DecidedStrictness
to :: forall x. Rep DecidedStrictness x -> DecidedStrictness
Generic)

-- | A data constructor.
--
-- The constructors for 'Con' can roughly be divided up into two categories:
-- those for constructors with \"vanilla\" syntax ('NormalC', 'RecC', and
-- 'InfixC'), and those for constructors with GADT syntax ('GadtC' and
-- 'RecGadtC'). The 'ForallC' constructor, which quantifies additional type
-- variables and class contexts, can surround either variety of constructor.
-- However, the type variables that it quantifies are different depending
-- on what constructor syntax is used:
--
-- * If a 'ForallC' surrounds a constructor with vanilla syntax, then the
--   'ForallC' will only quantify /existential/ type variables. For example:
--
--   @
--   data Foo a = forall b. MkFoo a b
--   @
--
--   In @MkFoo@, 'ForallC' will quantify @b@, but not @a@.
--
-- * If a 'ForallC' surrounds a constructor with GADT syntax, then the
--   'ForallC' will quantify /all/ type variables used in the constructor.
--   For example:
--
--   @
--   data Bar a b where
--     MkBar :: (a ~ b) => c -> MkBar a b
--   @
--
--   In @MkBar@, 'ForallC' will quantify @a@, @b@, and @c@.
--
-- Multiplicity annotations for data types are currently not supported
-- in Template Haskell (i.e. all fields represented by Template Haskell
-- will be linear).
data Con =
  -- | @C Int a@
    NormalC Name [BangType]

  -- | @C { v :: Int, w :: a }@
  | RecC Name [VarBangType]

  -- | @Int :+ a@
  | InfixC BangType Name BangType

  -- | @forall a. Eq a => C [a]@
  | ForallC [TyVarBndr Specificity] Cxt Con

  -- @C :: a -> b -> T b Int@
  | GadtC [Name]
            -- ^ The list of constructors, corresponding to the GADT constructor
            -- syntax @C1, C2 :: a -> T b@.
            --
            -- Invariant: the list must be non-empty.
          [BangType] -- ^ The constructor arguments
          Type -- ^ See Note [GADT return type]

  -- | @C :: { v :: Int } -> T b Int@
  | RecGadtC [Name]
             -- ^ The list of constructors, corresponding to the GADT record
             -- constructor syntax @C1, C2 :: { fld :: a } -> T b@.
             --
             -- Invariant: the list must be non-empty.
             [VarBangType] -- ^ The constructor arguments
             Type -- ^ See Note [GADT return type]
        deriving (Int -> Con -> FilePath -> FilePath
[Con] -> FilePath -> FilePath
Con -> FilePath
(Int -> Con -> FilePath -> FilePath)
-> (Con -> FilePath) -> ([Con] -> FilePath -> FilePath) -> Show Con
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Con -> FilePath -> FilePath
showsPrec :: Int -> Con -> FilePath -> FilePath
$cshow :: Con -> FilePath
show :: Con -> FilePath
$cshowList :: [Con] -> FilePath -> FilePath
showList :: [Con] -> FilePath -> FilePath
Show, Con -> Con -> Bool
(Con -> Con -> Bool) -> (Con -> Con -> Bool) -> Eq Con
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Con -> Con -> Bool
== :: Con -> Con -> Bool
$c/= :: Con -> Con -> Bool
/= :: Con -> Con -> Bool
Eq, Eq Con
Eq Con =>
(Con -> Con -> Ordering)
-> (Con -> Con -> Bool)
-> (Con -> Con -> Bool)
-> (Con -> Con -> Bool)
-> (Con -> Con -> Bool)
-> (Con -> Con -> Con)
-> (Con -> Con -> Con)
-> Ord Con
Con -> Con -> Bool
Con -> Con -> Ordering
Con -> Con -> Con
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Con -> Con -> Ordering
compare :: Con -> Con -> Ordering
$c< :: Con -> Con -> Bool
< :: Con -> Con -> Bool
$c<= :: Con -> Con -> Bool
<= :: Con -> Con -> Bool
$c> :: Con -> Con -> Bool
> :: Con -> Con -> Bool
$c>= :: Con -> Con -> Bool
>= :: Con -> Con -> Bool
$cmax :: Con -> Con -> Con
max :: Con -> Con -> Con
$cmin :: Con -> Con -> Con
min :: Con -> Con -> Con
Ord, Typeable Con
Typeable Con =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Con -> c Con)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Con)
-> (Con -> Constr)
-> (Con -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Con))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Con))
-> ((forall b. Data b => b -> b) -> Con -> Con)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r)
-> (forall u. (forall d. Data d => d -> u) -> Con -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Con -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Con -> m Con)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Con -> m Con)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Con -> m Con)
-> Data Con
Con -> Constr
Con -> DataType
(forall b. Data b => b -> b) -> Con -> Con
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Con -> u
forall u. (forall d. Data d => d -> u) -> Con -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Con -> m Con
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Con -> m Con
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Con
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Con -> c Con
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Con)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Con)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Con -> c Con
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Con -> c Con
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Con
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Con
$ctoConstr :: Con -> Constr
toConstr :: Con -> Constr
$cdataTypeOf :: Con -> DataType
dataTypeOf :: Con -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Con)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Con)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Con)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Con)
$cgmapT :: (forall b. Data b => b -> b) -> Con -> Con
gmapT :: (forall b. Data b => b -> b) -> Con -> Con
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Con -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Con -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Con -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Con -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Con -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Con -> m Con
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Con -> m Con
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Con -> m Con
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Con -> m Con
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Con -> m Con
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Con -> m Con
Data, (forall x. Con -> Rep Con x)
-> (forall x. Rep Con x -> Con) -> Generic Con
forall x. Rep Con x -> Con
forall x. Con -> Rep Con x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Con -> Rep Con x
from :: forall x. Con -> Rep Con x
$cto :: forall x. Rep Con x -> Con
to :: forall x. Rep Con x -> Con
Generic)

-- Note [GADT return type]
-- ~~~~~~~~~~~~~~~~~~~~~~~
-- The return type of a GADT constructor does not necessarily match the name of
-- the data type:
--
-- type S = T
--
-- data T a where
--     MkT :: S Int
--
--
-- type S a = T
--
-- data T a where
--     MkT :: S Char Int
--
--
-- type Id a = a
-- type S a = T
--
-- data T a where
--     MkT :: Id (S Char Int)
--
--
-- That is why we allow the return type stored by a constructor to be an
-- arbitrary type. See also #11341

data Bang = Bang SourceUnpackedness SourceStrictness
         -- ^ @C { {\-\# UNPACK \#-\} !}a@
        deriving (Int -> Bang -> FilePath -> FilePath
[Bang] -> FilePath -> FilePath
Bang -> FilePath
(Int -> Bang -> FilePath -> FilePath)
-> (Bang -> FilePath)
-> ([Bang] -> FilePath -> FilePath)
-> Show Bang
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Bang -> FilePath -> FilePath
showsPrec :: Int -> Bang -> FilePath -> FilePath
$cshow :: Bang -> FilePath
show :: Bang -> FilePath
$cshowList :: [Bang] -> FilePath -> FilePath
showList :: [Bang] -> FilePath -> FilePath
Show, Bang -> Bang -> Bool
(Bang -> Bang -> Bool) -> (Bang -> Bang -> Bool) -> Eq Bang
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Bang -> Bang -> Bool
== :: Bang -> Bang -> Bool
$c/= :: Bang -> Bang -> Bool
/= :: Bang -> Bang -> Bool
Eq, Eq Bang
Eq Bang =>
(Bang -> Bang -> Ordering)
-> (Bang -> Bang -> Bool)
-> (Bang -> Bang -> Bool)
-> (Bang -> Bang -> Bool)
-> (Bang -> Bang -> Bool)
-> (Bang -> Bang -> Bang)
-> (Bang -> Bang -> Bang)
-> Ord Bang
Bang -> Bang -> Bool
Bang -> Bang -> Ordering
Bang -> Bang -> Bang
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Bang -> Bang -> Ordering
compare :: Bang -> Bang -> Ordering
$c< :: Bang -> Bang -> Bool
< :: Bang -> Bang -> Bool
$c<= :: Bang -> Bang -> Bool
<= :: Bang -> Bang -> Bool
$c> :: Bang -> Bang -> Bool
> :: Bang -> Bang -> Bool
$c>= :: Bang -> Bang -> Bool
>= :: Bang -> Bang -> Bool
$cmax :: Bang -> Bang -> Bang
max :: Bang -> Bang -> Bang
$cmin :: Bang -> Bang -> Bang
min :: Bang -> Bang -> Bang
Ord, Typeable Bang
Typeable Bang =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Bang -> c Bang)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Bang)
-> (Bang -> Constr)
-> (Bang -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Bang))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang))
-> ((forall b. Data b => b -> b) -> Bang -> Bang)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r)
-> (forall u. (forall d. Data d => d -> u) -> Bang -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Bang -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Bang -> m Bang)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bang -> m Bang)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Bang -> m Bang)
-> Data Bang
Bang -> Constr
Bang -> DataType
(forall b. Data b => b -> b) -> Bang -> Bang
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Bang -> u
forall u. (forall d. Data d => d -> u) -> Bang -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bang
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bang -> c Bang
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bang)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bang -> c Bang
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Bang -> c Bang
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bang
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Bang
$ctoConstr :: Bang -> Constr
toConstr :: Bang -> Constr
$cdataTypeOf :: Bang -> DataType
dataTypeOf :: Bang -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bang)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Bang)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bang)
$cgmapT :: (forall b. Data b => b -> b) -> Bang -> Bang
gmapT :: (forall b. Data b => b -> b) -> Bang -> Bang
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bang -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Bang -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Bang -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Bang -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Bang -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Bang -> m Bang
Data, (forall x. Bang -> Rep Bang x)
-> (forall x. Rep Bang x -> Bang) -> Generic Bang
forall x. Rep Bang x -> Bang
forall x. Bang -> Rep Bang x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Bang -> Rep Bang x
from :: forall x. Bang -> Rep Bang x
$cto :: forall x. Rep Bang x -> Bang
to :: forall x. Rep Bang x -> Bang
Generic)

type BangType    = (Bang, Type)
type VarBangType = (Name, Bang, Type)

-- | As of @template-haskell-2.11.0.0@, 'Strict' has been replaced by 'Bang'.
type Strict      = Bang

-- | As of @template-haskell-2.11.0.0@, 'StrictType' has been replaced by
-- 'BangType'.
type StrictType    = BangType

-- | As of @template-haskell-2.11.0.0@, 'VarStrictType' has been replaced by
-- 'VarBangType'.
type VarStrictType = VarBangType

-- | A pattern synonym's directionality.
data PatSynDir
  = Unidir             -- ^ @pattern P x {<-} p@
  | ImplBidir          -- ^ @pattern P x {=} p@
  | ExplBidir [Clause] -- ^ @pattern P x {<-} p where P x = e@
  deriving( Int -> PatSynDir -> FilePath -> FilePath
[PatSynDir] -> FilePath -> FilePath
PatSynDir -> FilePath
(Int -> PatSynDir -> FilePath -> FilePath)
-> (PatSynDir -> FilePath)
-> ([PatSynDir] -> FilePath -> FilePath)
-> Show PatSynDir
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> PatSynDir -> FilePath -> FilePath
showsPrec :: Int -> PatSynDir -> FilePath -> FilePath
$cshow :: PatSynDir -> FilePath
show :: PatSynDir -> FilePath
$cshowList :: [PatSynDir] -> FilePath -> FilePath
showList :: [PatSynDir] -> FilePath -> FilePath
Show, PatSynDir -> PatSynDir -> Bool
(PatSynDir -> PatSynDir -> Bool)
-> (PatSynDir -> PatSynDir -> Bool) -> Eq PatSynDir
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PatSynDir -> PatSynDir -> Bool
== :: PatSynDir -> PatSynDir -> Bool
$c/= :: PatSynDir -> PatSynDir -> Bool
/= :: PatSynDir -> PatSynDir -> Bool
Eq, Eq PatSynDir
Eq PatSynDir =>
(PatSynDir -> PatSynDir -> Ordering)
-> (PatSynDir -> PatSynDir -> Bool)
-> (PatSynDir -> PatSynDir -> Bool)
-> (PatSynDir -> PatSynDir -> Bool)
-> (PatSynDir -> PatSynDir -> Bool)
-> (PatSynDir -> PatSynDir -> PatSynDir)
-> (PatSynDir -> PatSynDir -> PatSynDir)
-> Ord PatSynDir
PatSynDir -> PatSynDir -> Bool
PatSynDir -> PatSynDir -> Ordering
PatSynDir -> PatSynDir -> PatSynDir
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PatSynDir -> PatSynDir -> Ordering
compare :: PatSynDir -> PatSynDir -> Ordering
$c< :: PatSynDir -> PatSynDir -> Bool
< :: PatSynDir -> PatSynDir -> Bool
$c<= :: PatSynDir -> PatSynDir -> Bool
<= :: PatSynDir -> PatSynDir -> Bool
$c> :: PatSynDir -> PatSynDir -> Bool
> :: PatSynDir -> PatSynDir -> Bool
$c>= :: PatSynDir -> PatSynDir -> Bool
>= :: PatSynDir -> PatSynDir -> Bool
$cmax :: PatSynDir -> PatSynDir -> PatSynDir
max :: PatSynDir -> PatSynDir -> PatSynDir
$cmin :: PatSynDir -> PatSynDir -> PatSynDir
min :: PatSynDir -> PatSynDir -> PatSynDir
Ord, Typeable PatSynDir
Typeable PatSynDir =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> PatSynDir -> c PatSynDir)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PatSynDir)
-> (PatSynDir -> Constr)
-> (PatSynDir -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PatSynDir))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynDir))
-> ((forall b. Data b => b -> b) -> PatSynDir -> PatSynDir)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PatSynDir -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PatSynDir -> r)
-> (forall u. (forall d. Data d => d -> u) -> PatSynDir -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PatSynDir -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir)
-> Data PatSynDir
PatSynDir -> Constr
PatSynDir -> DataType
(forall b. Data b => b -> b) -> PatSynDir -> PatSynDir
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PatSynDir -> u
forall u. (forall d. Data d => d -> u) -> PatSynDir -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynDir
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynDir -> c PatSynDir
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynDir)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynDir)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynDir -> c PatSynDir
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynDir -> c PatSynDir
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynDir
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynDir
$ctoConstr :: PatSynDir -> Constr
toConstr :: PatSynDir -> Constr
$cdataTypeOf :: PatSynDir -> DataType
dataTypeOf :: PatSynDir -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynDir)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynDir)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynDir)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynDir)
$cgmapT :: (forall b. Data b => b -> b) -> PatSynDir -> PatSynDir
gmapT :: (forall b. Data b => b -> b) -> PatSynDir -> PatSynDir
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynDir -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PatSynDir -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PatSynDir -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PatSynDir -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PatSynDir -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynDir -> m PatSynDir
Data, (forall x. PatSynDir -> Rep PatSynDir x)
-> (forall x. Rep PatSynDir x -> PatSynDir) -> Generic PatSynDir
forall x. Rep PatSynDir x -> PatSynDir
forall x. PatSynDir -> Rep PatSynDir x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PatSynDir -> Rep PatSynDir x
from :: forall x. PatSynDir -> Rep PatSynDir x
$cto :: forall x. Rep PatSynDir x -> PatSynDir
to :: forall x. Rep PatSynDir x -> PatSynDir
Generic )

-- | A pattern synonym's argument type.
data PatSynArgs
  = PrefixPatSyn [Name]        -- ^ @pattern P {x y z} = p@
  | InfixPatSyn Name Name      -- ^ @pattern {x P y} = p@
  | RecordPatSyn [Name]        -- ^ @pattern P { {x,y,z} } = p@
  deriving( Int -> PatSynArgs -> FilePath -> FilePath
[PatSynArgs] -> FilePath -> FilePath
PatSynArgs -> FilePath
(Int -> PatSynArgs -> FilePath -> FilePath)
-> (PatSynArgs -> FilePath)
-> ([PatSynArgs] -> FilePath -> FilePath)
-> Show PatSynArgs
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> PatSynArgs -> FilePath -> FilePath
showsPrec :: Int -> PatSynArgs -> FilePath -> FilePath
$cshow :: PatSynArgs -> FilePath
show :: PatSynArgs -> FilePath
$cshowList :: [PatSynArgs] -> FilePath -> FilePath
showList :: [PatSynArgs] -> FilePath -> FilePath
Show, PatSynArgs -> PatSynArgs -> Bool
(PatSynArgs -> PatSynArgs -> Bool)
-> (PatSynArgs -> PatSynArgs -> Bool) -> Eq PatSynArgs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PatSynArgs -> PatSynArgs -> Bool
== :: PatSynArgs -> PatSynArgs -> Bool
$c/= :: PatSynArgs -> PatSynArgs -> Bool
/= :: PatSynArgs -> PatSynArgs -> Bool
Eq, Eq PatSynArgs
Eq PatSynArgs =>
(PatSynArgs -> PatSynArgs -> Ordering)
-> (PatSynArgs -> PatSynArgs -> Bool)
-> (PatSynArgs -> PatSynArgs -> Bool)
-> (PatSynArgs -> PatSynArgs -> Bool)
-> (PatSynArgs -> PatSynArgs -> Bool)
-> (PatSynArgs -> PatSynArgs -> PatSynArgs)
-> (PatSynArgs -> PatSynArgs -> PatSynArgs)
-> Ord PatSynArgs
PatSynArgs -> PatSynArgs -> Bool
PatSynArgs -> PatSynArgs -> Ordering
PatSynArgs -> PatSynArgs -> PatSynArgs
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PatSynArgs -> PatSynArgs -> Ordering
compare :: PatSynArgs -> PatSynArgs -> Ordering
$c< :: PatSynArgs -> PatSynArgs -> Bool
< :: PatSynArgs -> PatSynArgs -> Bool
$c<= :: PatSynArgs -> PatSynArgs -> Bool
<= :: PatSynArgs -> PatSynArgs -> Bool
$c> :: PatSynArgs -> PatSynArgs -> Bool
> :: PatSynArgs -> PatSynArgs -> Bool
$c>= :: PatSynArgs -> PatSynArgs -> Bool
>= :: PatSynArgs -> PatSynArgs -> Bool
$cmax :: PatSynArgs -> PatSynArgs -> PatSynArgs
max :: PatSynArgs -> PatSynArgs -> PatSynArgs
$cmin :: PatSynArgs -> PatSynArgs -> PatSynArgs
min :: PatSynArgs -> PatSynArgs -> PatSynArgs
Ord, Typeable PatSynArgs
Typeable PatSynArgs =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> PatSynArgs -> c PatSynArgs)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PatSynArgs)
-> (PatSynArgs -> Constr)
-> (PatSynArgs -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PatSynArgs))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PatSynArgs))
-> ((forall b. Data b => b -> b) -> PatSynArgs -> PatSynArgs)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r)
-> (forall u. (forall d. Data d => d -> u) -> PatSynArgs -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PatSynArgs -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs)
-> Data PatSynArgs
PatSynArgs -> Constr
PatSynArgs -> DataType
(forall b. Data b => b -> b) -> PatSynArgs -> PatSynArgs
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PatSynArgs -> u
forall u. (forall d. Data d => d -> u) -> PatSynArgs -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynArgs
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynArgs -> c PatSynArgs
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynArgs)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynArgs)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynArgs -> c PatSynArgs
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PatSynArgs -> c PatSynArgs
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynArgs
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PatSynArgs
$ctoConstr :: PatSynArgs -> Constr
toConstr :: PatSynArgs -> Constr
$cdataTypeOf :: PatSynArgs -> DataType
dataTypeOf :: PatSynArgs -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynArgs)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PatSynArgs)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynArgs)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PatSynArgs)
$cgmapT :: (forall b. Data b => b -> b) -> PatSynArgs -> PatSynArgs
gmapT :: (forall b. Data b => b -> b) -> PatSynArgs -> PatSynArgs
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PatSynArgs -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PatSynArgs -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PatSynArgs -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PatSynArgs -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PatSynArgs -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PatSynArgs -> m PatSynArgs
Data, (forall x. PatSynArgs -> Rep PatSynArgs x)
-> (forall x. Rep PatSynArgs x -> PatSynArgs) -> Generic PatSynArgs
forall x. Rep PatSynArgs x -> PatSynArgs
forall x. PatSynArgs -> Rep PatSynArgs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PatSynArgs -> Rep PatSynArgs x
from :: forall x. PatSynArgs -> Rep PatSynArgs x
$cto :: forall x. Rep PatSynArgs x -> PatSynArgs
to :: forall x. Rep PatSynArgs x -> PatSynArgs
Generic )

data Type = ForallT [TyVarBndr Specificity] Cxt Type -- ^ @forall \<vars\>. \<ctxt\> => \<type\>@
          | ForallVisT [TyVarBndr ()] Type -- ^ @forall \<vars\> -> \<type\>@
          | AppT Type Type                 -- ^ @T a b@
          | AppKindT Type Kind             -- ^ @T \@k t@
          | SigT Type Kind                 -- ^ @t :: k@
          | VarT Name                      -- ^ @a@
          | ConT Name                      -- ^ @T@
          | PromotedT Name                 -- ^ @'T@
          | InfixT Type Name Type          -- ^ @T + T@
          | UInfixT Type Name Type         -- ^ @T + T@
                                           --
                                           -- See "Language.Haskell.TH.Syntax#infix"
          | PromotedInfixT Type Name Type  -- ^ @T :+: T@
          | PromotedUInfixT Type Name Type -- ^ @T :+: T@
                                           --
                                           -- See "Language.Haskell.TH.Syntax#infix"
          | ParensT Type                   -- ^ @(T)@

          -- See Note [Representing concrete syntax in types]
          | TupleT Int                     -- ^ @(,)@, @(,,)@, etc.
          | UnboxedTupleT Int              -- ^ @(\#,\#)@, @(\#,,\#)@, etc.
          | UnboxedSumT SumArity           -- ^ @(\#|\#)@, @(\#||\#)@, etc.
          | ArrowT                         -- ^ @->@
          | MulArrowT                      -- ^ @%n ->@
                                           --
                                           -- Generalised arrow type with multiplicity argument
          | EqualityT                      -- ^ @~@
          | ListT                          -- ^ @[]@
          | PromotedTupleT Int             -- ^ @'()@, @'(,)@, @'(,,)@, etc.
          | PromotedNilT                   -- ^ @'[]@
          | PromotedConsT                  -- ^ @'(:)@
          | StarT                          -- ^ @*@
          | ConstraintT                    -- ^ @Constraint@
          | LitT TyLit                     -- ^ @0@, @1@, @2@, etc.
          | WildCardT                      -- ^ @_@
          | ImplicitParamT String Type     -- ^ @?x :: t@
      deriving( Int -> Type -> FilePath -> FilePath
[Type] -> FilePath -> FilePath
Type -> FilePath
(Int -> Type -> FilePath -> FilePath)
-> (Type -> FilePath)
-> ([Type] -> FilePath -> FilePath)
-> Show Type
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Type -> FilePath -> FilePath
showsPrec :: Int -> Type -> FilePath -> FilePath
$cshow :: Type -> FilePath
show :: Type -> FilePath
$cshowList :: [Type] -> FilePath -> FilePath
showList :: [Type] -> FilePath -> FilePath
Show, Type -> Type -> Bool
(Type -> Type -> Bool) -> (Type -> Type -> Bool) -> Eq Type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Type -> Type -> Bool
== :: Type -> Type -> Bool
$c/= :: Type -> Type -> Bool
/= :: Type -> Type -> Bool
Eq, Eq Type
Eq Type =>
(Type -> Type -> Ordering)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Bool)
-> (Type -> Type -> Type)
-> (Type -> Type -> Type)
-> Ord Type
Type -> Type -> Bool
Type -> Type -> Ordering
Type -> Type -> Type
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Type -> Type -> Ordering
compare :: Type -> Type -> Ordering
$c< :: Type -> Type -> Bool
< :: Type -> Type -> Bool
$c<= :: Type -> Type -> Bool
<= :: Type -> Type -> Bool
$c> :: Type -> Type -> Bool
> :: Type -> Type -> Bool
$c>= :: Type -> Type -> Bool
>= :: Type -> Type -> Bool
$cmax :: Type -> Type -> Type
max :: Type -> Type -> Type
$cmin :: Type -> Type -> Type
min :: Type -> Type -> Type
Ord, Typeable Type
Typeable Type =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Type -> c Type)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Type)
-> (Type -> Constr)
-> (Type -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Type))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type))
-> ((forall b. Data b => b -> b) -> Type -> Type)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r)
-> (forall u. (forall d. Data d => d -> u) -> Type -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Type -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Type -> m Type)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Type -> m Type)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Type -> m Type)
-> Data Type
Type -> Constr
Type -> DataType
(forall b. Data b => b -> b) -> Type -> Type
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Type -> u
forall u. (forall d. Data d => d -> u) -> Type -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Type -> m Type
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Type -> m Type
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Type
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Type -> c Type
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Type)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Type -> c Type
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Type -> c Type
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Type
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Type
$ctoConstr :: Type -> Constr
toConstr :: Type -> Constr
$cdataTypeOf :: Type -> DataType
dataTypeOf :: Type -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Type)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Type)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type)
$cgmapT :: (forall b. Data b => b -> b) -> Type -> Type
gmapT :: (forall b. Data b => b -> b) -> Type -> Type
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Type -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Type -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Type -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Type -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Type -> m Type
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Type -> m Type
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Type -> m Type
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Type -> m Type
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Type -> m Type
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Type -> m Type
Data, (forall x. Type -> Rep Type x)
-> (forall x. Rep Type x -> Type) -> Generic Type
forall x. Rep Type x -> Type
forall x. Type -> Rep Type x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Type -> Rep Type x
from :: forall x. Type -> Rep Type x
$cto :: forall x. Rep Type x -> Type
to :: forall x. Rep Type x -> Type
Generic )

data Specificity = SpecifiedSpec          -- ^ @a@
                 | InferredSpec           -- ^ @{a}@
      deriving( Int -> Specificity -> FilePath -> FilePath
[Specificity] -> FilePath -> FilePath
Specificity -> FilePath
(Int -> Specificity -> FilePath -> FilePath)
-> (Specificity -> FilePath)
-> ([Specificity] -> FilePath -> FilePath)
-> Show Specificity
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Specificity -> FilePath -> FilePath
showsPrec :: Int -> Specificity -> FilePath -> FilePath
$cshow :: Specificity -> FilePath
show :: Specificity -> FilePath
$cshowList :: [Specificity] -> FilePath -> FilePath
showList :: [Specificity] -> FilePath -> FilePath
Show, Specificity -> Specificity -> Bool
(Specificity -> Specificity -> Bool)
-> (Specificity -> Specificity -> Bool) -> Eq Specificity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Specificity -> Specificity -> Bool
== :: Specificity -> Specificity -> Bool
$c/= :: Specificity -> Specificity -> Bool
/= :: Specificity -> Specificity -> Bool
Eq, Eq Specificity
Eq Specificity =>
(Specificity -> Specificity -> Ordering)
-> (Specificity -> Specificity -> Bool)
-> (Specificity -> Specificity -> Bool)
-> (Specificity -> Specificity -> Bool)
-> (Specificity -> Specificity -> Bool)
-> (Specificity -> Specificity -> Specificity)
-> (Specificity -> Specificity -> Specificity)
-> Ord Specificity
Specificity -> Specificity -> Bool
Specificity -> Specificity -> Ordering
Specificity -> Specificity -> Specificity
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Specificity -> Specificity -> Ordering
compare :: Specificity -> Specificity -> Ordering
$c< :: Specificity -> Specificity -> Bool
< :: Specificity -> Specificity -> Bool
$c<= :: Specificity -> Specificity -> Bool
<= :: Specificity -> Specificity -> Bool
$c> :: Specificity -> Specificity -> Bool
> :: Specificity -> Specificity -> Bool
$c>= :: Specificity -> Specificity -> Bool
>= :: Specificity -> Specificity -> Bool
$cmax :: Specificity -> Specificity -> Specificity
max :: Specificity -> Specificity -> Specificity
$cmin :: Specificity -> Specificity -> Specificity
min :: Specificity -> Specificity -> Specificity
Ord, Typeable Specificity
Typeable Specificity =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Specificity -> c Specificity)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Specificity)
-> (Specificity -> Constr)
-> (Specificity -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Specificity))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Specificity))
-> ((forall b. Data b => b -> b) -> Specificity -> Specificity)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Specificity -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Specificity -> r)
-> (forall u. (forall d. Data d => d -> u) -> Specificity -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Specificity -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Specificity -> m Specificity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Specificity -> m Specificity)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Specificity -> m Specificity)
-> Data Specificity
Specificity -> Constr
Specificity -> DataType
(forall b. Data b => b -> b) -> Specificity -> Specificity
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Specificity -> u
forall u. (forall d. Data d => d -> u) -> Specificity -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specificity
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specificity -> c Specificity
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specificity)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specificity)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specificity -> c Specificity
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specificity -> c Specificity
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specificity
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specificity
$ctoConstr :: Specificity -> Constr
toConstr :: Specificity -> Constr
$cdataTypeOf :: Specificity -> DataType
dataTypeOf :: Specificity -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specificity)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specificity)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specificity)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specificity)
$cgmapT :: (forall b. Data b => b -> b) -> Specificity -> Specificity
gmapT :: (forall b. Data b => b -> b) -> Specificity -> Specificity
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specificity -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Specificity -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Specificity -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Specificity -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Specificity -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specificity -> m Specificity
Data, (forall x. Specificity -> Rep Specificity x)
-> (forall x. Rep Specificity x -> Specificity)
-> Generic Specificity
forall x. Rep Specificity x -> Specificity
forall x. Specificity -> Rep Specificity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Specificity -> Rep Specificity x
from :: forall x. Specificity -> Rep Specificity x
$cto :: forall x. Rep Specificity x -> Specificity
to :: forall x. Rep Specificity x -> Specificity
Generic )

-- | The @flag@ type parameter is instantiated to one of the following types:
--
--   * 'Specificity' (examples: 'ForallC', 'ForallT')
--   * 'BndrVis' (examples: 'DataD', 'ClassD', etc.)
--   * '()', a catch-all type for other forms of binders, including 'ForallVisT', 'DataInstD', 'RuleP', and 'TyVarSig'
--
data TyVarBndr flag = PlainTV  Name flag      -- ^ @a@
                    | KindedTV Name flag Kind -- ^ @(a :: k)@
      deriving( Int -> TyVarBndr flag -> FilePath -> FilePath
[TyVarBndr flag] -> FilePath -> FilePath
TyVarBndr flag -> FilePath
(Int -> TyVarBndr flag -> FilePath -> FilePath)
-> (TyVarBndr flag -> FilePath)
-> ([TyVarBndr flag] -> FilePath -> FilePath)
-> Show (TyVarBndr flag)
forall flag.
Show flag =>
Int -> TyVarBndr flag -> FilePath -> FilePath
forall flag. Show flag => [TyVarBndr flag] -> FilePath -> FilePath
forall flag. Show flag => TyVarBndr flag -> FilePath
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: forall flag.
Show flag =>
Int -> TyVarBndr flag -> FilePath -> FilePath
showsPrec :: Int -> TyVarBndr flag -> FilePath -> FilePath
$cshow :: forall flag. Show flag => TyVarBndr flag -> FilePath
show :: TyVarBndr flag -> FilePath
$cshowList :: forall flag. Show flag => [TyVarBndr flag] -> FilePath -> FilePath
showList :: [TyVarBndr flag] -> FilePath -> FilePath
Show, TyVarBndr flag -> TyVarBndr flag -> Bool
(TyVarBndr flag -> TyVarBndr flag -> Bool)
-> (TyVarBndr flag -> TyVarBndr flag -> Bool)
-> Eq (TyVarBndr flag)
forall flag. Eq flag => TyVarBndr flag -> TyVarBndr flag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall flag. Eq flag => TyVarBndr flag -> TyVarBndr flag -> Bool
== :: TyVarBndr flag -> TyVarBndr flag -> Bool
$c/= :: forall flag. Eq flag => TyVarBndr flag -> TyVarBndr flag -> Bool
/= :: TyVarBndr flag -> TyVarBndr flag -> Bool
Eq, Eq (TyVarBndr flag)
Eq (TyVarBndr flag) =>
(TyVarBndr flag -> TyVarBndr flag -> Ordering)
-> (TyVarBndr flag -> TyVarBndr flag -> Bool)
-> (TyVarBndr flag -> TyVarBndr flag -> Bool)
-> (TyVarBndr flag -> TyVarBndr flag -> Bool)
-> (TyVarBndr flag -> TyVarBndr flag -> Bool)
-> (TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag)
-> (TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag)
-> Ord (TyVarBndr flag)
TyVarBndr flag -> TyVarBndr flag -> Bool
TyVarBndr flag -> TyVarBndr flag -> Ordering
TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall flag. Ord flag => Eq (TyVarBndr flag)
forall flag. Ord flag => TyVarBndr flag -> TyVarBndr flag -> Bool
forall flag.
Ord flag =>
TyVarBndr flag -> TyVarBndr flag -> Ordering
forall flag.
Ord flag =>
TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
$ccompare :: forall flag.
Ord flag =>
TyVarBndr flag -> TyVarBndr flag -> Ordering
compare :: TyVarBndr flag -> TyVarBndr flag -> Ordering
$c< :: forall flag. Ord flag => TyVarBndr flag -> TyVarBndr flag -> Bool
< :: TyVarBndr flag -> TyVarBndr flag -> Bool
$c<= :: forall flag. Ord flag => TyVarBndr flag -> TyVarBndr flag -> Bool
<= :: TyVarBndr flag -> TyVarBndr flag -> Bool
$c> :: forall flag. Ord flag => TyVarBndr flag -> TyVarBndr flag -> Bool
> :: TyVarBndr flag -> TyVarBndr flag -> Bool
$c>= :: forall flag. Ord flag => TyVarBndr flag -> TyVarBndr flag -> Bool
>= :: TyVarBndr flag -> TyVarBndr flag -> Bool
$cmax :: forall flag.
Ord flag =>
TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
max :: TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
$cmin :: forall flag.
Ord flag =>
TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
min :: TyVarBndr flag -> TyVarBndr flag -> TyVarBndr flag
Ord, Typeable (TyVarBndr flag)
Typeable (TyVarBndr flag) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> TyVarBndr flag -> c (TyVarBndr flag))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (TyVarBndr flag))
-> (TyVarBndr flag -> Constr)
-> (TyVarBndr flag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (TyVarBndr flag)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (TyVarBndr flag)))
-> ((forall b. Data b => b -> b)
    -> TyVarBndr flag -> TyVarBndr flag)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> TyVarBndr flag -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TyVarBndr flag -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> TyVarBndr flag -> m (TyVarBndr flag))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TyVarBndr flag -> m (TyVarBndr flag))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TyVarBndr flag -> m (TyVarBndr flag))
-> Data (TyVarBndr flag)
TyVarBndr flag -> Constr
TyVarBndr flag -> DataType
(forall b. Data b => b -> b) -> TyVarBndr flag -> TyVarBndr flag
forall flag. Data flag => Typeable (TyVarBndr flag)
forall flag. Data flag => TyVarBndr flag -> Constr
forall flag. Data flag => TyVarBndr flag -> DataType
forall flag.
Data flag =>
(forall b. Data b => b -> b) -> TyVarBndr flag -> TyVarBndr flag
forall flag u.
Data flag =>
Int -> (forall d. Data d => d -> u) -> TyVarBndr flag -> u
forall flag u.
Data flag =>
(forall d. Data d => d -> u) -> TyVarBndr flag -> [u]
forall flag r r'.
Data flag =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
forall flag r r'.
Data flag =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
forall flag (m :: * -> *).
(Data flag, Monad m) =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
forall flag (m :: * -> *).
(Data flag, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
forall flag (c :: * -> *).
Data flag =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TyVarBndr flag)
forall flag (c :: * -> *).
Data flag =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyVarBndr flag -> c (TyVarBndr flag)
forall flag (t :: * -> *) (c :: * -> *).
(Data flag, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TyVarBndr flag))
forall flag (t :: * -> * -> *) (c :: * -> *).
(Data flag, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TyVarBndr flag))
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> TyVarBndr flag -> u
forall u. (forall d. Data d => d -> u) -> TyVarBndr flag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TyVarBndr flag)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyVarBndr flag -> c (TyVarBndr flag)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (TyVarBndr flag))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TyVarBndr flag))
$cgfoldl :: forall flag (c :: * -> *).
Data flag =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyVarBndr flag -> c (TyVarBndr flag)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyVarBndr flag -> c (TyVarBndr flag)
$cgunfold :: forall flag (c :: * -> *).
Data flag =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TyVarBndr flag)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TyVarBndr flag)
$ctoConstr :: forall flag. Data flag => TyVarBndr flag -> Constr
toConstr :: TyVarBndr flag -> Constr
$cdataTypeOf :: forall flag. Data flag => TyVarBndr flag -> DataType
dataTypeOf :: TyVarBndr flag -> DataType
$cdataCast1 :: forall flag (t :: * -> *) (c :: * -> *).
(Data flag, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TyVarBndr flag))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (TyVarBndr flag))
$cdataCast2 :: forall flag (t :: * -> * -> *) (c :: * -> *).
(Data flag, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TyVarBndr flag))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TyVarBndr flag))
$cgmapT :: forall flag.
Data flag =>
(forall b. Data b => b -> b) -> TyVarBndr flag -> TyVarBndr flag
gmapT :: (forall b. Data b => b -> b) -> TyVarBndr flag -> TyVarBndr flag
$cgmapQl :: forall flag r r'.
Data flag =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
$cgmapQr :: forall flag r r'.
Data flag =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TyVarBndr flag -> r
$cgmapQ :: forall flag u.
Data flag =>
(forall d. Data d => d -> u) -> TyVarBndr flag -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TyVarBndr flag -> [u]
$cgmapQi :: forall flag u.
Data flag =>
Int -> (forall d. Data d => d -> u) -> TyVarBndr flag -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TyVarBndr flag -> u
$cgmapM :: forall flag (m :: * -> *).
(Data flag, Monad m) =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
$cgmapMp :: forall flag (m :: * -> *).
(Data flag, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
$cgmapMo :: forall flag (m :: * -> *).
(Data flag, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TyVarBndr flag -> m (TyVarBndr flag)
Data, (forall x. TyVarBndr flag -> Rep (TyVarBndr flag) x)
-> (forall x. Rep (TyVarBndr flag) x -> TyVarBndr flag)
-> Generic (TyVarBndr flag)
forall x. Rep (TyVarBndr flag) x -> TyVarBndr flag
forall x. TyVarBndr flag -> Rep (TyVarBndr flag) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall flag x. Rep (TyVarBndr flag) x -> TyVarBndr flag
forall flag x. TyVarBndr flag -> Rep (TyVarBndr flag) x
$cfrom :: forall flag x. TyVarBndr flag -> Rep (TyVarBndr flag) x
from :: forall x. TyVarBndr flag -> Rep (TyVarBndr flag) x
$cto :: forall flag x. Rep (TyVarBndr flag) x -> TyVarBndr flag
to :: forall x. Rep (TyVarBndr flag) x -> TyVarBndr flag
Generic, (forall a b. (a -> b) -> TyVarBndr a -> TyVarBndr b)
-> (forall a b. a -> TyVarBndr b -> TyVarBndr a)
-> Functor TyVarBndr
forall a b. a -> TyVarBndr b -> TyVarBndr a
forall a b. (a -> b) -> TyVarBndr a -> TyVarBndr b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> TyVarBndr a -> TyVarBndr b
fmap :: forall a b. (a -> b) -> TyVarBndr a -> TyVarBndr b
$c<$ :: forall a b. a -> TyVarBndr b -> TyVarBndr a
<$ :: forall a b. a -> TyVarBndr b -> TyVarBndr a
Functor, (forall m. Monoid m => TyVarBndr m -> m)
-> (forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m)
-> (forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m)
-> (forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b)
-> (forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b)
-> (forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b)
-> (forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b)
-> (forall a. (a -> a -> a) -> TyVarBndr a -> a)
-> (forall a. (a -> a -> a) -> TyVarBndr a -> a)
-> (forall a. TyVarBndr a -> [a])
-> (forall a. TyVarBndr a -> Bool)
-> (forall a. TyVarBndr a -> Int)
-> (forall a. Eq a => a -> TyVarBndr a -> Bool)
-> (forall a. Ord a => TyVarBndr a -> a)
-> (forall a. Ord a => TyVarBndr a -> a)
-> (forall a. Num a => TyVarBndr a -> a)
-> (forall a. Num a => TyVarBndr a -> a)
-> Foldable TyVarBndr
forall a. Eq a => a -> TyVarBndr a -> Bool
forall a. Num a => TyVarBndr a -> a
forall a. Ord a => TyVarBndr a -> a
forall m. Monoid m => TyVarBndr m -> m
forall a. TyVarBndr a -> Bool
forall a. TyVarBndr a -> Int
forall a. TyVarBndr a -> [a]
forall a. (a -> a -> a) -> TyVarBndr a -> a
forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m
forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b
forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => TyVarBndr m -> m
fold :: forall m. Monoid m => TyVarBndr m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> TyVarBndr a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b
foldr :: forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> TyVarBndr a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b
foldl :: forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> TyVarBndr a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> TyVarBndr a -> a
foldr1 :: forall a. (a -> a -> a) -> TyVarBndr a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> TyVarBndr a -> a
foldl1 :: forall a. (a -> a -> a) -> TyVarBndr a -> a
$ctoList :: forall a. TyVarBndr a -> [a]
toList :: forall a. TyVarBndr a -> [a]
$cnull :: forall a. TyVarBndr a -> Bool
null :: forall a. TyVarBndr a -> Bool
$clength :: forall a. TyVarBndr a -> Int
length :: forall a. TyVarBndr a -> Int
$celem :: forall a. Eq a => a -> TyVarBndr a -> Bool
elem :: forall a. Eq a => a -> TyVarBndr a -> Bool
$cmaximum :: forall a. Ord a => TyVarBndr a -> a
maximum :: forall a. Ord a => TyVarBndr a -> a
$cminimum :: forall a. Ord a => TyVarBndr a -> a
minimum :: forall a. Ord a => TyVarBndr a -> a
$csum :: forall a. Num a => TyVarBndr a -> a
sum :: forall a. Num a => TyVarBndr a -> a
$cproduct :: forall a. Num a => TyVarBndr a -> a
product :: forall a. Num a => TyVarBndr a -> a
Foldable, Functor TyVarBndr
Foldable TyVarBndr
(Functor TyVarBndr, Foldable TyVarBndr) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> TyVarBndr a -> f (TyVarBndr b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TyVarBndr (f a) -> f (TyVarBndr a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TyVarBndr a -> m (TyVarBndr b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TyVarBndr (m a) -> m (TyVarBndr a))
-> Traversable TyVarBndr
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
TyVarBndr (m a) -> m (TyVarBndr a)
forall (f :: * -> *) a.
Applicative f =>
TyVarBndr (f a) -> f (TyVarBndr a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TyVarBndr a -> m (TyVarBndr b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TyVarBndr a -> f (TyVarBndr b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TyVarBndr a -> f (TyVarBndr b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TyVarBndr a -> f (TyVarBndr b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
TyVarBndr (f a) -> f (TyVarBndr a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
TyVarBndr (f a) -> f (TyVarBndr a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TyVarBndr a -> m (TyVarBndr b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TyVarBndr a -> m (TyVarBndr b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
TyVarBndr (m a) -> m (TyVarBndr a)
sequence :: forall (m :: * -> *) a.
Monad m =>
TyVarBndr (m a) -> m (TyVarBndr a)
Traversable )

data BndrVis = BndrReq                    -- ^ @a@
             | BndrInvis                  -- ^ @\@a@
      deriving( Int -> BndrVis -> FilePath -> FilePath
[BndrVis] -> FilePath -> FilePath
BndrVis -> FilePath
(Int -> BndrVis -> FilePath -> FilePath)
-> (BndrVis -> FilePath)
-> ([BndrVis] -> FilePath -> FilePath)
-> Show BndrVis
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> BndrVis -> FilePath -> FilePath
showsPrec :: Int -> BndrVis -> FilePath -> FilePath
$cshow :: BndrVis -> FilePath
show :: BndrVis -> FilePath
$cshowList :: [BndrVis] -> FilePath -> FilePath
showList :: [BndrVis] -> FilePath -> FilePath
Show, BndrVis -> BndrVis -> Bool
(BndrVis -> BndrVis -> Bool)
-> (BndrVis -> BndrVis -> Bool) -> Eq BndrVis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BndrVis -> BndrVis -> Bool
== :: BndrVis -> BndrVis -> Bool
$c/= :: BndrVis -> BndrVis -> Bool
/= :: BndrVis -> BndrVis -> Bool
Eq, Eq BndrVis
Eq BndrVis =>
(BndrVis -> BndrVis -> Ordering)
-> (BndrVis -> BndrVis -> Bool)
-> (BndrVis -> BndrVis -> Bool)
-> (BndrVis -> BndrVis -> Bool)
-> (BndrVis -> BndrVis -> Bool)
-> (BndrVis -> BndrVis -> BndrVis)
-> (BndrVis -> BndrVis -> BndrVis)
-> Ord BndrVis
BndrVis -> BndrVis -> Bool
BndrVis -> BndrVis -> Ordering
BndrVis -> BndrVis -> BndrVis
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: BndrVis -> BndrVis -> Ordering
compare :: BndrVis -> BndrVis -> Ordering
$c< :: BndrVis -> BndrVis -> Bool
< :: BndrVis -> BndrVis -> Bool
$c<= :: BndrVis -> BndrVis -> Bool
<= :: BndrVis -> BndrVis -> Bool
$c> :: BndrVis -> BndrVis -> Bool
> :: BndrVis -> BndrVis -> Bool
$c>= :: BndrVis -> BndrVis -> Bool
>= :: BndrVis -> BndrVis -> Bool
$cmax :: BndrVis -> BndrVis -> BndrVis
max :: BndrVis -> BndrVis -> BndrVis
$cmin :: BndrVis -> BndrVis -> BndrVis
min :: BndrVis -> BndrVis -> BndrVis
Ord, Typeable BndrVis
Typeable BndrVis =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> BndrVis -> c BndrVis)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BndrVis)
-> (BndrVis -> Constr)
-> (BndrVis -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c BndrVis))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BndrVis))
-> ((forall b. Data b => b -> b) -> BndrVis -> BndrVis)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> BndrVis -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> BndrVis -> r)
-> (forall u. (forall d. Data d => d -> u) -> BndrVis -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> BndrVis -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> BndrVis -> m BndrVis)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BndrVis -> m BndrVis)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> BndrVis -> m BndrVis)
-> Data BndrVis
BndrVis -> Constr
BndrVis -> DataType
(forall b. Data b => b -> b) -> BndrVis -> BndrVis
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> BndrVis -> u
forall u. (forall d. Data d => d -> u) -> BndrVis -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BndrVis
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BndrVis -> c BndrVis
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BndrVis)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BndrVis)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BndrVis -> c BndrVis
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BndrVis -> c BndrVis
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BndrVis
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BndrVis
$ctoConstr :: BndrVis -> Constr
toConstr :: BndrVis -> Constr
$cdataTypeOf :: BndrVis -> DataType
dataTypeOf :: BndrVis -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BndrVis)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BndrVis)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BndrVis)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BndrVis)
$cgmapT :: (forall b. Data b => b -> b) -> BndrVis -> BndrVis
gmapT :: (forall b. Data b => b -> b) -> BndrVis -> BndrVis
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BndrVis -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> BndrVis -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> BndrVis -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BndrVis -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BndrVis -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BndrVis -> m BndrVis
Data, (forall x. BndrVis -> Rep BndrVis x)
-> (forall x. Rep BndrVis x -> BndrVis) -> Generic BndrVis
forall x. Rep BndrVis x -> BndrVis
forall x. BndrVis -> Rep BndrVis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BndrVis -> Rep BndrVis x
from :: forall x. BndrVis -> Rep BndrVis x
$cto :: forall x. Rep BndrVis x -> BndrVis
to :: forall x. Rep BndrVis x -> BndrVis
Generic )

-- | Type family result signature
data FamilyResultSig = NoSig              -- ^ no signature
                     | KindSig  Kind      -- ^ @k@
                     | TyVarSig (TyVarBndr ()) -- ^ @= r, = (r :: k)@
      deriving( Int -> FamilyResultSig -> FilePath -> FilePath
[FamilyResultSig] -> FilePath -> FilePath
FamilyResultSig -> FilePath
(Int -> FamilyResultSig -> FilePath -> FilePath)
-> (FamilyResultSig -> FilePath)
-> ([FamilyResultSig] -> FilePath -> FilePath)
-> Show FamilyResultSig
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> FamilyResultSig -> FilePath -> FilePath
showsPrec :: Int -> FamilyResultSig -> FilePath -> FilePath
$cshow :: FamilyResultSig -> FilePath
show :: FamilyResultSig -> FilePath
$cshowList :: [FamilyResultSig] -> FilePath -> FilePath
showList :: [FamilyResultSig] -> FilePath -> FilePath
Show, FamilyResultSig -> FamilyResultSig -> Bool
(FamilyResultSig -> FamilyResultSig -> Bool)
-> (FamilyResultSig -> FamilyResultSig -> Bool)
-> Eq FamilyResultSig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FamilyResultSig -> FamilyResultSig -> Bool
== :: FamilyResultSig -> FamilyResultSig -> Bool
$c/= :: FamilyResultSig -> FamilyResultSig -> Bool
/= :: FamilyResultSig -> FamilyResultSig -> Bool
Eq, Eq FamilyResultSig
Eq FamilyResultSig =>
(FamilyResultSig -> FamilyResultSig -> Ordering)
-> (FamilyResultSig -> FamilyResultSig -> Bool)
-> (FamilyResultSig -> FamilyResultSig -> Bool)
-> (FamilyResultSig -> FamilyResultSig -> Bool)
-> (FamilyResultSig -> FamilyResultSig -> Bool)
-> (FamilyResultSig -> FamilyResultSig -> FamilyResultSig)
-> (FamilyResultSig -> FamilyResultSig -> FamilyResultSig)
-> Ord FamilyResultSig
FamilyResultSig -> FamilyResultSig -> Bool
FamilyResultSig -> FamilyResultSig -> Ordering
FamilyResultSig -> FamilyResultSig -> FamilyResultSig
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FamilyResultSig -> FamilyResultSig -> Ordering
compare :: FamilyResultSig -> FamilyResultSig -> Ordering
$c< :: FamilyResultSig -> FamilyResultSig -> Bool
< :: FamilyResultSig -> FamilyResultSig -> Bool
$c<= :: FamilyResultSig -> FamilyResultSig -> Bool
<= :: FamilyResultSig -> FamilyResultSig -> Bool
$c> :: FamilyResultSig -> FamilyResultSig -> Bool
> :: FamilyResultSig -> FamilyResultSig -> Bool
$c>= :: FamilyResultSig -> FamilyResultSig -> Bool
>= :: FamilyResultSig -> FamilyResultSig -> Bool
$cmax :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig
max :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig
$cmin :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig
min :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig
Ord, Typeable FamilyResultSig
Typeable FamilyResultSig =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> FamilyResultSig -> c FamilyResultSig)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c FamilyResultSig)
-> (FamilyResultSig -> Constr)
-> (FamilyResultSig -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c FamilyResultSig))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c FamilyResultSig))
-> ((forall b. Data b => b -> b)
    -> FamilyResultSig -> FamilyResultSig)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> FamilyResultSig -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FamilyResultSig -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> FamilyResultSig -> m FamilyResultSig)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FamilyResultSig -> m FamilyResultSig)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FamilyResultSig -> m FamilyResultSig)
-> Data FamilyResultSig
FamilyResultSig -> Constr
FamilyResultSig -> DataType
(forall b. Data b => b -> b) -> FamilyResultSig -> FamilyResultSig
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> FamilyResultSig -> u
forall u. (forall d. Data d => d -> u) -> FamilyResultSig -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FamilyResultSig
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FamilyResultSig -> c FamilyResultSig
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FamilyResultSig)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FamilyResultSig)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FamilyResultSig -> c FamilyResultSig
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FamilyResultSig -> c FamilyResultSig
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FamilyResultSig
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FamilyResultSig
$ctoConstr :: FamilyResultSig -> Constr
toConstr :: FamilyResultSig -> Constr
$cdataTypeOf :: FamilyResultSig -> DataType
dataTypeOf :: FamilyResultSig -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FamilyResultSig)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FamilyResultSig)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FamilyResultSig)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FamilyResultSig)
$cgmapT :: (forall b. Data b => b -> b) -> FamilyResultSig -> FamilyResultSig
gmapT :: (forall b. Data b => b -> b) -> FamilyResultSig -> FamilyResultSig
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FamilyResultSig -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> FamilyResultSig -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> FamilyResultSig -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> FamilyResultSig -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> FamilyResultSig -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FamilyResultSig -> m FamilyResultSig
Data, (forall x. FamilyResultSig -> Rep FamilyResultSig x)
-> (forall x. Rep FamilyResultSig x -> FamilyResultSig)
-> Generic FamilyResultSig
forall x. Rep FamilyResultSig x -> FamilyResultSig
forall x. FamilyResultSig -> Rep FamilyResultSig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. FamilyResultSig -> Rep FamilyResultSig x
from :: forall x. FamilyResultSig -> Rep FamilyResultSig x
$cto :: forall x. Rep FamilyResultSig x -> FamilyResultSig
to :: forall x. Rep FamilyResultSig x -> FamilyResultSig
Generic )

-- | Injectivity annotation
data InjectivityAnn = InjectivityAnn Name [Name]
  deriving ( Int -> InjectivityAnn -> FilePath -> FilePath
[InjectivityAnn] -> FilePath -> FilePath
InjectivityAnn -> FilePath
(Int -> InjectivityAnn -> FilePath -> FilePath)
-> (InjectivityAnn -> FilePath)
-> ([InjectivityAnn] -> FilePath -> FilePath)
-> Show InjectivityAnn
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> InjectivityAnn -> FilePath -> FilePath
showsPrec :: Int -> InjectivityAnn -> FilePath -> FilePath
$cshow :: InjectivityAnn -> FilePath
show :: InjectivityAnn -> FilePath
$cshowList :: [InjectivityAnn] -> FilePath -> FilePath
showList :: [InjectivityAnn] -> FilePath -> FilePath
Show, InjectivityAnn -> InjectivityAnn -> Bool
(InjectivityAnn -> InjectivityAnn -> Bool)
-> (InjectivityAnn -> InjectivityAnn -> Bool) -> Eq InjectivityAnn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InjectivityAnn -> InjectivityAnn -> Bool
== :: InjectivityAnn -> InjectivityAnn -> Bool
$c/= :: InjectivityAnn -> InjectivityAnn -> Bool
/= :: InjectivityAnn -> InjectivityAnn -> Bool
Eq, Eq InjectivityAnn
Eq InjectivityAnn =>
(InjectivityAnn -> InjectivityAnn -> Ordering)
-> (InjectivityAnn -> InjectivityAnn -> Bool)
-> (InjectivityAnn -> InjectivityAnn -> Bool)
-> (InjectivityAnn -> InjectivityAnn -> Bool)
-> (InjectivityAnn -> InjectivityAnn -> Bool)
-> (InjectivityAnn -> InjectivityAnn -> InjectivityAnn)
-> (InjectivityAnn -> InjectivityAnn -> InjectivityAnn)
-> Ord InjectivityAnn
InjectivityAnn -> InjectivityAnn -> Bool
InjectivityAnn -> InjectivityAnn -> Ordering
InjectivityAnn -> InjectivityAnn -> InjectivityAnn
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: InjectivityAnn -> InjectivityAnn -> Ordering
compare :: InjectivityAnn -> InjectivityAnn -> Ordering
$c< :: InjectivityAnn -> InjectivityAnn -> Bool
< :: InjectivityAnn -> InjectivityAnn -> Bool
$c<= :: InjectivityAnn -> InjectivityAnn -> Bool
<= :: InjectivityAnn -> InjectivityAnn -> Bool
$c> :: InjectivityAnn -> InjectivityAnn -> Bool
> :: InjectivityAnn -> InjectivityAnn -> Bool
$c>= :: InjectivityAnn -> InjectivityAnn -> Bool
>= :: InjectivityAnn -> InjectivityAnn -> Bool
$cmax :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn
max :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn
$cmin :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn
min :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn
Ord, Typeable InjectivityAnn
Typeable InjectivityAnn =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> InjectivityAnn -> c InjectivityAnn)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c InjectivityAnn)
-> (InjectivityAnn -> Constr)
-> (InjectivityAnn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c InjectivityAnn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c InjectivityAnn))
-> ((forall b. Data b => b -> b)
    -> InjectivityAnn -> InjectivityAnn)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> InjectivityAnn -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> InjectivityAnn -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> InjectivityAnn -> m InjectivityAnn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> InjectivityAnn -> m InjectivityAnn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> InjectivityAnn -> m InjectivityAnn)
-> Data InjectivityAnn
InjectivityAnn -> Constr
InjectivityAnn -> DataType
(forall b. Data b => b -> b) -> InjectivityAnn -> InjectivityAnn
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> InjectivityAnn -> u
forall u. (forall d. Data d => d -> u) -> InjectivityAnn -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c InjectivityAnn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> InjectivityAnn -> c InjectivityAnn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c InjectivityAnn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c InjectivityAnn)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> InjectivityAnn -> c InjectivityAnn
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> InjectivityAnn -> c InjectivityAnn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c InjectivityAnn
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c InjectivityAnn
$ctoConstr :: InjectivityAnn -> Constr
toConstr :: InjectivityAnn -> Constr
$cdataTypeOf :: InjectivityAnn -> DataType
dataTypeOf :: InjectivityAnn -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c InjectivityAnn)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c InjectivityAnn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c InjectivityAnn)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c InjectivityAnn)
$cgmapT :: (forall b. Data b => b -> b) -> InjectivityAnn -> InjectivityAnn
gmapT :: (forall b. Data b => b -> b) -> InjectivityAnn -> InjectivityAnn
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> InjectivityAnn -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> InjectivityAnn -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> InjectivityAnn -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> InjectivityAnn -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> InjectivityAnn -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> InjectivityAnn -> m InjectivityAnn
Data, (forall x. InjectivityAnn -> Rep InjectivityAnn x)
-> (forall x. Rep InjectivityAnn x -> InjectivityAnn)
-> Generic InjectivityAnn
forall x. Rep InjectivityAnn x -> InjectivityAnn
forall x. InjectivityAnn -> Rep InjectivityAnn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InjectivityAnn -> Rep InjectivityAnn x
from :: forall x. InjectivityAnn -> Rep InjectivityAnn x
$cto :: forall x. Rep InjectivityAnn x -> InjectivityAnn
to :: forall x. Rep InjectivityAnn x -> InjectivityAnn
Generic )

data TyLit = NumTyLit Integer             -- ^ @2@
           | StrTyLit String              -- ^ @\"Hello\"@
           | CharTyLit Char               -- ^ @\'C\'@, @since 4.16.0.0
  deriving ( Int -> TyLit -> FilePath -> FilePath
[TyLit] -> FilePath -> FilePath
TyLit -> FilePath
(Int -> TyLit -> FilePath -> FilePath)
-> (TyLit -> FilePath)
-> ([TyLit] -> FilePath -> FilePath)
-> Show TyLit
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> TyLit -> FilePath -> FilePath
showsPrec :: Int -> TyLit -> FilePath -> FilePath
$cshow :: TyLit -> FilePath
show :: TyLit -> FilePath
$cshowList :: [TyLit] -> FilePath -> FilePath
showList :: [TyLit] -> FilePath -> FilePath
Show, TyLit -> TyLit -> Bool
(TyLit -> TyLit -> Bool) -> (TyLit -> TyLit -> Bool) -> Eq TyLit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TyLit -> TyLit -> Bool
== :: TyLit -> TyLit -> Bool
$c/= :: TyLit -> TyLit -> Bool
/= :: TyLit -> TyLit -> Bool
Eq, Eq TyLit
Eq TyLit =>
(TyLit -> TyLit -> Ordering)
-> (TyLit -> TyLit -> Bool)
-> (TyLit -> TyLit -> Bool)
-> (TyLit -> TyLit -> Bool)
-> (TyLit -> TyLit -> Bool)
-> (TyLit -> TyLit -> TyLit)
-> (TyLit -> TyLit -> TyLit)
-> Ord TyLit
TyLit -> TyLit -> Bool
TyLit -> TyLit -> Ordering
TyLit -> TyLit -> TyLit
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TyLit -> TyLit -> Ordering
compare :: TyLit -> TyLit -> Ordering
$c< :: TyLit -> TyLit -> Bool
< :: TyLit -> TyLit -> Bool
$c<= :: TyLit -> TyLit -> Bool
<= :: TyLit -> TyLit -> Bool
$c> :: TyLit -> TyLit -> Bool
> :: TyLit -> TyLit -> Bool
$c>= :: TyLit -> TyLit -> Bool
>= :: TyLit -> TyLit -> Bool
$cmax :: TyLit -> TyLit -> TyLit
max :: TyLit -> TyLit -> TyLit
$cmin :: TyLit -> TyLit -> TyLit
min :: TyLit -> TyLit -> TyLit
Ord, Typeable TyLit
Typeable TyLit =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> TyLit -> c TyLit)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TyLit)
-> (TyLit -> Constr)
-> (TyLit -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TyLit))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit))
-> ((forall b. Data b => b -> b) -> TyLit -> TyLit)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r)
-> (forall u. (forall d. Data d => d -> u) -> TyLit -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> TyLit -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TyLit -> m TyLit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TyLit -> m TyLit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TyLit -> m TyLit)
-> Data TyLit
TyLit -> Constr
TyLit -> DataType
(forall b. Data b => b -> b) -> TyLit -> TyLit
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> TyLit -> u
forall u. (forall d. Data d => d -> u) -> TyLit -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TyLit
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyLit -> c TyLit
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TyLit)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyLit -> c TyLit
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TyLit -> c TyLit
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TyLit
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TyLit
$ctoConstr :: TyLit -> Constr
toConstr :: TyLit -> Constr
$cdataTypeOf :: TyLit -> DataType
dataTypeOf :: TyLit -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TyLit)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TyLit)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit)
$cgmapT :: (forall b. Data b => b -> b) -> TyLit -> TyLit
gmapT :: (forall b. Data b => b -> b) -> TyLit -> TyLit
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TyLit -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TyLit -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TyLit -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TyLit -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TyLit -> m TyLit
Data, (forall x. TyLit -> Rep TyLit x)
-> (forall x. Rep TyLit x -> TyLit) -> Generic TyLit
forall x. Rep TyLit x -> TyLit
forall x. TyLit -> Rep TyLit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TyLit -> Rep TyLit x
from :: forall x. TyLit -> Rep TyLit x
$cto :: forall x. Rep TyLit x -> TyLit
to :: forall x. Rep TyLit x -> TyLit
Generic )

-- | Role annotations
data Role = NominalR            -- ^ @nominal@
          | RepresentationalR   -- ^ @representational@
          | PhantomR            -- ^ @phantom@
          | InferR              -- ^ @_@
  deriving( Int -> Role -> FilePath -> FilePath
[Role] -> FilePath -> FilePath
Role -> FilePath
(Int -> Role -> FilePath -> FilePath)
-> (Role -> FilePath)
-> ([Role] -> FilePath -> FilePath)
-> Show Role
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> Role -> FilePath -> FilePath
showsPrec :: Int -> Role -> FilePath -> FilePath
$cshow :: Role -> FilePath
show :: Role -> FilePath
$cshowList :: [Role] -> FilePath -> FilePath
showList :: [Role] -> FilePath -> FilePath
Show, Role -> Role -> Bool
(Role -> Role -> Bool) -> (Role -> Role -> Bool) -> Eq Role
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Role -> Role -> Bool
== :: Role -> Role -> Bool
$c/= :: Role -> Role -> Bool
/= :: Role -> Role -> Bool
Eq, Eq Role
Eq Role =>
(Role -> Role -> Ordering)
-> (Role -> Role -> Bool)
-> (Role -> Role -> Bool)
-> (Role -> Role -> Bool)
-> (Role -> Role -> Bool)
-> (Role -> Role -> Role)
-> (Role -> Role -> Role)
-> Ord Role
Role -> Role -> Bool
Role -> Role -> Ordering
Role -> Role -> Role
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Role -> Role -> Ordering
compare :: Role -> Role -> Ordering
$c< :: Role -> Role -> Bool
< :: Role -> Role -> Bool
$c<= :: Role -> Role -> Bool
<= :: Role -> Role -> Bool
$c> :: Role -> Role -> Bool
> :: Role -> Role -> Bool
$c>= :: Role -> Role -> Bool
>= :: Role -> Role -> Bool
$cmax :: Role -> Role -> Role
max :: Role -> Role -> Role
$cmin :: Role -> Role -> Role
min :: Role -> Role -> Role
Ord, Typeable Role
Typeable Role =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Role -> c Role)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Role)
-> (Role -> Constr)
-> (Role -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Role))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role))
-> ((forall b. Data b => b -> b) -> Role -> Role)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r)
-> (forall u. (forall d. Data d => d -> u) -> Role -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Role -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Role -> m Role)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Role -> m Role)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Role -> m Role)
-> Data Role
Role -> Constr
Role -> DataType
(forall b. Data b => b -> b) -> Role -> Role
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Role -> u
forall u. (forall d. Data d => d -> u) -> Role -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Role -> m Role
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Role -> m Role
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Role
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Role -> c Role
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Role)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Role -> c Role
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Role -> c Role
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Role
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Role
$ctoConstr :: Role -> Constr
toConstr :: Role -> Constr
$cdataTypeOf :: Role -> DataType
dataTypeOf :: Role -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Role)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Role)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role)
$cgmapT :: (forall b. Data b => b -> b) -> Role -> Role
gmapT :: (forall b. Data b => b -> b) -> Role -> Role
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Role -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Role -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Role -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Role -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Role -> m Role
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Role -> m Role
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Role -> m Role
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Role -> m Role
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Role -> m Role
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Role -> m Role
Data, (forall x. Role -> Rep Role x)
-> (forall x. Rep Role x -> Role) -> Generic Role
forall x. Rep Role x -> Role
forall x. Role -> Rep Role x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Role -> Rep Role x
from :: forall x. Role -> Rep Role x
$cto :: forall x. Rep Role x -> Role
to :: forall x. Rep Role x -> Role
Generic )

-- | Annotation target for reifyAnnotations
data AnnLookup = AnnLookupModule Module
               | AnnLookupName Name
               deriving( Int -> AnnLookup -> FilePath -> FilePath
[AnnLookup] -> FilePath -> FilePath
AnnLookup -> FilePath
(Int -> AnnLookup -> FilePath -> FilePath)
-> (AnnLookup -> FilePath)
-> ([AnnLookup] -> FilePath -> FilePath)
-> Show AnnLookup
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> AnnLookup -> FilePath -> FilePath
showsPrec :: Int -> AnnLookup -> FilePath -> FilePath
$cshow :: AnnLookup -> FilePath
show :: AnnLookup -> FilePath
$cshowList :: [AnnLookup] -> FilePath -> FilePath
showList :: [AnnLookup] -> FilePath -> FilePath
Show, AnnLookup -> AnnLookup -> Bool
(AnnLookup -> AnnLookup -> Bool)
-> (AnnLookup -> AnnLookup -> Bool) -> Eq AnnLookup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AnnLookup -> AnnLookup -> Bool
== :: AnnLookup -> AnnLookup -> Bool
$c/= :: AnnLookup -> AnnLookup -> Bool
/= :: AnnLookup -> AnnLookup -> Bool
Eq, Eq AnnLookup
Eq AnnLookup =>
(AnnLookup -> AnnLookup -> Ordering)
-> (AnnLookup -> AnnLookup -> Bool)
-> (AnnLookup -> AnnLookup -> Bool)
-> (AnnLookup -> AnnLookup -> Bool)
-> (AnnLookup -> AnnLookup -> Bool)
-> (AnnLookup -> AnnLookup -> AnnLookup)
-> (AnnLookup -> AnnLookup -> AnnLookup)
-> Ord AnnLookup
AnnLookup -> AnnLookup -> Bool
AnnLookup -> AnnLookup -> Ordering
AnnLookup -> AnnLookup -> AnnLookup
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AnnLookup -> AnnLookup -> Ordering
compare :: AnnLookup -> AnnLookup -> Ordering
$c< :: AnnLookup -> AnnLookup -> Bool
< :: AnnLookup -> AnnLookup -> Bool
$c<= :: AnnLookup -> AnnLookup -> Bool
<= :: AnnLookup -> AnnLookup -> Bool
$c> :: AnnLookup -> AnnLookup -> Bool
> :: AnnLookup -> AnnLookup -> Bool
$c>= :: AnnLookup -> AnnLookup -> Bool
>= :: AnnLookup -> AnnLookup -> Bool
$cmax :: AnnLookup -> AnnLookup -> AnnLookup
max :: AnnLookup -> AnnLookup -> AnnLookup
$cmin :: AnnLookup -> AnnLookup -> AnnLookup
min :: AnnLookup -> AnnLookup -> AnnLookup
Ord, Typeable AnnLookup
Typeable AnnLookup =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> AnnLookup -> c AnnLookup)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c AnnLookup)
-> (AnnLookup -> Constr)
-> (AnnLookup -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c AnnLookup))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnLookup))
-> ((forall b. Data b => b -> b) -> AnnLookup -> AnnLookup)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AnnLookup -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AnnLookup -> r)
-> (forall u. (forall d. Data d => d -> u) -> AnnLookup -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> AnnLookup -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup)
-> Data AnnLookup
AnnLookup -> Constr
AnnLookup -> DataType
(forall b. Data b => b -> b) -> AnnLookup -> AnnLookup
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> AnnLookup -> u
forall u. (forall d. Data d => d -> u) -> AnnLookup -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnLookup
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnLookup -> c AnnLookup
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnLookup)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnLookup)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnLookup -> c AnnLookup
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AnnLookup -> c AnnLookup
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnLookup
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c AnnLookup
$ctoConstr :: AnnLookup -> Constr
toConstr :: AnnLookup -> Constr
$cdataTypeOf :: AnnLookup -> DataType
dataTypeOf :: AnnLookup -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnLookup)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c AnnLookup)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnLookup)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnnLookup)
$cgmapT :: (forall b. Data b => b -> b) -> AnnLookup -> AnnLookup
gmapT :: (forall b. Data b => b -> b) -> AnnLookup -> AnnLookup
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AnnLookup -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> AnnLookup -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> AnnLookup -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnnLookup -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AnnLookup -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AnnLookup -> m AnnLookup
Data, (forall x. AnnLookup -> Rep AnnLookup x)
-> (forall x. Rep AnnLookup x -> AnnLookup) -> Generic AnnLookup
forall x. Rep AnnLookup x -> AnnLookup
forall x. AnnLookup -> Rep AnnLookup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AnnLookup -> Rep AnnLookup x
from :: forall x. AnnLookup -> Rep AnnLookup x
$cto :: forall x. Rep AnnLookup x -> AnnLookup
to :: forall x. Rep AnnLookup x -> AnnLookup
Generic )

-- | To avoid duplication between kinds and types, they
-- are defined to be the same. Naturally, you would never
-- have a type be 'StarT' and you would never have a kind
-- be 'SigT', but many of the other constructors are shared.
-- Note that the kind @Bool@ is denoted with 'ConT', not
-- 'PromotedT'. Similarly, tuple kinds are made with 'TupleT',
-- not 'PromotedTupleT'.

type Kind = Type

{- Note [Representing concrete syntax in types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Haskell has a rich concrete syntax for types, including
  t1 -> t2, (t1,t2), [t], and so on
In TH we represent all of this using AppT, with a distinguished
type constructor at the head.  So,
  Type              TH representation
  -----------------------------------------------
  t1 -> t2          ArrowT `AppT` t2 `AppT` t2
  [t]               ListT `AppT` t
  (t1,t2)           TupleT 2 `AppT` t1 `AppT` t2
  '(t1,t2)          PromotedTupleT 2 `AppT` t1 `AppT` t2

But if the original HsSyn used prefix application, we won't use
these special TH constructors.  For example
  [] t              ConT "[]" `AppT` t
  (->) t            ConT "->" `AppT` t
In this way we can faithfully represent in TH whether the original
HsType used concrete syntax or not.

The one case that doesn't fit this pattern is that of promoted lists
  '[ Maybe, IO ]    PromotedListT 2 `AppT` t1 `AppT` t2
but it's very smelly because there really is no type constructor
corresponding to PromotedListT. So we encode HsExplicitListTy with
PromotedConsT and PromotedNilT (which *do* have underlying type
constructors):
  '[ Maybe, IO ]    PromotedConsT `AppT` Maybe `AppT`
                    (PromotedConsT  `AppT` IO `AppT` PromotedNilT)
-}

-- | A location at which to attach Haddock documentation.
-- Note that adding documentation to a 'Name' defined oustide of the current
-- module will cause an error.
data DocLoc
  = ModuleDoc         -- ^ At the current module's header.
  | DeclDoc Name      -- ^ At a declaration, not necessarily top level.
  | ArgDoc Name Int   -- ^ At a specific argument of a function, indexed by its
                      -- position.
  | InstDoc Type      -- ^ At a class or family instance.
  deriving ( Int -> DocLoc -> FilePath -> FilePath
[DocLoc] -> FilePath -> FilePath
DocLoc -> FilePath
(Int -> DocLoc -> FilePath -> FilePath)
-> (DocLoc -> FilePath)
-> ([DocLoc] -> FilePath -> FilePath)
-> Show DocLoc
forall a.
(Int -> a -> FilePath -> FilePath)
-> (a -> FilePath) -> ([a] -> FilePath -> FilePath) -> Show a
$cshowsPrec :: Int -> DocLoc -> FilePath -> FilePath
showsPrec :: Int -> DocLoc -> FilePath -> FilePath
$cshow :: DocLoc -> FilePath
show :: DocLoc -> FilePath
$cshowList :: [DocLoc] -> FilePath -> FilePath
showList :: [DocLoc] -> FilePath -> FilePath
Show, DocLoc -> DocLoc -> Bool
(DocLoc -> DocLoc -> Bool)
-> (DocLoc -> DocLoc -> Bool) -> Eq DocLoc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DocLoc -> DocLoc -> Bool
== :: DocLoc -> DocLoc -> Bool
$c/= :: DocLoc -> DocLoc -> Bool
/= :: DocLoc -> DocLoc -> Bool
Eq, Eq DocLoc
Eq DocLoc =>
(DocLoc -> DocLoc -> Ordering)
-> (DocLoc -> DocLoc -> Bool)
-> (DocLoc -> DocLoc -> Bool)
-> (DocLoc -> DocLoc -> Bool)
-> (DocLoc -> DocLoc -> Bool)
-> (DocLoc -> DocLoc -> DocLoc)
-> (DocLoc -> DocLoc -> DocLoc)
-> Ord DocLoc
DocLoc -> DocLoc -> Bool
DocLoc -> DocLoc -> Ordering
DocLoc -> DocLoc -> DocLoc
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DocLoc -> DocLoc -> Ordering
compare :: DocLoc -> DocLoc -> Ordering
$c< :: DocLoc -> DocLoc -> Bool
< :: DocLoc -> DocLoc -> Bool
$c<= :: DocLoc -> DocLoc -> Bool
<= :: DocLoc -> DocLoc -> Bool
$c> :: DocLoc -> DocLoc -> Bool
> :: DocLoc -> DocLoc -> Bool
$c>= :: DocLoc -> DocLoc -> Bool
>= :: DocLoc -> DocLoc -> Bool
$cmax :: DocLoc -> DocLoc -> DocLoc
max :: DocLoc -> DocLoc -> DocLoc
$cmin :: DocLoc -> DocLoc -> DocLoc
min :: DocLoc -> DocLoc -> DocLoc
Ord, Typeable DocLoc
Typeable DocLoc =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> DocLoc -> c DocLoc)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DocLoc)
-> (DocLoc -> Constr)
-> (DocLoc -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DocLoc))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocLoc))
-> ((forall b. Data b => b -> b) -> DocLoc -> DocLoc)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DocLoc -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DocLoc -> r)
-> (forall u. (forall d. Data d => d -> u) -> DocLoc -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DocLoc -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DocLoc -> m DocLoc)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DocLoc -> m DocLoc)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DocLoc -> m DocLoc)
-> Data DocLoc
DocLoc -> Constr
DocLoc -> DataType
(forall b. Data b => b -> b) -> DocLoc -> DocLoc
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> DocLoc -> u
forall u. (forall d. Data d => d -> u) -> DocLoc -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocLoc
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocLoc -> c DocLoc
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocLoc)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocLoc)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocLoc -> c DocLoc
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DocLoc -> c DocLoc
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocLoc
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DocLoc
$ctoConstr :: DocLoc -> Constr
toConstr :: DocLoc -> Constr
$cdataTypeOf :: DocLoc -> DataType
dataTypeOf :: DocLoc -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocLoc)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DocLoc)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocLoc)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DocLoc)
$cgmapT :: (forall b. Data b => b -> b) -> DocLoc -> DocLoc
gmapT :: (forall b. Data b => b -> b) -> DocLoc -> DocLoc
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DocLoc -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DocLoc -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> DocLoc -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocLoc -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DocLoc -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DocLoc -> m DocLoc
Data, (forall x. DocLoc -> Rep DocLoc x)
-> (forall x. Rep DocLoc x -> DocLoc) -> Generic DocLoc
forall x. Rep DocLoc x -> DocLoc
forall x. DocLoc -> Rep DocLoc x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DocLoc -> Rep DocLoc x
from :: forall x. DocLoc -> Rep DocLoc x
$cto :: forall x. Rep DocLoc x -> DocLoc
to :: forall x. Rep DocLoc x -> DocLoc
Generic )

-----------------------------------------------------
--              Internal helper functions
-----------------------------------------------------

cmpEq :: Ordering -> Bool
cmpEq :: Ordering -> Bool
cmpEq Ordering
EQ = Bool
True
cmpEq Ordering
_  = Bool
False

thenCmp :: Ordering -> Ordering -> Ordering
thenCmp :: Ordering -> Ordering -> Ordering
thenCmp Ordering
EQ Ordering
o2 = Ordering
o2
thenCmp Ordering
o1 Ordering
_  = Ordering
o1

get_cons_names :: Con -> [Name]
get_cons_names :: Con -> [Name]
get_cons_names (NormalC Name
n [BangType]
_)     = [Name
n]
get_cons_names (RecC Name
n [VarBangType]
_)        = [Name
n]
get_cons_names (InfixC BangType
_ Name
n BangType
_)    = [Name
n]
get_cons_names (ForallC [TyVarBndr Specificity]
_ [Type]
_ Con
con) = Con -> [Name]
get_cons_names Con
con
-- GadtC can have multiple names, e.g
-- > data Bar a where
-- >   MkBar1, MkBar2 :: a -> Bar a
-- Will have one GadtC with [MkBar1, MkBar2] as names
get_cons_names (GadtC [Name]
ns [BangType]
_ Type
_)    = [Name]
ns
get_cons_names (RecGadtC [Name]
ns [VarBangType]
_ Type
_) = [Name]
ns