h$+j,     None#$'(./5> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None#$'(./5>None#$'(./5> 7 typeletLHS should always be a variabletypeletThe LHS should be a skolem variableAs for as ghc is concerned, the LHS should be an opaque type variable with unknown value (only the plugin knows); certainly, ghc should not try to unify it with anything.typeletParse successfultypeletDifferent constraint than we're looking for (does not imply an error)typeletConstraint of the shape we're looking for, but something is wrongtypelet>Apply parser to each value in turn, bailing at the first errortypelet Variation on  which rules out the error casetypelet/Bundle the parse result with the original valuetypeletParse Equal constraints Kind-correct Equal? constraints of any form are ok, so this cannot return errors.typeletEvidence for an Equal constraintTODO: should we worry about producing an evidence term that prevents floating stuff out of scope...? (the whole "coercions cannot simply be zapped" thing) See also  typeletCycle in a graphtypelet!Construct idempotent substitutionTODO: Not entirely sure if this is correct, might be too simplistic and/or an abuse of the ghc API; it is a whole lot simpler than  niFixTCvSubst, which is disconcerning. However, it seems to work for the examples so far; perhaps our use case is simpler? Needs more thought.typeletFormat a cycle We (arbitrarily) pick the first - in the cycle for the location of the error.None#$'(./5> None#$'(./5> typeletUsed together with  - to pair a type-level let binding with a castSee   for details.typelet is used along with  & to introduce type-level let bindings.See   for more information.typelet-(Nominal) type equality, up to type-level letThis is a class without any definitions; 'Equal a b' is instead proved by the plugin. Suppose we have a bunch of type-level let constraints in scope Let x1 t1 Let x2 t2 ...Then if  is the corresponding idempotent substitution, two types a and b are considered  if (a) and (b) are nominally equal.typelet Type-level let A constraint Let x t where x' is an (existential) type variable and t; is an arbitrary type represents a type-level let binding  let x = t.o Introduction form3Type-level let bindings should be introduced using  ) or its slightly higher level cousin,  .o Elimination form!To eliminate type-level let, use  . typeletType-safe cast, using  as the notion of equalitySee comments for . typelet2Primitive way to introduce type-level let binding.Usage: .case letT (Proxy @t) of LetT (_ :: Proxy x) ->)This introduces a type-level let binding x = t. typelet CPS form of  *While this is more convenient to use, the r, parameter itself requires careful thought. typelet)Pair a type-level let binding with a cast)Often when we introduce a type-level let x = t", we then want to cast some term e :: t to a term e :: x ; function  ) does these two things in one operation.>If we did the above as written, however, we would have a term e :: x where we know nothing about x at all (unless we cast again). This is typically not useful; instead, we go from a term e :: f t to a term e :: f x, let-binding the type index t but not the functor f. typelet CPS form of  See also comments for  .typelet Reflexivity A constraint Let x t, where x/ is an existential (skolem) type variable and t+ is an arbitrary type, models a type-level  let x = t'. There is only a single instance for Let*: reflexivity (a type is equal to itself).&User code normally does not work with Let< directly, but instead uses one of the introduction forms (  and   ) which take care to introduce Let& constraints of the right shape. When Let constraints are introduced manually, the plugin will report a type error if0The left-hand side is not a skolem type variable,The set of let-bindings in scope are cyclic.     None#$'(./5>           !"!#!$!%!&!'!(!)!*!+!,!-!.!/!0!1!2!3!4!5!678797:7;7<7=7>7?7@7A7B7C7D7E7F7G7H7I7J7K7L7M7N7O7P7Q7R7S7T7U7V7W7X7Y7Z7[7\7]7^7_7`7a7b7c7d7e7f7g7h7i7j7k7l7m7n7o7p7q7r7s7t7u7v7w7xyz{|{}{~{{{{{{{{&typelet-0.1.0.0-LxHsFxv27sO1pxkQR2z84PTypeLet.UserAPITypeLet.PluginTypeLet.Plugin.GhcTcPluginAPITypeLet.Plugin.NameResolutionTypeLet.Plugin.ConstraintsTypeLet.Plugin.SubstitutionTypeLetbase Data.ProxyProxypluginLetAsLetTEqualLet castEqualletTletT'letAsletAs'$fLetkaa Debug.TracetraceghcTcMTypewriteMetaTyVarisFilledMetaTyVar_maybe TcRnMonadnewName TcRnTypesTcGblEnv TcTyThing ConstraintbumpCtLocDepthctEvExprctEqRel ctFlavourctPredctOriginctLoc ctEvidencemkNonCanonicalCtQCInstTcEvDest EvVarDestHoleDest CtEvidence ctev_destctev_loc ctev_pred ctev_evar CtFlavourCtLocMkCoremkAbsentErrorAppaBSENT_ERROR_IDaBSENT_SUM_FIELD_ERROR_ID tYPE_ERROR_IDnON_EXHAUSTIVE_GUARDS_ERROR_IDnO_METHOD_BINDING_ERROR_ID pAT_ERROR_IDrEC_CON_ERROR_IDrUNTIME_ERROR_IDrEC_SEL_ERROR_IDerrorIdsmkImpossibleExprmkRuntimeErrorApp mkJustExpr mkNothingExpr mkBuildExpr mkFoldrExpr mkListExpr mkConsExpr mkNilExpr floatBindings wrapFloats wrapFloatmkSmallTupleCase mkTupleCasemkSmallTupleSelectormkTupleSelector1mkTupleSelectorunitExprmkBigCoreTupTy mkBigCoreTupmkBigCoreVarTupTymkBigCoreVarTup1mkBigCoreVarTupmkCoreTupBoxity mkCoreUbxTup mkCoreTupmkCoreVarTupTymkStringExprFSWithmkStringExprFS mkStringExpr mkCharExpr mkDoubleExpr mkFloatExpr mkNaturalExpr mkIntegerExprmkWordExprWord mkWordExpr mkIntExprInt mkIntExprcastBottomExpr mkIfThenElse mkWildCasemkWildValBindermkWildEvBinder mkCoreApp mkCoreApps mkCoreConApps mkCoreLets mkCoreLams mkCoreLet sortQuantVars FloatBindFloatLet FloatCase CoreUtilsmkSingleAltCaseHscTypes FindResultNotFound FoundMultipleFound NoPackagefr_suggestions fr_unusablesfr_pkgs_hiddenfr_mods_hiddenfr_pathsfr_pkgTcOriginCtOrigin TcEvidence evDataConAppevCast evCoercion lookupEvBind EvBindsVarEvBindeb_lhseb_rhsEvTermEvExprInstEnvInstEnvsTcLclEnvTcType isMetaTyVar isSkolemTyVarMetaInfoTcLevel FamInstEnv TysWiredInpromotedNilDataConpromotedConsDataConpromotedGTDataConpromotedEQDataConpromotedLTDataConpromotedJustDataConpromotedNothingDataConpromotedFalseDataConpromotedTrueDataConmkSumTy mkTupleTy1 mkTupleTy justDataConnothingDataCon maybeTyCon consDataCon nilDataConmkListTyordGTDataConIdordEQDataConIdordLTDataConId ordGTDataCon ordEQDataCon ordLTDataCon orderingTyCon trueDataConIdfalseDataConId trueDataCon falseDataCon boolTyConboolTy doubleDataCon doubleTyCondoubleTy floatDataCon floatTyConfloatTy word8DataCon word8TyConword8Ty wordDataCon wordTyConwordTy intDataConintTyConintTystringTy charDataCon charTyConcharTyboxingDataCon_maybe liftedRepTyliftedRepDataConsumRepDataConTyConliftedTypeKindTyConcoercibleDataConcoercibleClass heqDataConheqClass eqDataConeqClasseqTyConunboxedSumKind sumDataConsumTyConunboxedUnitDataConunboxedUnitTyCon pairTyCon unitDataConId unitDataCon unitTyConKey unitTyContupleDataConName tupleDataConpromotedTupleDataCon tupleTyConcTupleDataConNamescTupleDataConNamecTupleTyConNameArity_maybeisCTupleTyConNamecTupleTyConNamescTupleTyConName mkTupleStrisBuiltInOcc_maybetypeToTypeKindconstraintKindTyContypeSymbolKindContypeNatKindConconsDataCon_RDR listTyCon_RDRintDataCon_RDR charTyCon_RDR intTyCon_RDRtrue_RDR false_RDR boolTyCon_RDRliftedTypeKindTyConNameconstraintKindTyConNamemakeRecoveryTyConanyTyanyTyCondoubleTyConNamefloatTyConNameword8TyConName wordTyConNamejustDataConNamenothingDataConNamemaybeTyConNameconsDataConNamenilDataConName listTyConName boolTyConName intTyConName charTyConNamecoercibleTyConName heqTyConName eqTyCon_RDR eqTyConNamemkWiredInIdNamemkWiredInTyConName wiredInTyConsId mkLocalIdCoreSynExprVarCoercionTypeCoreBndrDataConpromoteDataCon classDataCon Predicate mkClassPredclassifyPredTypePred ForAllPred IrredPred ClassPredEqPredEqRelNomEqReprEqmkPrimEqPredRoleisCoercionTy_maybe mkCoercionTy mkTyConAppmkAppTysgetTyVar_maybe isTyVarTy TyCoSubstsubstTy substTyWith zipTvSubstTCvSubstTyCoFVstyCoVarsOfTypeTyCoRep mkTyConTymkPiTysmkPiTy mkForAllTys mkTyVarTys mkTyVarTy CoercionHole ch_co_varch_ref isCoercionTymkAppTyeqTypesplitTyConApp_maybeTyConisLiftedTypeKindTyConNameVarSet elemVarSetClass classTyConFunDepmkReflComkUnivComkSymCo mkTransCoCoAxiomRolePhantomNominalRepresentationalmkTyVarCoVarTyVarTcTyVarEvVar PrelNames nilDataConKey listTyConKey listTyContypeSymbolKind typeNatKindmkBoxedTupleTyheqTyConcoercibleTyConunitTyliftedTypeKindconstraintKind vecElemTyCon vecCountTyConruntimeRepTyCon runtimeRepTytupleRepDataConTyConvecRepDataConTyConliftedRepDataConTyCondoubleRepDataConTyfloatRepDataConTyaddrRepDataConTyword64RepDataConTyword32RepDataConTyword16RepDataConTyword8RepDataConTywordRepDataConTyint64RepDataConTyint32RepDataConTyint16RepDataConTyint8RepDataConTyintRepDataConTyunliftedRepDataConTyliftedRepDataConTyvec64DataConTyvec32DataConTyvec16DataConTy vec8DataConTy vec4DataConTy vec2DataConTydoubleElemRepDataConTyfloatElemRepDataConTyword64ElemRepDataConTyword32ElemRepDataConTyword16ElemRepDataConTyword8ElemRepDataConTyint64ElemRepDataConTyint32ElemRepDataConTyint16ElemRepDataConTyint8ElemRepDataConTy anyTypeOfKindunboxedTupleKindmkPromotedListTytupleTyConName mkForAllTyTyThingUnivCoProvenancePredTypeKindOccNamemkClsOccmkTcOcc mkTyVarOcc mkDataOccmkVarOccModule mkModuleNameUniqDFMelemUDFMlookupUDFM_Directly lookupUDFMUniqFM listToUFMemptyUFMUniqueSrcLocgetLocunLoc GenLocatedLLocated RealLocated MetaDetails OutputablepprDebugAndThenassertPprPanic pprSTracepprTraceException pprTraceIt pprTraceWith pprTraceMpprTrace pprTraceDebug pprPgmErrorpprSorrypprPanic callStackDocdoOrDoesisOrArepluralspeakNOfspeakNspeakNth intWithCommasquotedListWithNorquotedListWithOr pprQuotedList interpp'SP interppSP pprWithBars pprWithCommaspprFilePathStringpprFastFilePath pprInfixVar pprPrefixVar pprPrimWord64 pprPrimInt64 pprPrimWord pprPrimInt pprPrimCharprimWord64SuffixprimInt64SuffixprimWordSuffixprimDoubleSuffix primIntSuffixprimFloatSuffixprimCharSuffix pprHsBytes pprHsString pprHsCharkeywordcolouredppUnlessppWhen punctuate hangNotEmptyhangfcatfsepcatsepvcathsephcat$+$$$<+><>nest unicodeSyntaxbulletkindType forAllLitrbracelbracerbracklbrackrparenlparenvbardot underscorespaceequalscoloncommasemilarrowttarrowttlarrowtarrowtdarrowlarrowarrowdcolon blankLinequotescparen angleBrackets doubleQuotesquotebracketsbracesparens doublePrecwordrationaldoublefloatintegerintztextptextftextcharempty docToSDocisEmptyshowSDocDumpOneLineshowSDocOneLinerenderWithStyle showSDocDebug showSDocDumpshowSDocForUsershowSDocUnqualshowPprshowSDoc mkCodeStylepprCodebufLeftRenderSDoc printForCprintForUserPartWay printForUser printSDocLn printSDoc whenPprDebug ifPprDebug getPprDebug userStyle debugStyle dumpStyleasmStyle codeStyle queryQual qualPackage qualModulequalNameupdSDocDynFlagssdocWithPlatformsdocWithDynFlags getPprStyle pprSetDepth pprDeeperList pprDeeperwithPprStyleDoc withPprStyleinitSDocContextsetStyleColoured mkUserStylecmdlineParserStyle mkErrStyledefaultErrStyle mkDumpStyledefaultDumpStyledefaultUserStyle neverQualify alwaysQualifyreallyAlwaysQualifyneverQualifyPackagesalwaysQualifyPackagesneverQualifyModulesalwaysQualifyModulesneverQualifyNamesalwaysQualifyNamesreallyAlwaysQualifyNamesPprStyle CodeStyleCStyleAsmStyleDepth AllTheWayPartWayPrintUnqualified QueryQualifyqueryQualifyPackagequeryQualifyNamequeryQualifyModuleQueryQualifyNameQueryQualifyModuleQueryQualifyPackage QualifyNameNameNotInScope2NameNotInScope1 NameUnqualNameQualpprpprPrec BindingSiteLetBind CasePatBind LambdaBindCaseBindOutputableBndrbndrIsJoin_maybe pprInfixOccpprBndr pprPrefixOcc ModuleName FastStringfsLit PlainPanic assertPanicpgmErrorsorrypanicshowSDocUnsafe warnPprTracetextSDocrunSDocName/ghc-tcplugin-api-0.6.1.0-JvDQBenFL0BJkQASuEeT31GHC.TcPlugin.APImkInvisFunTysManymkInvisFunTyManymkTyFamAppReductionmkPluginUnivEvTermmkPluginUnivCo setEvBindnewCoercionHolenewEvVarsetCtLocRewriteM setCtLocMrewriteEnvCtLocnewGiven newDerived newWantedzonkCt zonkTcTypeisTouchableTcPluginM newFlexiTyVar newUniquematchFamgetFamInstEnvs getInstEnvsgetEnvs tcLookupIdtcLookuptcLookupGlobal tcLookupClasstcLookupDataCon tcLookupTyCon lookupOrigfindImportedModule tcPluginTrace tcPluginIOGHC.TcPlugin.API.InternalmkTcPluginErrorTy mkTcPlugin askRewriteEnv askDeriveds askEvBinds TcPluginStageRewriteSolveStopInitTcPluginSolverTcPluginRewriterTcPlugintcPluginRewrite tcPluginStop tcPluginInit tcPluginSolve TcPluginM MonadTcPluginMonadTcPluginWorkTcPluginErrorMessage:-::|:Txt PrintTypeGHC.TcPlugin.API.Internal.Shim RewriteEnvTcPluginSolveResultTcPluginContradiction TcPluginOkTcPluginRewriteResultTcPluginNoRewriteTcPluginRewriteTotcPluginReductiontcRewriterWanteds(GHC.TcPlugin.API.Internal.Shim.Reduction ReductionreductionCoercionreductionReducedType ResolvedNamesclsEqualclsLet resolveNamesNonVariableLHS NonSkolemLHSParseOk ParseNoMatch ParseErrorparseAll parseAll'withOrig parseEqual evidenceEqual InvalidLet ParseResultCEqual equalKindequalLHSequalRHSCLetletKindletLHSletRHSparseLet formatCLetformatInvalidLetCycle letsToSubstformatLetCycle