module UHC.Light.Compiler.EH.MainAG_TyVar where import Data.Char import Data.List as List import UHC.Util.Pretty import UHC.Light.Compiler.Base.Common import UHC.Light.Compiler.Base.TermLike import UHC.Light.Compiler.Base.HsName.Builtin import UHC.Light.Compiler.Opts import UHC.Light.Compiler.Gam.Full import UHC.Light.Compiler.Error import UHC.Light.Compiler.Error.Pretty import UHC.Light.Compiler.EH import UHC.Light.Compiler.Ty.Pretty import UHC.Light.Compiler.Ty.FitsInCommon import UHC.Light.Compiler.Ty.FitsIn import qualified UHC.Util.FastSeq as Seq import UHC.Util.Utils import UHC.Light.Compiler.Base.Trace import UHC.Light.Compiler.Base.UnderDev import UHC.Light.Compiler.VarMp import UHC.Light.Compiler.Substitutable import Data.Maybe import UHC.Light.Compiler.Ty.Utils1 import UHC.Light.Compiler.Ty.Trf.Quantify import UHC.Light.Compiler.Ty.Trf.Instantiate import UHC.Light.Compiler.Ty import UHC.Light.Compiler.Ty.FitsInCommon2 import UHC.Light.Compiler.Ty.FIEnv2 import qualified Data.Set as Set import qualified Data.Map as Map import Data.Set (Set) import Data.Map (Map) import UHC.Light.Compiler.Ty.Trf.FreshVar import UHC.Light.Compiler.Ty.Ftv import UHC.Util.Utils (groupSortOn) import Control.Applicative ((<|>)) import UHC.Light.Compiler.AbstractCore import UHC.Light.Compiler.AbstractCore.Utils import UHC.Light.Compiler.Core import UHC.Light.Compiler.Core.FFI import UHC.Light.Compiler.Core.Utils import UHC.Light.Compiler.Core.Pretty import UHC.Light.Compiler.Foreign.Extract import UHC.Light.Compiler.LamInfo import UHC.Light.Compiler.CodeGen.RefGenerator import qualified UHC.Light.Compiler.Core.SysF.AsTy as SysF import UHC.Light.Compiler.FinalEnv import UHC.Light.Compiler.Core.BindExtract import UHC.Light.Compiler.Core.Subst import Control.Monad.State import UHC.Light.Compiler.Ty.Utils2 import UHC.Light.Compiler.Base.Target import UHC.Light.Compiler.Core.Coercion import UHC.Light.Compiler.Ty.Trf.MergePreds import UHC.Light.Compiler.Ty.Trf.Canonic import UHC.Light.Compiler.Gam.ClGam import UHC.Light.Compiler.Pred import UHC.Light.Compiler.Pred.CtxtRedOnly.RedGraph (redPruneReductionsUntil) import UHC.Util.CHR import UHC.Light.Compiler.CHR.CtxtRedOnly.Constraint import UHC.Light.Compiler.CHR.CtxtRedOnly.Guard import UHC.Light.Compiler.Pred.CtxtRedOnly.ToCHR import UHC.Light.Compiler.Pred.CtxtRedOnly.Heuristics import UHC.Light.Compiler.Pred.CtxtRedOnly.Evidence import UHC.Light.Compiler.CHR.CtxtRedOnly.Solve import UHC.Light.Compiler.Pred.CtxtRedOnly.EvidenceToCore import UHC.Light.Compiler.Gam.ClassDefaultGam import UHC.Light.Compiler.Ty.Trf.BetaReduce (tyBetaRedFull) import UHC.Light.Compiler.Module.ImportExport import UHC.Light.Compiler.Ty.UsedNames import UHC.Light.Compiler.CodeGen.ImportUsedModules import UHC.Light.Compiler.CodeGen.ModuleImportExportImpl import UHC.Light.Compiler.CodeGen.BuiltinPrims import UHC.Light.Compiler.Foreign import UHC.Light.Compiler.Foreign import UHC.Light.Compiler.Foreign.Pretty import UHC.Light.Compiler.Deriving import UHC.Light.Compiler.Generics import UHC.Light.Compiler.VarMp.Utils import UHC.Light.Compiler.EH.MainAG_common -- TyVar ------------------------------------------------------- {- visit 0: synthesized attribute: range : Range visit 1: chained attribute: gUniq : UID visit 2: chained attribute: tyGam : TyGam visit 3: chained attribute: tyKiGam : TyKiGam synthesized attributes: gathTyVarPolGam : PolGam intlTyKiGam : TyKiGam ki : Ty polVarL : [Polarity] ty : Ty visit 4: inherited attributes: finKiVarMp : VarMp finTyKiGam : TyKiGam finTyVarMp : VarMp moduleNm : HsName opts : EHCOpts sysfEnv : ToSysfEnv tr : TraceOn -> [PP_Doc] -> TrPP tyKiGlobFreeTvarS : TyVarIdS tyTyGlobFreeTvarS : TyVarIdS tyTyTySigFreeTvarS : TyVarIdS valTyGlobFreeTvarS : TyVarIdS synthesized attributes: allErrSq : ErrSq errSq : ErrSq gathMentrelFilterMp : ModEntRelFilterMp nm : HsName pp : PP_Doc ppAST : PP_Doc trpp : TrPP alternatives: alternative Var: child hsrange : {Range} child nm : {HsName} visit 0: local range : {Range} visit 1: local _tup256 : _ visit 2: local lUniq : {UID} local _tup254 : _ intra _tup256 : _ visit 3: local lUniq_17_pol : {UID} local polVar : _ local lUniq_ki : {UID} local tgi_ : {TyGamInfo} local _tup255 : _ local tyKiGamNew : _ local tkgi_ : {TyKiGamInfo} local ki : {Ty} intra _tup256 : _ intra _tup254 : _ visit 4: local trppHere : _ -} sem_TyVar_Var :: Range -> HsName -> T_TyVar sem_TyVar_Var hsrange_ nm_ | hsrange_ `seq` (nm_ `seq` (True)) = (case (hsrange_) of { _range | _range `seq` (True) -> (case (_range) of { _lhsOrange | _lhsOrange `seq` (True) -> (case ((let sem_TyVar_Var_1 :: T_TyVar_1 sem_TyVar_Var_1 = (\ _lhsIgUniq -> _lhsIgUniq `seq` ((case (let __cont = _lhsIgUniq in seq __cont ( case nextUnique __cont of { (__cont, lUniq) -> case nextUnique __cont of { (__cont, lUniq_17_pol) -> case nextUnique __cont of { (__cont, lUniq_ki) -> (__cont,lUniq,lUniq_17_pol,lUniq_ki)}}} )) of { __tup256 | __tup256 `seq` (True) -> (case (__tup256) of { (_lhsOgUniq,_,_,_) | _lhsOgUniq `seq` (True) -> (case ((let sem_TyVar_Var_2 :: T_TyVar_2 sem_TyVar_Var_2 = (\ _lhsItyGam -> _lhsItyGam `seq` ((case (__tup256) of { (_,_lUniq,_,_) | _lUniq `seq` (True) -> (case (tyGamLookupOrAdd _lUniq nm_ (gamTop _lhsItyGam) _lhsItyGam) of { __tup254 | __tup254 `seq` (True) -> (case (__tup254) of { (_,_lhsOtyGam) | _lhsOtyGam `seq` (True) -> (case ((let sem_TyVar_Var_3 :: T_TyVar_3 sem_TyVar_Var_3 = (\ _lhsItyKiGam -> _lhsItyKiGam `seq` ((case (__tup256) of { (_,_,_lUniq_17_pol,_) | _lUniq_17_pol `seq` (True) -> (case (mkPolVar _lUniq_17_pol) of { _polVar | _polVar `seq` (True) -> (case (gamSingleton nm_ (mkPGI _polVar)) of { _lhsOgathTyVarPolGam | _lhsOgathTyVarPolGam `seq` (True) -> (case (__tup256) of { (_,_,_,_lUniq_ki) | _lUniq_ki `seq` (True) -> (case (__tup254) of { (_tgi_,_) | _tgi_ `seq` (True) -> (case (tyKiGamLookupOrAdd _lUniq_ki (tgiTy _tgi_) _lhsItyKiGam) of { __tup255 | __tup255 `seq` (True) -> (case (__tup255) of { (_,_,_tyKiGamNew) | _tyKiGamNew `seq` (True) -> (case (_tyKiGamNew) of { _lhsOintlTyKiGam | _lhsOintlTyKiGam `seq` (True) -> (case (__tup255) of { (_tkgi_,_,_) | _tkgi_ `seq` (True) -> (case (tkgiKi _tkgi_) of { _ki | _ki `seq` (True) -> (case (_ki) of { _lhsOki | _lhsOki `seq` (True) -> (case ([_polVar]) of { _lhsOpolVarL | _lhsOpolVarL `seq` (True) -> (case (tgiTy _tgi_) of { _lhsOty | _lhsOty `seq` (True) -> (case (__tup255) of { (_,_lhsOtyKiGam,_) | _lhsOtyKiGam `seq` (True) -> (case ((let sem_TyVar_Var_4 :: T_TyVar_4 sem_TyVar_Var_4 = (\ _lhsIfinKiVarMp _lhsIfinTyKiGam _lhsIfinTyVarMp _lhsImoduleNm _lhsIopts _lhsIsysfEnv _lhsItr _lhsItyKiGlobFreeTvarS _lhsItyTyGlobFreeTvarS _lhsItyTyTySigFreeTvarS _lhsIvalTyGlobFreeTvarS -> _lhsIfinKiVarMp `seq` (_lhsIfinTyKiGam `seq` (_lhsIfinTyVarMp `seq` (_lhsImoduleNm `seq` (_lhsIopts `seq` (_lhsIsysfEnv `seq` (_lhsItr `seq` (_lhsItyKiGlobFreeTvarS `seq` (_lhsItyTyGlobFreeTvarS `seq` (_lhsItyTyTySigFreeTvarS `seq` (_lhsIvalTyGlobFreeTvarS `seq` ((case (Seq.empty) of { _lhsOallErrSq | _lhsOallErrSq `seq` (True) -> (case (Seq.empty) of { _lhsOerrSq | _lhsOerrSq `seq` (True) -> (case (Map.empty) of { _lhsOgathMentrelFilterMp | _lhsOgathMentrelFilterMp `seq` (True) -> (case (nm_) of { _lhsOnm | _lhsOnm `seq` (True) -> (case (pp nm_) of { _lhsOpp | _lhsOpp `seq` (True) -> (case (trppEmpty) of { _trppHere | _trppHere `seq` (True) -> (case (ppNestTrPP ["TyVar","Var"] [ppTrNm nm_] [] _trppHere) of { _lhsOppAST | _lhsOppAST `seq` (True) -> (case (trppEmpty) of { _lhsOtrpp | _lhsOtrpp `seq` (True) -> ( _lhsOallErrSq,_lhsOerrSq,_lhsOgathMentrelFilterMp,_lhsOnm,_lhsOpp,_lhsOppAST,_lhsOtrpp) }) }) }) }) }) }) }) }))))))))))))) in sem_TyVar_Var_4)) of { ( sem_TyVar_4) | True -> ( _lhsOgathTyVarPolGam,_lhsOintlTyKiGam,_lhsOki,_lhsOpolVarL,_lhsOty,_lhsOtyKiGam,sem_TyVar_4) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }))) in sem_TyVar_Var_3)) of { ( sem_TyVar_3) | True -> ( _lhsOtyGam,sem_TyVar_3) }) }) }) }))) in sem_TyVar_Var_2)) of { ( sem_TyVar_2) | True -> ( _lhsOgUniq,sem_TyVar_2) }) }) }))) in sem_TyVar_Var_1)) of { ( sem_TyVar_1) | True -> ( _lhsOrange,sem_TyVar_1) }) }) })