{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE TypeFamilies #-}
module GHC.HsToCore.Errors.Types where
import GHC.Prelude
import GHC.Core (CoreRule, CoreExpr, RuleName)
import GHC.Core.DataCon
import GHC.Core.Type
import GHC.Driver.Session
import GHC.Hs
import GHC.HsToCore.Pmc.Solver.Types
import GHC.Types.Basic (Activation)
import GHC.Types.Error
import GHC.Types.ForeignCall
import GHC.Types.Id
import GHC.Types.Name (Name)
import qualified GHC.LanguageExtensions as LangExt
import GHC.Generics (Generic)
newtype MinBound = MinBound Integer
newtype MaxBound = MaxBound Integer
type MaxUncoveredPatterns = Int
type MaxPmCheckModels = Int
data DsMessage
= DsUnknownMessage UnknownDiagnostic
| DsEmptyEnumeration
| DsIdentitiesFound !Id
!Type
| DsOverflowedLiterals !Integer
!Name
!(Maybe (MinBound, MaxBound))
!NegLiteralExtEnabled
| DsRedundantBangPatterns !(HsMatchContext GhcRn) !SDoc
| DsOverlappingPatterns !(HsMatchContext GhcRn) !SDoc
| DsInaccessibleRhs !(HsMatchContext GhcRn) !SDoc
| DsMaxPmCheckModelsReached !MaxPmCheckModels
| DsNonExhaustivePatterns !(HsMatchContext GhcRn)
!ExhaustivityCheckType
!MaxUncoveredPatterns
[Id]
[Nabla]
| DsTopLevelBindsNotAllowed !BindsType !(HsBindLR GhcTc GhcTc)
| DsUselessSpecialiseForClassMethodSelector !Id
| DsUselessSpecialiseForNoInlineFunction !Id
| DsMultiplicityCoercionsNotSupported
| DsOrphanRule !CoreRule
| DsRuleLhsTooComplicated !CoreExpr !CoreExpr
| DsRuleIgnoredDueToConstructor !DataCon
| DsRuleBindersNotBound ![Var]
![Var]
!CoreExpr
!CoreExpr
| DsLazyPatCantBindVarsOfUnliftedType [Var]
| DsNotYetHandledByTH !ThRejectionReason
| DsAggregatedViewExpressions [[LHsExpr GhcTc]]
| DsUnbangedStrictPatterns !(HsBindLR GhcTc GhcTc)
| DsCannotMixPolyAndUnliftedBindings !(HsBindLR GhcTc GhcTc)
| DsWrongDoBind !(LHsExpr GhcTc) !Type
| DsUnusedDoBind !(LHsExpr GhcTc) !Type
| DsRecBindsNotAllowedForUnliftedTys ![LHsBindLR GhcTc GhcTc]
| DsRuleMightInlineFirst !RuleName !Var !Activation
| DsAnotherRuleMightFireFirst !RuleName
!RuleName
!Var
deriving (forall x. DsMessage -> Rep DsMessage x)
-> (forall x. Rep DsMessage x -> DsMessage) -> Generic DsMessage
forall x. Rep DsMessage x -> DsMessage
forall x. DsMessage -> Rep DsMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DsMessage -> Rep DsMessage x
from :: forall x. DsMessage -> Rep DsMessage x
$cto :: forall x. Rep DsMessage x -> DsMessage
to :: forall x. Rep DsMessage x -> DsMessage
Generic
newtype DsArgNum = DsArgNum Int
data ThRejectionReason
= ThAmbiguousRecordUpdates !(HsRecUpdField GhcRn)
| ThAbstractClosedTypeFamily !(LFamilyDecl GhcRn)
| ThForeignLabel !CLabelString
| ThForeignExport !(LForeignDecl GhcRn)
| ThMinimalPragmas
| ThSCCPragmas
| ThNoUserInline
| ThExoticFormOfType !(HsType GhcRn)
| ThAmbiguousRecordSelectors !(HsExpr GhcRn)
| ThMonadComprehensionSyntax !(HsExpr GhcRn)
| ThCostCentres !(HsExpr GhcRn)
| ThExpressionForm !(HsExpr GhcRn)
| ThExoticStatement [Stmt GhcRn (LHsExpr GhcRn)]
| ThExoticLiteral !(HsLit GhcRn)
| ThExoticPattern !(Pat GhcRn)
| ThGuardedLambdas !(Match GhcRn (LHsExpr GhcRn))
| ThNegativeOverloadedPatterns !(Pat GhcRn)
| ThHaddockDocumentation
| ThWarningAndDeprecationPragmas [LIdP GhcRn]
| ThSplicesWithinDeclBrackets
| ThNonLinearDataCon
data NegLiteralExtEnabled
= YesUsingNegLiterals
| NotUsingNegLiterals
negLiteralExtEnabled :: DynFlags -> NegLiteralExtEnabled
negLiteralExtEnabled :: DynFlags -> NegLiteralExtEnabled
negLiteralExtEnabled DynFlags
dflags =
if (Extension -> DynFlags -> Bool
xopt Extension
LangExt.NegativeLiterals DynFlags
dflags) then NegLiteralExtEnabled
YesUsingNegLiterals else NegLiteralExtEnabled
NotUsingNegLiterals
newtype ExhaustivityCheckType = ExhaustivityCheckType (Maybe WarningFlag)
data BindsType
= UnliftedTypeBinds
| StrictBinds