git.iko.soy/rowtype-yoga/purescript-backend-optimizer
on main help sign in
334 files changed+9164−1790
since splitsnapshots
unifiedsplit
.github/workflows/ci.yml+17−28 README.md+20−12 backend-es/package-lock.json−569 backend-es/package.json+5−8 backend-es/runtime.js+6 backend-es/spago.yaml+48 backend-es/src/Main.purs+175−31 backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Builder.purs+13−6 backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Convert.purs+17−4 backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Foreign.purs+45−26 backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Inline.purs+63 backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Syntax.purs+116−41 backend-es/src/Version.js+1−1 backend-es/test-snapshots/.gitignore+3 backend-es/test-snapshots/snapshots-out/Snapshot.AssocArrayAppend.js+4 backend-es/test-snapshots/snapshots-out/Snapshot.AssocIntOps.js+7 backend-es/test-snapshots/snapshots-out/Snapshot.AssocNumberOps.js+7 backend-es/test-snapshots/snapshots-out/Snapshot.AssocStringAppend.js+4 backend-es/test/snapshots-out/Snapshot.BackendSemantics01.js → backend-es/test-snapshots/snapshots-out/Snapshot.BackendSemantics01.js backend-es/test/snapshots-out/Snapshot.BackendSemantics02.js → backend-es/test-snapshots/snapshots-out/Snapshot.BackendSemantics02.js backend-es/test/snapshots-out/Snapshot.BranchSpecialization01.js → backend-es/test-snapshots/snapshots-out/Snapshot.BranchSpecialization01.js+1−2 backend-es/test/snapshots-out/Snapshot.CaptureDerefRegression01.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaptureDerefRegression01.js backend-es/test/snapshots-out/Snapshot.CaseArray.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseArray.js+1−4 backend-es/test/snapshots-out/Snapshot.CaseBoolean.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseBoolean.js backend-es/test/snapshots-out/Snapshot.CaseChar.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseChar.js backend-es/test/snapshots-out/Snapshot.CaseGrafting.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseGrafting.js+1−6 backend-es/test/snapshots-out/Snapshot.CaseGuarded.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseGuarded.js+5−38 backend-es/test/snapshots-out/Snapshot.CaseHeuristics.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseHeuristics.js+9−48 backend-es/test/snapshots-out/Snapshot.CaseInt.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseInt.js backend-es/test/snapshots-out/Snapshot.CaseJacobs.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseJacobs.js−1 backend-es/test-snapshots/snapshots-out/Snapshot.CaseLeafTco.js+37 backend-es/test/snapshots-out/Snapshot.CaseMulti.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseMulti.js backend-es/test/snapshots-out/Snapshot.CaseNamed.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNamed.js backend-es/test/snapshots-out/Snapshot.CaseNewtype.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNewtype.js backend-es/test/snapshots-out/Snapshot.CaseNumber.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNumber.js backend-es/test/snapshots-out/Snapshot.CasePartial.js → backend-es/test-snapshots/snapshots-out/Snapshot.CasePartial.js backend-es/test/snapshots-out/Snapshot.CaseProduct.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseProduct.js+2−12 backend-es/test/snapshots-out/Snapshot.CaseRecord.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseRecord.js+4−12 backend-es/test-snapshots/snapshots-out/Snapshot.CaseRedBlackTree.js+55 backend-es/test/snapshots-out/Snapshot.CaseString.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseString.js backend-es/test/snapshots-out/Snapshot.CaseSum.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseSum.js backend-es/test/snapshots-out/Snapshot.ConvertableOptions01.js → backend-es/test-snapshots/snapshots-out/Snapshot.ConvertableOptions01.js backend-es/test/snapshots-out/Snapshot.Cps01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Cps01.js backend-es/test/snapshots-out/Snapshot.Cps02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Cps02.js backend-es/test/snapshots-out/Snapshot.DefaultRulesEq01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesEq01.js backend-es/test/snapshots-out/Snapshot.DefaultRulesEq02.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesEq02.js backend-es/test/snapshots-out/Snapshot.DefaultRulesFunction01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesFunction01.js backend-es/test/snapshots-out/Snapshot.DefaultRulesFunctor01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesFunctor01.js backend-es/test/snapshots-out/Snapshot.DefaultRulesMonoid01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesMonoid01.js backend-es/test/snapshots-out/Snapshot.DefaultRulesSemigroup01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesSemigroup01.js backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesSemigroup02.js+6 backend-es/test/snapshots-out/Snapshot.EffectBind01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind01.js backend-es/test/snapshots-out/Snapshot.EffectBind02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind02.js backend-es/test/snapshots-out/Snapshot.EffectBind03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind03.js backend-es/test/snapshots-out/Snapshot.EffectBind04.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind04.js backend-es/test/snapshots-out/Snapshot.EffectBind05.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind05.js backend-es/test/snapshots-out/Snapshot.EffectBind06.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind06.js+1−1 backend-es/test/snapshots-out/Snapshot.EffectBind07.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind07.js+1−1 backend-es/test/snapshots-out/Snapshot.EffectBind08.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind08.js backend-es/test/snapshots-out/Snapshot.EffectBind09.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind09.js backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoopCaseRegression.js+14 backend-es/test/snapshots-out/Snapshot.EffectLoops01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops01.js backend-es/test/snapshots-out/Snapshot.EffectLoops02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops02.js backend-es/test/snapshots-out/Snapshot.EffectLoops03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops03.js backend-es/test/snapshots-out/Snapshot.EffectPure01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectPure01.js backend-es/test/snapshots-out/Snapshot.EffectRefs01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectRefs01.js backend-es/test/snapshots-out/Snapshot.EffectRefs02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectRefs02.js backend-es/test/snapshots-out/Snapshot.EffectUnsafe01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectUnsafe01.js backend-es/test/snapshots-out/Snapshot.EsPrecedence01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence01.js+1−1 backend-es/test/snapshots-out/Snapshot.EsPrecedence02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence02.js backend-es/test/snapshots-out/Snapshot.EsPrecedence03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence03.js backend-es/test-snapshots/snapshots-out/Snapshot.EsSharedElse.js+6 backend-es/test/snapshots-out/Snapshot.EscapeIdentifiers.js → backend-es/test-snapshots/snapshots-out/Snapshot.EscapeIdentifiers.js backend-es/test/snapshots-out/Snapshot.EtaReduceRegression01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EtaReduceRegression01.js backend-es/test-snapshots/snapshots-out/Snapshot.FloatLetRegression01.js+5 backend-es/test/snapshots-out/Snapshot.FunctionCompose01.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose01.js backend-es/test/snapshots-out/Snapshot.FunctionCompose02.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose02.js backend-es/test/snapshots-out/Snapshot.FunctionCompose03.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose03.js backend-es/test/snapshots-out/Snapshot.Fusion01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Fusion01.js+7−2 backend-es/test/snapshots-out/Snapshot.Fusion02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Fusion02.js+7−2 backend-es/test/snapshots-out/Snapshot.HalogenVDomST01.js → backend-es/test-snapshots/snapshots-out/Snapshot.HalogenVDomST01.js backend-es/test/snapshots-out/Snapshot.HalogenVDomST02.js → backend-es/test-snapshots/snapshots-out/Snapshot.HalogenVDomST02.js+5−6 backend-es/test/snapshots-out/Snapshot.HelloWorld01.js → backend-es/test-snapshots/snapshots-out/Snapshot.HelloWorld01.js backend-es/test/snapshots-out/Snapshot.Heterogeneous01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Heterogeneous01.js backend-es/test/snapshots-out/Snapshot.Html.js → backend-es/test-snapshots/snapshots-out/Snapshot.Html.js backend-es/test-snapshots/snapshots-out/Snapshot.InlineArrayIndex.js+33 backend-es/test/snapshots-out/Snapshot.InlineCase01.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineCase01.js backend-es/test/snapshots-out/Snapshot.InlineCase02.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineCase02.js backend-es/test/snapshots-out/Snapshot.InlineDirectivePropSpine01.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineDirectivePropSpine01.js backend-es/test/snapshots-out/Snapshot.InlineDirectivePropSpine02.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineDirectivePropSpine02.js backend-es/test/snapshots-out/Snapshot.InlineNever.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineNever.js backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceIfThenElse.js+6 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceOpArrayLength.js+9 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceOpIsTag.js+15 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpBoolean.js+10 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpInt.js+25 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpNumber.js+25 backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceRecordUpdate.js+6 backend-es/test/snapshots-out/Snapshot.KnownConstructor07.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructor07.js backend-es/test/snapshots-out/Snapshot.KnownConstructors01.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors01.js backend-es/test/snapshots-out/Snapshot.KnownConstructors02.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors02.js backend-es/test/snapshots-out/Snapshot.KnownConstructors03.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors03.js backend-es/test/snapshots-out/Snapshot.KnownConstructors04.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors04.js backend-es/test/snapshots-out/Snapshot.KnownConstructors05.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors05.js backend-es/test/snapshots-out/Snapshot.KnownConstructors06.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors06.js−2 backend-es/test/snapshots-out/Snapshot.Object01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Object01.js backend-es/test/snapshots-out/Snapshot.PrimOpArray01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpArray01.js backend-es/test/snapshots-out/Snapshot.PrimOpBoolean01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBoolean01.js backend-es/test/snapshots-out/Snapshot.PrimOpBoolean02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBoolean02.js backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBooleanNotRegression.js+5 backend-es/test/snapshots-out/Snapshot.PrimOpChar01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpChar01.js backend-es/test/snapshots-out/Snapshot.PrimOpChar02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpChar02.js backend-es/test/snapshots-out/Snapshot.PrimOpInt01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt01.js+2−2 backend-es/test/snapshots-out/Snapshot.PrimOpInt02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt02.js+1−9 backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt03.js+5 backend-es/test/snapshots-out/Snapshot.PrimOpIntBit01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntBit01.js backend-es/test/snapshots-out/Snapshot.PrimOpIntBit02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntBit02.js backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntDiv.js+15 backend-es/test/snapshots-out/Snapshot.PrimOpNumber01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpNumber01.js backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpNumber02.js+14 backend-es/test/snapshots-out/Snapshot.PrimOpString01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString01.js backend-es/test/snapshots-out/Snapshot.PrimOpString02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString02.js backend-es/test/snapshots-out/Snapshot.PrimOpString03.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString03.js backend-es/test/snapshots-out/Snapshot.ProfunctorLenses01.js → backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses01.js backend-es/test/snapshots-out/Snapshot.ProfunctorLenses02.js → backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses02.js backend-es/test/snapshots-out/Snapshot.RecordUnion01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecordUnion01.js backend-es/test/snapshots-out/Snapshot.RecursionSchemes01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursionSchemes01.js backend-es/test/snapshots-out/Snapshot.RecursiveBindingGroup01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursiveBindingGroup01.js backend-es/test/snapshots-out/Snapshot.RecursiveBindingGroup02.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursiveBindingGroup02.js backend-es/test/snapshots-out/Snapshot.STArray01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray01.js backend-es/test/snapshots-out/Snapshot.STArray02.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray02.js backend-es/test/snapshots-out/Snapshot.STArray03.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray03.js backend-es/test/snapshots-out/Snapshot.STArray04.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray04.js backend-es/test-snapshots/snapshots-out/Snapshot.STArray05.js+7 backend-es/test-snapshots/snapshots-out/Snapshot.STArrayUnsafeThawFreezeLengthRegression.js+7 backend-es/test/snapshots-out/Snapshot.STLoops01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops01.js backend-es/test/snapshots-out/Snapshot.STLoops02.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops02.js backend-es/test/snapshots-out/Snapshot.STLoops03.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops03.js backend-es/test/snapshots-out/Snapshot.STObject01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STObject01.js backend-es/test/snapshots-out/Snapshot.STRun01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STRun01.js backend-es/test/snapshots-out/Snapshot.ShowLiterals.js → backend-es/test-snapshots/snapshots-out/Snapshot.ShowLiterals.js backend-es/test/snapshots-out/Snapshot.StringLiteral01.js → backend-es/test-snapshots/snapshots-out/Snapshot.StringLiteral01.js+2−1 backend-es/test/snapshots-out/Snapshot.Tco01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco01.js backend-es/test/snapshots-out/Snapshot.Tco02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco02.js backend-es/test/snapshots-out/Snapshot.Tco03.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco03.js backend-es/test/snapshots-out/Snapshot.Tco04.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco04.js backend-es/test/snapshots-out/Snapshot.Tco05.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco05.js+4−11 backend-es/test/snapshots-out/Snapshot.Tco06.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco06.js backend-es/test/snapshots-out/Snapshot.TopLevelHygiene01.js → backend-es/test-snapshots/snapshots-out/Snapshot.TopLevelHygiene01.js backend-es/test/snapshots-out/Snapshot.TopLevelHygiene02.js → backend-es/test-snapshots/snapshots-out/Snapshot.TopLevelHygiene02.js backend-es/test/snapshots-out/Snapshot.UncurriedEffectFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedEffectFns01.js backend-es/test/snapshots-out/Snapshot.UncurriedEffectFns02.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedEffectFns02.js backend-es/test/snapshots-out/Snapshot.UncurriedFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedFns01.js backend-es/test/snapshots-out/Snapshot.UncurriedLocalAbs01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedLocalAbs01.js backend-es/test/snapshots-out/Snapshot.UncurriedSTFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedSTFns01.js backend-es/test/snapshots-out/Snapshot.UncurriedSTFns02.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedSTFns02.js backend-es/test-snapshots/snapshots-out/Snapshot.UnpackArray01.js+2 backend-es/test/snapshots-out/Snapshot.UnsafePerformEffect.js → backend-es/test-snapshots/snapshots-out/Snapshot.UnsafePerformEffect.js backend-es/test/snapshots-out/Snapshot.VanLaarhovenTraversals01.js → backend-es/test-snapshots/snapshots-out/Snapshot.VanLaarhovenTraversals01.js+8−8 backend-es/test/snapshots-out/Snapshot.Variant01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Variant01.js backend-es/test/snapshots-out/Snapshot.Variant02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Variant02.js backend-es/test-snapshots/spago.lock+736 backend-es/test-snapshots/spago.yaml+36 backend-es/test/snapshots/Assert.purs → backend-es/test-snapshots/src/Assert.purs backend-es/test-snapshots/src/Snapshot.AssocArrayAppend.purs+12 backend-es/test-snapshots/src/Snapshot.AssocIntOps.purs+21 backend-es/test-snapshots/src/Snapshot.AssocNumberOps.purs+21 backend-es/test-snapshots/src/Snapshot.AssocStringAppend.purs+12 backend-es/test/snapshots/Snapshot.BackendSemantics01.purs → backend-es/test-snapshots/src/Snapshot.BackendSemantics01.purs backend-es/test/snapshots/Snapshot.BackendSemantics02.purs → backend-es/test-snapshots/src/Snapshot.BackendSemantics02.purs backend-es/test/snapshots/Snapshot.BranchSpecialization01.purs → backend-es/test-snapshots/src/Snapshot.BranchSpecialization01.purs backend-es/test/snapshots/Snapshot.CaptureDerefRegression01.purs → backend-es/test-snapshots/src/Snapshot.CaptureDerefRegression01.purs backend-es/test/snapshots/Snapshot.CaseCtorNewtype.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorNewtype.purs backend-es/test/snapshots/Snapshot.CaseCtorProduct.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorProduct.purs backend-es/test/snapshots/Snapshot.CaseCtorSum.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorSum.purs backend-es/test/snapshots/Snapshot.CaseGrafting.purs → backend-es/test-snapshots/src/Snapshot.CaseGrafting.purs backend-es/test/snapshots/Snapshot.CaseGuarded.purs → backend-es/test-snapshots/src/Snapshot.CaseGuarded.purs backend-es/test/snapshots/Snapshot.CaseHeuristics.purs → backend-es/test-snapshots/src/Snapshot.CaseHeuristics.purs backend-es/test/snapshots/Snapshot.CaseJacobs.purs → backend-es/test-snapshots/src/Snapshot.CaseJacobs.purs backend-es/test/snapshots/Snapshot.CaseLeafTco.purs → backend-es/test-snapshots/src/Snapshot.CaseLeafTco.purs backend-es/test/snapshots/Snapshot.CaseLitArray.purs → backend-es/test-snapshots/src/Snapshot.CaseLitArray.purs backend-es/test/snapshots/Snapshot.CaseLitBoolean.purs → backend-es/test-snapshots/src/Snapshot.CaseLitBoolean.purs backend-es/test/snapshots/Snapshot.CaseLitChar.purs → backend-es/test-snapshots/src/Snapshot.CaseLitChar.purs backend-es/test/snapshots/Snapshot.CaseLitInt.purs → backend-es/test-snapshots/src/Snapshot.CaseLitInt.purs backend-es/test/snapshots/Snapshot.CaseLitNumber.purs → backend-es/test-snapshots/src/Snapshot.CaseLitNumber.purs backend-es/test/snapshots/Snapshot.CaseLitRecord.purs → backend-es/test-snapshots/src/Snapshot.CaseLitRecord.purs backend-es/test/snapshots/Snapshot.CaseLitString.purs → backend-es/test-snapshots/src/Snapshot.CaseLitString.purs backend-es/test/snapshots/Snapshot.CaseMulti.purs → backend-es/test-snapshots/src/Snapshot.CaseMulti.purs backend-es/test/snapshots/Snapshot.CaseNamed.purs → backend-es/test-snapshots/src/Snapshot.CaseNamed.purs backend-es/test/snapshots/Snapshot.CasePartial.purs → backend-es/test-snapshots/src/Snapshot.CasePartial.purs backend-es/test/snapshots/Snapshot.CaseRedBlackTree.purs → backend-es/test-snapshots/src/Snapshot.CaseRedBlackTree.purs backend-es/test/snapshots/Snapshot.ConvertableOptions01.purs → backend-es/test-snapshots/src/Snapshot.ConvertableOptions01.purs backend-es/test/snapshots/Snapshot.Cps01.purs → backend-es/test-snapshots/src/Snapshot.Cps01.purs backend-es/test/snapshots/Snapshot.Cps02.purs → backend-es/test-snapshots/src/Snapshot.Cps02.purs backend-es/test/snapshots/Snapshot.DefaultRulesEq01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesEq01.purs backend-es/test/snapshots/Snapshot.DefaultRulesEq02.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesEq02.purs backend-es/test/snapshots/Snapshot.DefaultRulesFunction01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesFunction01.purs backend-es/test/snapshots/Snapshot.DefaultRulesFunctor01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesFunctor01.purs backend-es/test/snapshots/Snapshot.DefaultRulesMonoid01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesMonoid01.purs backend-es/test/snapshots/Snapshot.DefaultRulesSemigroup.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesSemigroup.purs backend-es/test/snapshots/Snapshot.DefaultRulesSemigroup02.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesSemigroup02.purs backend-es/test/snapshots/Snapshot.EffectBind01.purs → backend-es/test-snapshots/src/Snapshot.EffectBind01.purs backend-es/test/snapshots/Snapshot.EffectBind02.purs → backend-es/test-snapshots/src/Snapshot.EffectBind02.purs backend-es/test/snapshots/Snapshot.EffectBind03.purs → backend-es/test-snapshots/src/Snapshot.EffectBind03.purs backend-es/test/snapshots/Snapshot.EffectBind04.purs → backend-es/test-snapshots/src/Snapshot.EffectBind04.purs backend-es/test/snapshots/Snapshot.EffectBind05.purs → backend-es/test-snapshots/src/Snapshot.EffectBind05.purs backend-es/test/snapshots/Snapshot.EffectBind06.purs → backend-es/test-snapshots/src/Snapshot.EffectBind06.purs backend-es/test/snapshots/Snapshot.EffectBind07.purs → backend-es/test-snapshots/src/Snapshot.EffectBind07.purs backend-es/test/snapshots/Snapshot.EffectBind08.purs → backend-es/test-snapshots/src/Snapshot.EffectBind08.purs backend-es/test/snapshots/Snapshot.EffectBind09.purs → backend-es/test-snapshots/src/Snapshot.EffectBind09.purs backend-es/test-snapshots/src/Snapshot.EffectLoopCaseRegression.purs+17 backend-es/test/snapshots/Snapshot.EffectLoops01.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops01.purs backend-es/test/snapshots/Snapshot.EffectLoops02.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops02.purs backend-es/test/snapshots/Snapshot.EffectLoops03.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops03.purs backend-es/test/snapshots/Snapshot.EffectPure01.purs → backend-es/test-snapshots/src/Snapshot.EffectPure01.purs backend-es/test/snapshots/Snapshot.EffectRefs01.purs → backend-es/test-snapshots/src/Snapshot.EffectRefs01.purs backend-es/test/snapshots/Snapshot.EffectRefs02.purs → backend-es/test-snapshots/src/Snapshot.EffectRefs02.purs backend-es/test/snapshots/Snapshot.EffectUnsafe01.purs → backend-es/test-snapshots/src/Snapshot.EffectUnsafe01.purs backend-es/test/snapshots/Snapshot.EsPrecedence01.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence01.purs backend-es/test/snapshots/Snapshot.EsPrecedence02.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence02.purs backend-es/test/snapshots/Snapshot.EsPrecedence03.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence03.purs backend-es/test-snapshots/src/Snapshot.EsSharedElse.purs+15 backend-es/test/snapshots/Snapshot.EscapeIdentifiers.purs → backend-es/test-snapshots/src/Snapshot.EscapeIdentifiers.purs backend-es/test/snapshots/Snapshot.EtaReduceRegression01.purs → backend-es/test-snapshots/src/Snapshot.EtaReduceRegression01.purs backend-es/test-snapshots/src/Snapshot.FloatLetRefression01.purs+14 backend-es/test/snapshots/Snapshot.FunctionCompose01.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose01.purs backend-es/test/snapshots/Snapshot.FunctionCompose02.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose02.purs backend-es/test/snapshots/Snapshot.FunctionCompose03.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose03.purs backend-es/test/snapshots/Snapshot.Fusion01.purs → backend-es/test-snapshots/src/Snapshot.Fusion01.purs backend-es/test/snapshots/Snapshot.Fusion02.purs → backend-es/test-snapshots/src/Snapshot.Fusion02.purs backend-es/test/snapshots/Snapshot.HalogenVDomST01.purs → backend-es/test-snapshots/src/Snapshot.HalogenVDomST01.purs backend-es/test/snapshots/Snapshot.HalogenVDomST02.purs → backend-es/test-snapshots/src/Snapshot.HalogenVDomST02.purs backend-es/test/snapshots/Snapshot.HelloWorld01.purs → backend-es/test-snapshots/src/Snapshot.HelloWorld01.purs backend-es/test/snapshots/Snapshot.Heterogeneous01.purs → backend-es/test-snapshots/src/Snapshot.Heterogeneous01.purs backend-es/test/snapshots/Snapshot.Html.purs → backend-es/test-snapshots/src/Snapshot.Html.purs backend-es/test-snapshots/src/Snapshot.InlineArrayIndex.purs+36 backend-es/test/snapshots/Snapshot.InlineCase01.purs → backend-es/test-snapshots/src/Snapshot.InlineCase01.purs backend-es/test/snapshots/Snapshot.InlineCase02.purs → backend-es/test-snapshots/src/Snapshot.InlineCase02.purs backend-es/test/snapshots/Snapshot.InlineDirectivePropSpine01.purs → backend-es/test-snapshots/src/Snapshot.InlineDirectivePropSpine01.purs backend-es/test/snapshots/Snapshot.InlineDirectivePropSpine02.purs → backend-es/test-snapshots/src/Snapshot.InlineDirectivePropSpine02.purs backend-es/test/snapshots/Snapshot.InlineNever.purs → backend-es/test-snapshots/src/Snapshot.InlineNever.purs backend-es/test-snapshots/src/Snapshot.InlineReferenceIfThenElse.purs+23 backend-es/test-snapshots/src/Snapshot.InlineReferenceOpArrayLength.purs+47 backend-es/test-snapshots/src/Snapshot.InlineReferenceOpIsTag.purs+65 backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpBoolean.purs+55 backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpInt.purs+51 backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpNumber.purs+51 backend-es/test-snapshots/src/Snapshot.InlineReferenceRecordUpdate.purs+31 backend-es/test/snapshots/Snapshot.KnownConstructor07.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructor07.purs backend-es/test/snapshots/Snapshot.KnownConstructors01.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors01.purs backend-es/test/snapshots/Snapshot.KnownConstructors02.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors02.purs backend-es/test/snapshots/Snapshot.KnownConstructors03.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors03.purs backend-es/test/snapshots/Snapshot.KnownConstructors04.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors04.purs backend-es/test/snapshots/Snapshot.KnownConstructors05.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors05.purs backend-es/test/snapshots/Snapshot.KnownConstructors06.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors06.purs backend-es/test/snapshots/Snapshot.Object01.purs → backend-es/test-snapshots/src/Snapshot.Object01.purs backend-es/test/snapshots/Snapshot.PrimOpArray01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpArray01.purs backend-es/test/snapshots/Snapshot.PrimOpBoolean01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpBoolean01.purs backend-es/test/snapshots/Snapshot.PrimOpBoolean02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpBoolean02.purs backend-es/test-snapshots/src/Snapshot.PrimOpBooleanNotRegression.purs+9 backend-es/test/snapshots/Snapshot.PrimOpChar01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpChar01.purs backend-es/test/snapshots/Snapshot.PrimOpChar02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpChar02.purs backend-es/test/snapshots/Snapshot.PrimOpInt01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpInt01.purs backend-es/test/snapshots/Snapshot.PrimOpInt02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpInt02.purs backend-es/test-snapshots/src/Snapshot.PrimOpInt03.purs+15 backend-es/test/snapshots/Snapshot.PrimOpIntBit01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpIntBit01.purs backend-es/test/snapshots/Snapshot.PrimOpIntBit02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpIntBit02.purs backend-es/test-snapshots/src/Snapshot.PrimOpIntDiv.purs+16 backend-es/test/snapshots/Snapshot.PrimOpNumber01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpNumber01.purs backend-es/test/snapshots/Snapshot.PrimOpNumber02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpNumber02.purs+4 backend-es/test/snapshots/Snapshot.PrimOpString01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString01.purs backend-es/test/snapshots/Snapshot.PrimOpString02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString02.purs backend-es/test/snapshots/Snapshot.PrimOpString03.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString03.purs backend-es/test/snapshots/Snapshot.ProfunctorLenses01.purs → backend-es/test-snapshots/src/Snapshot.ProfunctorLenses01.purs backend-es/test/snapshots/Snapshot.ProfunctorLenses02.purs → backend-es/test-snapshots/src/Snapshot.ProfunctorLenses02.purs backend-es/test/snapshots/Snapshot.RecordUnion01.purs → backend-es/test-snapshots/src/Snapshot.RecordUnion01.purs backend-es/test/snapshots/Snapshot.RecursionSchemes01.purs → backend-es/test-snapshots/src/Snapshot.RecursionSchemes01.purs backend-es/test/snapshots/Snapshot.RecursiveBindingGroup01.purs → backend-es/test-snapshots/src/Snapshot.RecursiveBindingGroup01.purs backend-es/test/snapshots/Snapshot.RecursiveBindingGroup02.purs → backend-es/test-snapshots/src/Snapshot.RecursiveBindingGroup02.purs backend-es/test/snapshots/Snapshot.STArray01.purs → backend-es/test-snapshots/src/Snapshot.STArray01.purs backend-es/test/snapshots/Snapshot.STArray02.purs → backend-es/test-snapshots/src/Snapshot.STArray02.purs backend-es/test/snapshots/Snapshot.STArray03.purs → backend-es/test-snapshots/src/Snapshot.STArray03.purs backend-es/test/snapshots/Snapshot.STArray04.purs → backend-es/test-snapshots/src/Snapshot.STArray04.purs backend-es/test-snapshots/src/Snapshot.STArray05.purs+16 backend-es/test-snapshots/src/Snapshot.STArrayUnsafeThawFreezeLengthRegression.purs+18 backend-es/test/snapshots/Snapshot.STLoops01.purs → backend-es/test-snapshots/src/Snapshot.STLoops01.purs backend-es/test/snapshots/Snapshot.STLoops02.purs → backend-es/test-snapshots/src/Snapshot.STLoops02.purs backend-es/test/snapshots/Snapshot.STLoops03.purs → backend-es/test-snapshots/src/Snapshot.STLoops03.purs backend-es/test/snapshots/Snapshot.STObject01.purs → backend-es/test-snapshots/src/Snapshot.STObject01.purs backend-es/test/snapshots/Snapshot.STRun01.purs → backend-es/test-snapshots/src/Snapshot.STRun01.purs backend-es/test/snapshots/Snapshot.ShowLiterals.purs → backend-es/test-snapshots/src/Snapshot.ShowLiterals.purs backend-es/test/snapshots/Snapshot.StringLiteral01.purs → backend-es/test-snapshots/src/Snapshot.StringLiteral01.purs+1 backend-es/test/snapshots/Snapshot.Tco01.purs → backend-es/test-snapshots/src/Snapshot.Tco01.purs backend-es/test/snapshots/Snapshot.Tco02.purs → backend-es/test-snapshots/src/Snapshot.Tco02.purs backend-es/test/snapshots/Snapshot.Tco03.purs → backend-es/test-snapshots/src/Snapshot.Tco03.purs backend-es/test/snapshots/Snapshot.Tco04.purs → backend-es/test-snapshots/src/Snapshot.Tco04.purs backend-es/test/snapshots/Snapshot.Tco05.purs → backend-es/test-snapshots/src/Snapshot.Tco05.purs backend-es/test/snapshots/Snapshot.Tco06.purs → backend-es/test-snapshots/src/Snapshot.Tco06.purs backend-es/test/snapshots/Snapshot.TopLevelHygiene01.purs → backend-es/test-snapshots/src/Snapshot.TopLevelHygiene01.purs backend-es/test/snapshots/Snapshot.TopLevelHygiene02.purs → backend-es/test-snapshots/src/Snapshot.TopLevelHygiene02.purs backend-es/test/snapshots/Snapshot.UncurriedEffectFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedEffectFns01.purs backend-es/test/snapshots/Snapshot.UncurriedEffectFns02.purs → backend-es/test-snapshots/src/Snapshot.UncurriedEffectFns02.purs backend-es/test/snapshots/Snapshot.UncurriedFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedFns01.purs backend-es/test/snapshots/Snapshot.UncurriedLocalAbs01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedLocalAbs01.purs backend-es/test/snapshots/Snapshot.UncurriedSTFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedSTFns01.purs backend-es/test/snapshots/Snapshot.UncurriedSTFns02.purs → backend-es/test-snapshots/src/Snapshot.UncurriedSTFns02.purs backend-es/test-snapshots/src/Snapshot.UnpackArray01.purs+15 backend-es/test/snapshots/Snapshot.UnsafePerformEffect.purs → backend-es/test-snapshots/src/Snapshot.UnsafePerformEffect.purs backend-es/test/snapshots/Snapshot.VanLaarhovenTraversals01.purs → backend-es/test-snapshots/src/Snapshot.VanLaarhovenTraversals01.purs backend-es/test/snapshots/Snapshot.Variant01.purs → backend-es/test-snapshots/src/Snapshot.Variant01.purs backend-es/test/snapshots/Snapshot.Variant02.purs → backend-es/test-snapshots/src/Snapshot.Variant02.purs backend-es/test/Main.purs+53−18 backend-es/test/Utils.purs+13−18 backend-es/test/snapshots-out/Snapshot.CaseLeafTco.js−65 backend-es/test/snapshots-out/Snapshot.CaseRedBlackTree.js−143 backend-es/test/snapshots-out/Snapshot.DefaultRulesSemigroup02.js−7 backend-es/test/snapshots-out/Snapshot.PrimOpNumber02.js−13 package-lock.json+4043 package.json+9 packages.dhall+6−3 spago.dhall+7−2 spago.lock+1431 spago.yaml+31 src/PureScript/Backend/Optimizer/Analysis.purs+41−20 src/PureScript/Backend/Optimizer/Builder.purs+16−8 src/PureScript/Backend/Optimizer/Convert.purs+56−34 src/PureScript/Backend/Optimizer/CoreFn.purs+3−1 src/PureScript/Backend/Optimizer/CoreFn/Json.purs+147−13 src/PureScript/Backend/Optimizer/Directives/Defaults.purs+15 src/PureScript/Backend/Optimizer/Semantics.purs+564−439 src/PureScript/Backend/Optimizer/Semantics/Foreign.purs+39−110 src/PureScript/Backend/Optimizer/Syntax.purs+7 src/PureScript/Backend/Optimizer/Tracer/Printer.purs+425 src/PureScript/Backend/Optimizer/Utils.purs+1−1
.github/workflows/ci.yml+17−28
@@ -1,5 +1,3 @@
1−name: CI
2−
31on:
42 push:
53 branches: [main]
@@ -10,48 +8,39 @@ jobs:
108 build:
119 strategy:
1210 matrix:
13− os: [ubuntu-latest, macOS-latest, windows-latest]
11+ os: [ubuntu-latest, macOS-latest] # windows disabled for unknown spago reasons
1412 runs-on: ${{ matrix.os }}
1513
1614 steps:
17− - uses: actions/checkout@v2
18−
19− - name: Set up Node toolchain
20− uses: actions/setup-node@v2
21− with:
22− node-version: "16"
23−
24− - name: Cache NPM dependencies
25− uses: actions/cache@v2
26− env:
27− cache-name: cache-node-modules
15+ - uses: actions/checkout@v4
16+ - uses: actions/setup-node@v4
2817 with:
29− path: ~/.npm
30− key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
31− restore-keys: |
32− ${{ runner.os }}-build-${{ env.cache-name }}-
33− ${{ runner.os }}-build-
34− ${{ runner.os }}-
35−
36− - name: Setup PureScript dependencies
37− run: npm i --global purescript@0.15.4 purs-tidy@latest spago@latest purescript-psa@latest
18+ node-version: 22
19+ cache: 'npm'
3820
3921 - name: Cache PureScript dependencies
40− uses: actions/cache@v2
22+ uses: actions/cache@v4
4123 with:
42− key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
24+ key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}
4325 path: |
4426 .spago
4527 output
4628
29+ - name: Install npm dependencies
30+ run: npm install --include=dev
31+
4732 - name: Install dependencies
48− run: spago install
33+ run: npm run install
4934
5035 - name: Build project
51− run: spago build --purs-args '--censor-lib --strict'
36+ run: npm run build -- --pedantic-packages
5237
5338 - name: Run snapshots
54− run: spago test --purs-args '--censor-lib'
39+ run: npm run test
40+
41+ - name: Test output-diff (Linux only)
42+ if: matrix.os == 'ubuntu-latest'
43+ run: cd backend-es && npm run test:output-diff
5544
5645 - name: Check formatting (Linux only)
5746 if: matrix.os == 'ubuntu-latest'
README.md+20−12
@@ -16,17 +16,19 @@ bundles.
1616
1717| Example | Input | `purs` | `purs-backend-es` |
1818|---------|-------|--------|-------------------|
19−| Lenses | [Input](./backend-es/test/snapshots/Snapshot.ProfunctorLenses01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.ProfunctorLenses01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.ProfunctorLenses01.js) |
20−| Prisms | [Input](./backend-es/test/snapshots/Snapshot.ProfunctorLenses02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.ProfunctorLenses02.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.ProfunctorLenses02.js) |
21−| Variant | [Input](./backend-es/test/snapshots/Snapshot.Variant01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Variant01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Variant01.js) |
22−| Heterogeneous | [Input](./backend-es/test/snapshots/Snapshot.Heterogeneous01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Heterogeneous01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Heterogeneous01.js) |
23−| Uncurried CPS | [Input](./backend-es/test/snapshots/Snapshot.Cps02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Cps02.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Cps02.js) |
24−| Generics | [Input](./backend-es/test/snapshots/Snapshot.KnownConstructors06.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.KnownConstructors06.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.KnownConstructors06.js) |
25−| Fusion (Fold) | [Input](./backend-es/test/snapshots/Snapshot.Fusion01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Fusion01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Fusion01.js) |
26−| Fusion (Unfold) | [Input](./backend-es/test/snapshots/Snapshot.Fusion02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Fusion02.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Fusion02.js) |
27−| Recursion Schemes | [Input](./backend-es/test/snapshots/Snapshot.RecursionSchemes01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.RecursionSchemes01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.RecursionSchemes01.js) |
28−| HTML DSL | [Input](./backend-es/test/snapshots/Snapshot.Html.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.Html.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.Html.js) |
29−| Imperative Loops | [Input](./backend-es/test/snapshots/Snapshot.HalogenVDomST01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=/aristanetworks/purescript-backend-optimizer/main/backend-es/test/snapshots/Snapshot.HalogenVDomST01.purs) | [Output](./backend-es/test/snapshots-out/Snapshot.HalogenVDomST01.js) |
19+| Lenses | [Input](./backend-es/test-snapshots/src/Snapshot.ProfunctorLenses01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.ProfunctorLenses01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses01.js) |
20+| Prisms | [Input](./backend-es/test-snapshots/src/Snapshot.ProfunctorLenses02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.ProfunctorLenses02.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses02.js) |
21+| Variant | [Input](./backend-es/test-snapshots/src/Snapshot.Variant01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Variant01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Variant01.js) |
22+| Heterogeneous | [Input](./backend-es/test-snapshots/src/Snapshot.Heterogeneous01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Heterogeneous01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Heterogeneous01.js) |
23+| Uncurried CPS | [Input](./backend-es/test-snapshots/src/Snapshot.Cps02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Cps02.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Cps02.js) |
24+| Generics | [Input](./backend-es/test-snapshots/src/Snapshot.KnownConstructors06.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.KnownConstructors06.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors06.js) |
25+| Fusion (Fold) | [Input](./backend-es/test-snapshots/src/Snapshot.Fusion01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Fusion01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Fusion01.js) |
26+| Fusion (Unfold) | [Input](./backend-es/test-snapshots/src/Snapshot.Fusion02.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Fusion02.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Fusion02.js) |
27+| Recursion Schemes | [Input](./backend-es/test-snapshots/src/Snapshot.RecursionSchemes01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.RecursionSchemes01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.RecursionSchemes01.js) |
28+| HTML DSL | [Input](./backend-es/test-snapshots/src/Snapshot.Html.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.Html.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.Html.js) |
29+| Imperative Loops | [Input](./backend-es/test-snapshots/src/Snapshot.HalogenVDomST01.purs) | [Output](https://try.purescript.org/?view=output&js=true&github=aristanetworks/purescript-backend-optimizer/main/backend-es/test-snapshots/src/Snapshot.HalogenVDomST01.purs) | [Output](./backend-es/test-snapshots/snapshots-out/Snapshot.HalogenVDomST01.js) |
30+
31+
3032
3133## ECMAScript Backend
3234
@@ -119,7 +121,7 @@ myAdd a b = a + b
119121```
120122
121123The `myAdd` function would likely already be inlined since it is so small, but
122−to guarantee that it is always inlined after two argments are applied, you would
124+to guarantee that it is always inlined after two arguments are applied, you would
123125write the following directive:
124126
125127```
@@ -229,6 +231,12 @@ Precedence applies in the following order (most specific to least specific):
229231| Module A's header, `@inline export` module A directive | Module A's usages in all modules |
230232| Default heuristics | All modules |
231233
234+## Tracing Optimizations
235+
236+`purs-backend-es` can also trace the rewrite passes taken when optimizing a
237+top-level expression via the `--trace-rewrites` CLI arg. This may help in
238+debugging an unexpected or non-optimal result.
239+
232240## Semantics
233241
234242`purescript-backend-optimizer` consumes the PureScript compiler's high-level
backend-es/package-lock.jsondeleted−569
@@ -1,569 +0,0 @@
1−{
2− "name": "purs-backend-es",
3− "version": "1.3.2",
4− "lockfileVersion": 2,
5− "requires": true,
6− "packages": {
7− "": {
8− "name": "purs-backend-es",
9− "version": "1.3.2",
10− "license": "MIT",
11− "bin": {
12− "purs-backend-es": "index.js"
13− },
14− "devDependencies": {
15− "esbuild": "^0.15.5"
16− }
17− },
18− "node_modules/@esbuild/linux-loong64": {
19− "version": "0.15.5",
20− "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.5.tgz",
21− "integrity": "sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==",
22− "cpu": [
23− "loong64"
24− ],
25− "dev": true,
26− "optional": true,
27− "os": [
28− "linux"
29− ],
30− "engines": {
31− "node": ">=12"
32− }
33− },
34− "node_modules/esbuild": {
35− "version": "0.15.5",
36− "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.5.tgz",
37− "integrity": "sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg==",
38− "dev": true,
39− "hasInstallScript": true,
40− "bin": {
41− "esbuild": "bin/esbuild"
42− },
43− "engines": {
44− "node": ">=12"
45− },
46− "optionalDependencies": {
47− "@esbuild/linux-loong64": "0.15.5",
48− "esbuild-android-64": "0.15.5",
49− "esbuild-android-arm64": "0.15.5",
50− "esbuild-darwin-64": "0.15.5",
51− "esbuild-darwin-arm64": "0.15.5",
52− "esbuild-freebsd-64": "0.15.5",
53− "esbuild-freebsd-arm64": "0.15.5",
54− "esbuild-linux-32": "0.15.5",
55− "esbuild-linux-64": "0.15.5",
56− "esbuild-linux-arm": "0.15.5",
57− "esbuild-linux-arm64": "0.15.5",
58− "esbuild-linux-mips64le": "0.15.5",
59− "esbuild-linux-ppc64le": "0.15.5",
60− "esbuild-linux-riscv64": "0.15.5",
61− "esbuild-linux-s390x": "0.15.5",
62− "esbuild-netbsd-64": "0.15.5",
63− "esbuild-openbsd-64": "0.15.5",
64− "esbuild-sunos-64": "0.15.5",
65− "esbuild-windows-32": "0.15.5",
66− "esbuild-windows-64": "0.15.5",
67− "esbuild-windows-arm64": "0.15.5"
68− }
69− },
70− "node_modules/esbuild-android-64": {
71− "version": "0.15.5",
72− "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.5.tgz",
73− "integrity": "sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg==",
74− "cpu": [
75− "x64"
76− ],
77− "dev": true,
78− "optional": true,
79− "os": [
80− "android"
81− ],
82− "engines": {
83− "node": ">=12"
84− }
85− },
86− "node_modules/esbuild-android-arm64": {
87− "version": "0.15.5",
88− "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.5.tgz",
89− "integrity": "sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg==",
90− "cpu": [
91− "arm64"
92− ],
93− "dev": true,
94− "optional": true,
95− "os": [
96− "android"
97− ],
98− "engines": {
99− "node": ">=12"
100− }
101− },
102− "node_modules/esbuild-darwin-64": {
103− "version": "0.15.5",
104− "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.5.tgz",
105− "integrity": "sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ==",
106− "cpu": [
107− "x64"
108− ],
109− "dev": true,
110− "optional": true,
111− "os": [
112− "darwin"
113− ],
114− "engines": {
115− "node": ">=12"
116− }
117− },
118− "node_modules/esbuild-darwin-arm64": {
119− "version": "0.15.5",
120− "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.5.tgz",
121− "integrity": "sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg==",
122− "cpu": [
123− "arm64"
124− ],
125− "dev": true,
126− "optional": true,
127− "os": [
128− "darwin"
129− ],
130− "engines": {
131− "node": ">=12"
132− }
133− },
134− "node_modules/esbuild-freebsd-64": {
135− "version": "0.15.5",
136− "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.5.tgz",
137− "integrity": "sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA==",
138− "cpu": [
139− "x64"
140− ],
141− "dev": true,
142− "optional": true,
143− "os": [
144− "freebsd"
145− ],
146− "engines": {
147− "node": ">=12"
148− }
149− },
150− "node_modules/esbuild-freebsd-arm64": {
151− "version": "0.15.5",
152− "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.5.tgz",
153− "integrity": "sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w==",
154− "cpu": [
155− "arm64"
156− ],
157− "dev": true,
158− "optional": true,
159− "os": [
160− "freebsd"
161− ],
162− "engines": {
163− "node": ">=12"
164− }
165− },
166− "node_modules/esbuild-linux-32": {
167− "version": "0.15.5",
168− "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.5.tgz",
169− "integrity": "sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ==",
170− "cpu": [
171− "ia32"
172− ],
173− "dev": true,
174− "optional": true,
175− "os": [
176− "linux"
177− ],
178− "engines": {
179− "node": ">=12"
180− }
181− },
182− "node_modules/esbuild-linux-64": {
183− "version": "0.15.5",
184− "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.5.tgz",
185− "integrity": "sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg==",
186− "cpu": [
187− "x64"
188− ],
189− "dev": true,
190− "optional": true,
191− "os": [
192− "linux"
193− ],
194− "engines": {
195− "node": ">=12"
196− }
197− },
198− "node_modules/esbuild-linux-arm": {
199− "version": "0.15.5",
200− "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.5.tgz",
201− "integrity": "sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q==",
202− "cpu": [
203− "arm"
204− ],
205− "dev": true,
206− "optional": true,
207− "os": [
208− "linux"
209− ],
210− "engines": {
211− "node": ">=12"
212− }
213− },
214− "node_modules/esbuild-linux-arm64": {
215− "version": "0.15.5",
216− "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.5.tgz",
217− "integrity": "sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA==",
218− "cpu": [
219− "arm64"
220− ],
221− "dev": true,
222− "optional": true,
223− "os": [
224− "linux"
225− ],
226− "engines": {
227− "node": ">=12"
228− }
229− },
230− "node_modules/esbuild-linux-mips64le": {
231− "version": "0.15.5",
232− "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.5.tgz",
233− "integrity": "sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ==",
234− "cpu": [
235− "mips64el"
236− ],
237− "dev": true,
238− "optional": true,
239− "os": [
240− "linux"
241− ],
242− "engines": {
243− "node": ">=12"
244− }
245− },
246− "node_modules/esbuild-linux-ppc64le": {
247− "version": "0.15.5",
248− "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.5.tgz",
249− "integrity": "sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw==",
250− "cpu": [
251− "ppc64"
252− ],
253− "dev": true,
254− "optional": true,
255− "os": [
256− "linux"
257− ],
258− "engines": {
259− "node": ">=12"
260− }
261− },
262− "node_modules/esbuild-linux-riscv64": {
263− "version": "0.15.5",
264− "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.5.tgz",
265− "integrity": "sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA==",
266− "cpu": [
267− "riscv64"
268− ],
269− "dev": true,
270− "optional": true,
271− "os": [
272− "linux"
273− ],
274− "engines": {
275− "node": ">=12"
276− }
277− },
278− "node_modules/esbuild-linux-s390x": {
279− "version": "0.15.5",
280− "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.5.tgz",
281− "integrity": "sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ==",
282− "cpu": [
283− "s390x"
284− ],
285− "dev": true,
286− "optional": true,
287− "os": [
288− "linux"
289− ],
290− "engines": {
291− "node": ">=12"
292− }
293− },
294− "node_modules/esbuild-netbsd-64": {
295− "version": "0.15.5",
296− "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.5.tgz",
297− "integrity": "sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w==",
298− "cpu": [
299− "x64"
300− ],
301− "dev": true,
302− "optional": true,
303− "os": [
304− "netbsd"
305− ],
306− "engines": {
307− "node": ">=12"
308− }
309− },
310− "node_modules/esbuild-openbsd-64": {
311− "version": "0.15.5",
312− "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.5.tgz",
313− "integrity": "sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA==",
314− "cpu": [
315− "x64"
316− ],
317− "dev": true,
318− "optional": true,
319− "os": [
320− "openbsd"
321− ],
322− "engines": {
323− "node": ">=12"
324− }
325− },
326− "node_modules/esbuild-sunos-64": {
327− "version": "0.15.5",
328− "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.5.tgz",
329− "integrity": "sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA==",
330− "cpu": [
331− "x64"
332− ],
333− "dev": true,
334− "optional": true,
335− "os": [
336− "sunos"
337− ],
338− "engines": {
339− "node": ">=12"
340− }
341− },
342− "node_modules/esbuild-windows-32": {
343− "version": "0.15.5",
344− "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.5.tgz",
345− "integrity": "sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg==",
346− "cpu": [
347− "ia32"
348− ],
349− "dev": true,
350− "optional": true,
351− "os": [
352− "win32"
353− ],
354− "engines": {
355− "node": ">=12"
356− }
357− },
358− "node_modules/esbuild-windows-64": {
359− "version": "0.15.5",
360− "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.5.tgz",
361− "integrity": "sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw==",
362− "cpu": [
363− "x64"
364− ],
365− "dev": true,
366− "optional": true,
367− "os": [
368− "win32"
369− ],
370− "engines": {
371− "node": ">=12"
372− }
373− },
374− "node_modules/esbuild-windows-arm64": {
375− "version": "0.15.5",
376− "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.5.tgz",
377− "integrity": "sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA==",
378− "cpu": [
379− "arm64"
380− ],
381− "dev": true,
382− "optional": true,
383− "os": [
384− "win32"
385− ],
386− "engines": {
387− "node": ">=12"
388− }
389− }
390− },
391− "dependencies": {
392− "@esbuild/linux-loong64": {
393− "version": "0.15.5",
394− "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.5.tgz",
395− "integrity": "sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==",
396− "dev": true,
397− "optional": true
398− },
399− "esbuild": {
400− "version": "0.15.5",
401− "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.5.tgz",
402− "integrity": "sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg==",
403− "dev": true,
404− "requires": {
405− "@esbuild/linux-loong64": "0.15.5",
406− "esbuild-android-64": "0.15.5",
407− "esbuild-android-arm64": "0.15.5",
408− "esbuild-darwin-64": "0.15.5",
409− "esbuild-darwin-arm64": "0.15.5",
410− "esbuild-freebsd-64": "0.15.5",
411− "esbuild-freebsd-arm64": "0.15.5",
412− "esbuild-linux-32": "0.15.5",
413− "esbuild-linux-64": "0.15.5",
414− "esbuild-linux-arm": "0.15.5",
415− "esbuild-linux-arm64": "0.15.5",
416− "esbuild-linux-mips64le": "0.15.5",
417− "esbuild-linux-ppc64le": "0.15.5",
418− "esbuild-linux-riscv64": "0.15.5",
419− "esbuild-linux-s390x": "0.15.5",
420− "esbuild-netbsd-64": "0.15.5",
421− "esbuild-openbsd-64": "0.15.5",
422− "esbuild-sunos-64": "0.15.5",
423− "esbuild-windows-32": "0.15.5",
424− "esbuild-windows-64": "0.15.5",
425− "esbuild-windows-arm64": "0.15.5"
426− }
427− },
428− "esbuild-android-64": {
429− "version": "0.15.5",
430− "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.5.tgz",
431− "integrity": "sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg==",
432− "dev": true,
433− "optional": true
434− },
435− "esbuild-android-arm64": {
436− "version": "0.15.5",
437− "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.5.tgz",
438− "integrity": "sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg==",
439− "dev": true,
440− "optional": true
441− },
442− "esbuild-darwin-64": {
443− "version": "0.15.5",
444− "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.5.tgz",
445− "integrity": "sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ==",
446− "dev": true,
447− "optional": true
448− },
449− "esbuild-darwin-arm64": {
450− "version": "0.15.5",
451− "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.5.tgz",
452− "integrity": "sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg==",
453− "dev": true,
454− "optional": true
455− },
456− "esbuild-freebsd-64": {
457− "version": "0.15.5",
458− "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.5.tgz",
459− "integrity": "sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA==",
460− "dev": true,
461− "optional": true
462− },
463− "esbuild-freebsd-arm64": {
464− "version": "0.15.5",
465− "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.5.tgz",
466− "integrity": "sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w==",
467− "dev": true,
468− "optional": true
469− },
470− "esbuild-linux-32": {
471− "version": "0.15.5",
472− "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.5.tgz",
473− "integrity": "sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ==",
474− "dev": true,
475− "optional": true
476− },
477− "esbuild-linux-64": {
478− "version": "0.15.5",
479− "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.5.tgz",
480− "integrity": "sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg==",
481− "dev": true,
482− "optional": true
483− },
484− "esbuild-linux-arm": {
485− "version": "0.15.5",
486− "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.5.tgz",
487− "integrity": "sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q==",
488− "dev": true,
489− "optional": true
490− },
491− "esbuild-linux-arm64": {
492− "version": "0.15.5",
493− "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.5.tgz",
494− "integrity": "sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA==",
495− "dev": true,
496− "optional": true
497− },
498− "esbuild-linux-mips64le": {
499− "version": "0.15.5",
500− "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.5.tgz",
501− "integrity": "sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ==",
502− "dev": true,
503− "optional": true
504− },
505− "esbuild-linux-ppc64le": {
506− "version": "0.15.5",
507− "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.5.tgz",
508− "integrity": "sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw==",
509− "dev": true,
510− "optional": true
511− },
512− "esbuild-linux-riscv64": {
513− "version": "0.15.5",
514− "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.5.tgz",
515− "integrity": "sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA==",
516− "dev": true,
517− "optional": true
518− },
519− "esbuild-linux-s390x": {
520− "version": "0.15.5",
521− "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.5.tgz",
522− "integrity": "sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ==",
523− "dev": true,
524− "optional": true
525− },
526− "esbuild-netbsd-64": {
527− "version": "0.15.5",
528− "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.5.tgz",
529− "integrity": "sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w==",
530− "dev": true,
531− "optional": true
532− },
533− "esbuild-openbsd-64": {
534− "version": "0.15.5",
535− "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.5.tgz",
536− "integrity": "sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA==",
537− "dev": true,
538− "optional": true
539− },
540− "esbuild-sunos-64": {
541− "version": "0.15.5",
542− "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.5.tgz",
543− "integrity": "sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA==",
544− "dev": true,
545− "optional": true
546− },
547− "esbuild-windows-32": {
548− "version": "0.15.5",
549− "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.5.tgz",
550− "integrity": "sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg==",
551− "dev": true,
552− "optional": true
553− },
554− "esbuild-windows-64": {
555− "version": "0.15.5",
556− "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.5.tgz",
557− "integrity": "sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw==",
558− "dev": true,
559− "optional": true
560− },
561− "esbuild-windows-arm64": {
562− "version": "0.15.5",
563− "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.5.tgz",
564− "integrity": "sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA==",
565− "dev": true,
566− "optional": true
567− }
568− }
569−}
backend-es/package.json+5−8
@@ -1,6 +1,6 @@
11{
22 "name": "purs-backend-es",
3− "version": "1.3.2",
3+ "version": "1.4.3",
44 "description": "A modern ECMAScript optimizing backend for PureScript",
55 "main": "index.js",
66 "type": "module",
@@ -17,9 +17,9 @@
1717 "preversion": "npm run test && npm run test:output-diff",
1818 "version": "echo 'export const version = \"v'$npm_package_version'\";' > ./src/Version.js && git add .",
1919 "postversion": "git commit -m \"Bump purs-backend-es version ($npm_package_version)\" && git tag purs-backend-es-v$npm_package_version",
20− "test": "cd .. && spago test",
21− "test:output-diff": "npm run build && cd ../ && ./backend-es/index.js build --int-tags --output-dir=output-es2 && diff -r output-es output-es2 && rm -r output-es2",
22− "build": "cd .. && spago build -u '-g corefn,js' && node ./backend-es/index.dev.js bundle-module -m Main --int-tags --platform=node --minify --to=./backend-es/bundle/index.js",
20+ "test": "cd .. && npm run test",
21+ "test:output-diff": "npm run build && cd ../ && ./backend-es/index.js build --timing --int-tags --output-dir=output-es2 && diff -r output-es output-es2 && rm -r output-es2",
22+ "build": "cd .. && npm run build && node ./backend-es/index.dev.js bundle-module -m Main --timing --int-tags --platform=node --minify --to=./backend-es/bundle/index.js",
2323 "prepublishOnly": "rm -rf bundle ../output ../output-es && npm run build"
2424 },
2525 "repository": {
@@ -36,8 +36,5 @@
3636 "bugs": {
3737 "url": "https://github.com/aristanetworks/purescript-backend-optimizer/issues"
3838 },
39− "homepage": "https://github.com/aristanetworks/purescript-backend-optimizer#readme",
40− "devDependencies": {
41− "esbuild": "^0.15.5"
42− }
39+ "homepage": "https://github.com/aristanetworks/purescript-backend-optimizer#readme"
4340}
backend-es/runtime.js+6
@@ -25,3 +25,9 @@ export function* range(lo, hi) {
2525export function fail() {
2626 throw new Error("Failed pattern match");
2727}
28+
29+export function intDiv(x, y) {
30+ if (y > 0) return Math.floor(x / y);
31+ if (y < 0) return -Math.floor(x / -y);
32+ return 0;
33+}
backend-es/spago.yamlnew file+48
@@ -0,0 +1,48 @@
1+package:
2+ name: backend-es
3+ dependencies:
4+ - aff: ">=8.0.0 <9.0.0"
5+ - argonaut: ">=9.0.0 <10.0.0"
6+ - argparse-basic: ">=2.0.0 <3.0.0"
7+ - arrays: ">=7.3.0 <8.0.0"
8+ - backend-optimizer: "*"
9+ - bifunctors: ">=6.1.0 <7.0.0"
10+ - console: ">=6.1.0 <7.0.0"
11+ - control: ">=6.0.0 <7.0.0"
12+ - datetime: ">=6.1.0 <7.0.0"
13+ - dodo-printer: ">=2.2.3 <3.0.0"
14+ - effect: ">=4.0.0 <5.0.0"
15+ - either: ">=6.1.0 <7.0.0"
16+ - enums: ">=6.0.1 <7.0.0"
17+ - filterable: ">=5.0.0 <6.0.0"
18+ - foldable-traversable: ">=6.0.0 <7.0.0"
19+ - language-cst-parser: ">=0.14.1 <0.15.0"
20+ - lazy: ">=6.0.0 <7.0.0"
21+ - lists: ">=7.0.0 <8.0.0"
22+ - maybe: ">=6.0.0 <7.0.0"
23+ - newtype: ">=5.0.0 <6.0.0"
24+ - node-buffer: ">=9.0.0 <10.0.0"
25+ - node-child-process: ">=11.1.0 <12.0.0"
26+ - node-event-emitter: ">=3.0.0 <4.0.0"
27+ - node-fs: ">=9.2.0 <10.0.0"
28+ - node-glob-basic: ">=2.0.0 <3.0.0"
29+ - node-path: ">=5.0.1 <6.0.0"
30+ - node-process: ">=11.2.0 <12.0.0"
31+ - node-streams: ">=9.0.1 <10.0.0"
32+ - now: ">=6.0.0 <7.0.0"
33+ - nullable: ">=6.0.0 <7.0.0"
34+ - numbers: ">=9.0.1 <10.0.0"
35+ - ordered-collections: ">=3.2.0 <4.0.0"
36+ - orders: ">=6.0.0 <7.0.0"
37+ - parallel: ">=7.0.0 <8.0.0"
38+ - partial: ">=4.0.0 <5.0.0"
39+ - posix-types: ">=6.0.0 <7.0.0"
40+ - prelude: ">=6.0.2 <7.0.0"
41+ - refs: ">=6.0.0 <7.0.0"
42+ - strings: ">=6.0.1 <7.0.0"
43+ - transformers: ">=6.1.0 <7.0.0"
44+ - tuples: ">=7.0.0 <8.0.0"
45+ test:
46+ main: Test.Main
47+ dependencies:
48+ - ansi
backend-es/src/Main.purs+175−31
@@ -6,26 +6,40 @@ import ArgParse.Basic (ArgParser)
66import ArgParse.Basic as ArgParser
77import Control.Plus (empty)
88import Data.Array as Array
9+import Data.Bifunctor (bimap)
10+import Data.DateTime.Instant (Instant)
11+import Data.DateTime.Instant as Instant
912import Data.Either (Either(..), isRight)
1013import Data.Foldable (foldMap, for_, oneOf)
14+import Data.Function (on)
15+import Data.Map (Map)
1116import Data.Map as Map
1217import Data.Maybe (Maybe(..), fromMaybe, maybe)
1318import Data.Monoid (guard, power)
14−import Data.Newtype (unwrap)
19+import Data.Newtype (over2, unwrap)
20+import Data.Nullable (toMaybe)
21+import Data.Number.Format as Number
22+import Data.Ord.Down (Down(..))
1523import Data.Posix.Signal (Signal(..))
24+import Data.Set (Set)
1625import Data.Set as Set
17−import Data.String (Pattern(..))
26+import Data.String (Pattern(..), Replacement(..))
1827import Data.String as String
1928import Data.String.CodeUnits as SCU
2029import Data.Traversable (traverse)
30+import Data.Tuple (Tuple(..), fst, snd, uncurry)
2131import Dodo as Dodo
32+import Dodo.Box as Dodo.Box
2233import Effect (Effect)
23−import Effect.Aff (Aff, attempt, effectCanceler, error, launchAff_, makeAff, throwError)
34+import Effect.Aff (Aff, Milliseconds(..), attempt, effectCanceler, error, launchAff_, makeAff, nonCanceler, throwError)
2435import Effect.Class (liftEffect)
2536import Effect.Class.Console as Console
26−import Node.ChildProcess (Exit(..), StdIOBehaviour(..), defaultSpawnOptions)
27−import Node.ChildProcess as ChildProcess
37+import Effect.Now (now)
38+import Effect.Ref (Ref)
39+import Effect.Ref as Ref
40+import Node.ChildProcess.Types (Exit(..), enableShell, pipe, shareStream)
2841import Node.Encoding (Encoding(..))
42+import Node.EventEmitter (on_)
2943import Node.FS.Aff (writeTextFile)
3044import Node.FS.Aff as FS
3145import Node.FS.Perms as Perms
@@ -34,15 +48,21 @@ import Node.FS.Stream (createReadStream, createWriteStream)
3448import Node.Path (FilePath)
3549import Node.Path as Path
3650import Node.Process as Process
51+import Node.Stream (errorH, finishH)
3752import Node.Stream as Stream
53+import Node.UnsafeChildProcess.Safe (exitH, killSignal)
54+import Node.UnsafeChildProcess.Unsafe as UnsafeChildProcess
3855import PureScript.Backend.Optimizer.Codegen.EcmaScript (codegenModule, esModulePath)
3956import PureScript.Backend.Optimizer.Codegen.EcmaScript.Builder (basicBuildMain, externalDirectivesFromFile)
4057import PureScript.Backend.Optimizer.Codegen.EcmaScript.Foreign (esForeignSemantics)
41−import PureScript.Backend.Optimizer.CoreFn (Module(..), ModuleName(..))
58+import PureScript.Backend.Optimizer.Convert (OptimizationSteps)
59+import PureScript.Backend.Optimizer.CoreFn (Ident(..), Module(..), ModuleName(..), Qualified(..))
4260import PureScript.Backend.Optimizer.Semantics.Foreign (coreForeignSemantics)
61+import PureScript.Backend.Optimizer.Tracer.Printer (printModuleSteps)
62+import PureScript.CST.Lexer (lexToken)
4363import PureScript.CST.Lexer as Lexer
4464import PureScript.CST.Types (Token(..))
45−import Unsafe.Coerce (unsafeCoerce)
65+import PureScript.CST.Types as CST
4666import Version as Version
4767
4868type BuildArgs =
@@ -51,6 +71,8 @@ type BuildArgs =
5171 , foreignDir :: Maybe FilePath
5272 , directivesFile :: Maybe FilePath
5373 , intTags :: Boolean
74+ , traceIdents :: Set (Qualified Ident)
75+ , printTiming :: Boolean
5476 }
5577
5678buildArgsParser :: ArgParser BuildArgs
@@ -79,6 +101,24 @@ buildArgsParser =
79101 "Use integers for tags in codegen instead of strings."
80102 # ArgParser.boolean
81103 # ArgParser.default false
104+ , traceIdents:
105+ ArgParser.argument [ "--trace-rewrites" ]
106+ "Traces rewrite passes for a top-level definition during optimizations.\n\
107+ \Outputs results to optimization-traces.txt."
108+ # ArgParser.unformat "QUALIFIED_NAME"
109+ ( \str ->
110+ case lexToken str of
111+ Right (CST.TokLowerName (Just (CST.ModuleName mod)) ident) ->
112+ Right $ Set.singleton $ Qualified (Just (ModuleName mod)) (Ident ident)
113+ _ ->
114+ Left $ "Unable to parse qualified name: " <> str
115+ )
116+ # ArgParser.folded
117+ , printTiming:
118+ ArgParser.flag [ "--timing" ]
119+ "Print timing data for modules."
120+ # ArgParser.boolean
121+ # ArgParser.default false
82122 }
83123
84124data TargetPlatform = Browser | Node
@@ -176,8 +216,17 @@ parseArgs = do
176216 esArgParser
177217 cliArgs
178218
219+type BuildState =
220+ { currentStartTime :: Ref (Maybe Instant)
221+ , codegenStartTime :: Ref (Maybe Instant)
222+ , codegenTotal :: Ref Milliseconds
223+ , startTime :: Instant
224+ , steps :: Ref (Array (Tuple ModuleName OptimizationSteps))
225+ , timings :: Ref (Map ModuleName Milliseconds)
226+ }
227+
179228main :: FilePath -> Effect Unit
180−main cliRoot =
229+main cliRoot = do
181230 parseArgs >>= case _ of
182231 Left err ->
183232 Console.error $ ArgParser.printArgError err
@@ -190,17 +239,52 @@ main cliRoot =
190239 unless bundleArgs.noBuild $ buildCmd args
191240 bundleCmd true bundleArgs args
192241 where
242+ makeBuildState :: Effect BuildState
243+ makeBuildState = do
244+ startTime <- now
245+ currentStartTime <- Ref.new Nothing
246+ codegenStartTime <- Ref.new Nothing
247+ codegenTotal <- Ref.new mempty
248+ steps <- Ref.new []
249+ timings <- Ref.new Map.empty
250+ pure { currentStartTime, codegenStartTime, codegenTotal, startTime, steps, timings }
251+
193252 buildCmd :: BuildArgs -> Aff Unit
194− buildCmd args = basicBuildMain
253+ buildCmd args = liftEffect makeBuildState >>= \state -> basicBuildMain
195254 { resolveCoreFnDirectory: pure args.coreFnDir
196255 , resolveExternalDirectives: map (fromMaybe Map.empty) $ traverse externalDirectivesFromFile args.directivesFile
256+ , analyzeCustom: \_ _ -> Nothing
197257 , foreignSemantics: Map.union coreForeignSemantics esForeignSemantics
198258 , onCodegenBefore: do
259+ liftEffect $ flip Ref.write state.codegenStartTime <<< Just =<< now
199260 mkdirp args.outputDir
200261 writeTextFile UTF8 (Path.concat [ args.outputDir, "package.json" ]) esModulePackageJson
201262 copyFile (Path.concat [ cliRoot, "runtime.js" ]) (Path.concat [ args.outputDir, "runtime.js" ])
202− , onCodegenAfter: mempty
203− , onCodegenModule: \build (Module coreFnMod) backendMod@{ name: ModuleName name } -> do
263+ , onCodegenAfter: do
264+ allSteps <- liftEffect (Ref.read state.steps)
265+ when args.printTiming do
266+ endTime <- liftEffect now
267+ codegenStartTime <- fromMaybe state.startTime <$> liftEffect (Ref.read state.codegenStartTime)
268+ codegenTiming <- liftEffect $ Ref.read state.codegenTotal
269+ timings <- Array.sortBy (comparing (Down <<< snd)) <<< Map.toUnfoldable <$> liftEffect (Ref.read state.timings)
270+ let topTimings = Array.take 20 timings
271+ let totalTiming = timeDiff state.startTime endTime
272+ let parseTiming = timeDiff state.startTime codegenStartTime
273+ let buildTiming = over2 Milliseconds (-) (timeDiff codegenStartTime endTime) codegenTiming
274+ Console.log $ "\nTop " <> show (Array.length topTimings) <> " slowest modules:"
275+ Console.log $ printTimings topTimings
276+ Console.log ""
277+ Console.log $ printTotals
278+ [ Tuple "Parse time" parseTiming
279+ , Tuple "Build time" buildTiming
280+ , Tuple "Codegen time" codegenTiming
281+ , Tuple "Total time" totalTiming
282+ ]
283+ unless (Array.null allSteps) do
284+ let allDoc = Dodo.foldWithSeparator (Dodo.break <> Dodo.break) $ uncurry printModuleSteps <$> allSteps
285+ FS.writeTextFile UTF8 "optimization-traces.txt" $ Dodo.print Dodo.plainText Dodo.twoSpaces allDoc
286+ , onCodegenModule: \build (Module coreFnMod) backendMod@{ name: ModuleName name } optimizationSteps -> do
287+ optEndTime <- liftEffect now
204288 let formatted = Dodo.print Dodo.plainText (Dodo.twoSpaces { pageWidth = 180, ribbonRatio = 1.0 }) $ codegenModule { intTags: args.intTags } build.implementations backendMod
205289 let modPath = Path.concat [ args.outputDir, name ]
206290 mkdirp modPath
@@ -215,12 +299,29 @@ main cliRoot =
215299 ]
216300 unless (isRight res) do
217301 Console.log $ " Foreign implementation missing."
302+ unless (Array.null optimizationSteps) do
303+ liftEffect $ Ref.modify_ (flip Array.snoc (Tuple backendMod.name optimizationSteps)) state.steps
304+ mbStartTime <- liftEffect $ Ref.read state.currentStartTime
305+ for_ mbStartTime \startTime -> do
306+ moduleEndTime <- liftEffect now
307+ let codegenTotal = timeDiff optEndTime moduleEndTime
308+ let timingTotal = timeDiff startTime moduleEndTime
309+ liftEffect $ Ref.modify_ (codegenTotal <> _) state.codegenTotal
310+ liftEffect $ Ref.modify_ (Map.insert backendMod.name timingTotal) state.timings
311+ writeString Process.stdout $ formatMs timingTotal <> "\n"
312+
218313 , onPrepareModule: \build coreFnMod@(Module { name }) -> do
219314 let total = show build.moduleCount
220315 let index = show (build.moduleIndex + 1)
221316 let padding = power " " (SCU.length total - SCU.length index)
222− Console.log $ "[" <> padding <> index <> " of " <> total <> "] Building " <> unwrap name
317+ let msg = "[" <> padding <> index <> " of " <> total <> "] Building " <> unwrap name
318+ if args.printTiming then do
319+ liftEffect $ flip Ref.write state.currentStartTime <<< Just =<< now
320+ writeString Process.stdout $ msg <> "... "
321+ else
322+ Console.log msg
223323 pure coreFnMod
324+ , traceIdents: args.traceIdents
224325 }
225326
226327 bundleCmd :: Boolean -> BundleArgs -> BuildArgs -> Aff Unit
@@ -243,8 +344,11 @@ main cliRoot =
243344 , "--outfile=" <> bundleArgs.targetFile
244345 , "--bundle"
245346 ]
246− if shouldInvokeMain then do
247− spawnFromParentWithStdin "esbuild" esBuildArgs $ Just $ "import { main } from '" <> entryPath <> "'; main();"
347+ fixBackSlash = String.replaceAll (Pattern "\\") (Replacement "\\\\")
348+ if shouldInvokeMain then
349+ spawnFromParentWithStdin "esbuild" esBuildArgs
350+ $ Just
351+ $ "import { main } from '" <> fixBackSlash entryPath <> "'; main();"
248352 else
249353 spawnFromParentWithStdin "esbuild" (Array.snoc esBuildArgs entryPath) Nothing
250354
@@ -256,16 +360,19 @@ copyFile from to = do
256360 makeAff \k -> do
257361 src <- createReadStream from
258362 dst <- createWriteStream to
259− res <- Stream.pipe src dst
260− Stream.onError src (k <<< Left)
261− Stream.onError dst (k <<< Left)
262− Stream.onError res (k <<< Left)
263− Stream.onFinish res (k (Right unit))
363+ Stream.pipe src dst
364+ src # on_ errorH (k <<< Left)
365+ dst # on_ errorH (k <<< Left)
366+ dst # on_ finishH (k (Right unit))
264367 pure $ effectCanceler do
265− Stream.destroy res
266368 Stream.destroy dst
267369 Stream.destroy src
268370
371+writeString :: forall r. Stream.Writable r -> String -> Aff Unit
372+writeString stream str = makeAff \k -> do
373+ _ <- Stream.writeString' stream UTF8 str (k <<< maybe (Right unit) Left)
374+ pure nonCanceler
375+
269376mkdirp :: FilePath -> Aff Unit
270377mkdirp = flip FS.mkdir' { recursive: true, mode: Perms.mkPerms Perms.all Perms.all Perms.all }
271378
@@ -274,21 +381,58 @@ esModulePackageJson = """{"type": "module"}"""
274381
275382spawnFromParentWithStdin :: String -> Array String -> Maybe String -> Aff Unit
276383spawnFromParentWithStdin command args input = makeAff \k -> do
277− childProc <- ChildProcess.spawn command args defaultSpawnOptions
278− { stdio =
279− [ Just $ Pipe
280− , Just $ ShareStream (unsafeCoerce Process.stdout)
281− , Just $ ShareStream (unsafeCoerce Process.stderr)
384+ -- To preserve colors in stdout need to pass it into spawn's stdio.
385+ childProc <- UnsafeChildProcess.spawn' command args
386+ { stdio:
387+ [ pipe
388+ , shareStream Process.stdout
389+ , shareStream Process.stderr
282390 ]
391+ , shell: enableShell
283392 }
393+
284394 for_ input \inp -> do
285− _ <- Stream.writeString (ChildProcess.stdin childProc) UTF8 inp mempty
286− Stream.end (ChildProcess.stdin childProc) mempty
287− ChildProcess.onExit childProc case _ of
395+ for_ (toMaybe $ UnsafeChildProcess.unsafeStdin childProc) \stdin -> do
396+ _ <- Stream.writeString stdin UTF8 inp
397+ Stream.end stdin
398+ childProc # on_ exitH case _ of
288399 Normally code
289− | code > 0 -> Process.exit code
400+ | code > 0 -> Process.exit' code
290401 | otherwise -> k (Right unit)
291402 BySignal _ ->
292− Process.exit 1
403+ Process.exit' 1
293404 pure $ effectCanceler do
294− ChildProcess.kill SIGABRT childProc
405+ void $ killSignal SIGABRT childProc
406+
407+timeDiff :: Instant -> Instant -> Milliseconds
408+timeDiff = over2 Milliseconds (flip (-)) `on` Instant.unInstant
409+
410+formatMs :: Milliseconds -> String
411+formatMs (Milliseconds m) = Number.toString m <> "ms"
412+
413+printTimings :: Array (Tuple ModuleName Milliseconds) -> String
414+printTimings =
415+ Dodo.print Dodo.plainText Dodo.twoSpaces
416+ <<< Dodo.indent
417+ <<< printTable
418+ <<< map (bimap (Dodo.text <<< append "* " <<< unwrap) (Dodo.text <<< formatMs))
419+
420+printTotals :: Array (Tuple String Milliseconds) -> String
421+printTotals =
422+ Dodo.print Dodo.plainText Dodo.twoSpaces
423+ <<< printTable
424+ <<< map (bimap Dodo.text (Dodo.text <<< formatMs))
425+
426+printTable :: forall a. Array (Tuple (Dodo.Doc a) (Dodo.Doc a)) -> Dodo.Doc a
427+printTable all = Dodo.Box.toDoc table
428+ where
429+ toBox = Dodo.print Dodo.Box.docBox Dodo.twoSpaces
430+ columns = bimap toBox toBox <$> all
431+ col1Width = fromMaybe 0 $ Array.last $ Array.sort $ (_.width <<< Dodo.Box.sizeOf <<< fst) <$> columns
432+ col2Width = fromMaybe 0 $ Array.last $ Array.sort $ (_.width <<< Dodo.Box.sizeOf <<< snd) <$> columns
433+ table = Dodo.Box.vertical $ printRow <$> columns
434+ printRow (Tuple a b) = Dodo.Box.horizontal
435+ [ Dodo.Box.resize { height: 1, width: col1Width } a
436+ , Dodo.Box.hpadding 3
437+ , Dodo.Box.resize { height: 1, width: col2Width } (Dodo.Box.halign Dodo.Box.End b)
438+ ]
backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Builder.purs+13−6
@@ -15,7 +15,8 @@ import Data.Lazy as Lazy
1515import Data.List (List)
1616import Data.Map (Map)
1717import Data.Map as Map
18−import Data.Maybe (maybe)
18+import Data.Maybe (Maybe, maybe)
19+import Data.Set (Set)
1920import Data.Set as Set
2021import Data.Set.NonEmpty as NonEmptySet
2122import Data.Tuple (Tuple(..))
@@ -27,15 +28,17 @@ import Node.FS.Aff as FS
2728import Node.Glob.Basic (expandGlobs)
2829import Node.Path (FilePath)
2930import Node.Process as Process
31+import PureScript.Backend.Optimizer.Analysis (BackendAnalysis)
3032import PureScript.Backend.Optimizer.Builder (BuildEnv, buildModules)
31−import PureScript.Backend.Optimizer.Convert (BackendModule)
33+import PureScript.Backend.Optimizer.Convert (BackendModule, OptimizationSteps)
3234import PureScript.Backend.Optimizer.CoreFn (Ann, Ident, Module, ModuleName(..), Qualified)
3335import PureScript.Backend.Optimizer.CoreFn.Json (decodeModule)
3436import PureScript.Backend.Optimizer.CoreFn.Sort (emptyPull, pullResult, resumePull, sortModules)
3537import PureScript.Backend.Optimizer.Directives (parseDirectiveFile)
3638import PureScript.Backend.Optimizer.Directives.Defaults as Defaults
37−import PureScript.Backend.Optimizer.Semantics (InlineDirectiveMap)
39+import PureScript.Backend.Optimizer.Semantics (BackendExpr, Ctx, InlineDirectiveMap)
3840import PureScript.Backend.Optimizer.Semantics.Foreign (ForeignEval)
41+import PureScript.Backend.Optimizer.Syntax (BackendSyntax)
3942import PureScript.CST.Errors (printParseError)
4043
4144coreFnModulesFromOutput :: String -> NonEmptyArray String -> Aff (Either (NonEmptyArray (Tuple FilePath String)) (List (Module Ann)))
@@ -82,11 +85,13 @@ externalDirectivesFromFile filePath = do
8285basicBuildMain
8386 :: { resolveCoreFnDirectory :: Aff FilePath
8487 , resolveExternalDirectives :: Aff InlineDirectiveMap
88+ , analyzeCustom :: Ctx -> BackendSyntax BackendExpr -> Maybe BackendAnalysis
8589 , foreignSemantics :: Map (Qualified Ident) ForeignEval
8690 , onCodegenBefore :: Aff Unit
8791 , onCodegenAfter :: Aff Unit
88− , onCodegenModule :: BuildEnv -> Module Ann -> BackendModule -> Aff Unit
92+ , onCodegenModule :: BuildEnv -> Module Ann -> BackendModule -> OptimizationSteps -> Aff Unit
8993 , onPrepareModule :: BuildEnv -> Module Ann -> Aff (Module Ann)
94+ , traceIdents :: Set (Qualified Ident)
9095 }
9196 -> Aff Unit
9297basicBuildMain options = do
@@ -100,13 +105,15 @@ basicBuildMain options = do
100105 Left errors -> do
101106 for_ errors \(Tuple filePath err) -> do
102107 Console.error $ filePath <> " " <> err
103− liftEffect $ Process.exit 1
108+ liftEffect $ Process.exit' 1
104109 Right coreFnModules -> do
105110 options.onCodegenBefore
106111 coreFnModules # buildModules
107− { directives: allDirectives
112+ { analyzeCustom: options.analyzeCustom
113+ , directives: allDirectives
108114 , foreignSemantics: options.foreignSemantics
109115 , onCodegenModule: options.onCodegenModule
110116 , onPrepareModule: options.onPrepareModule
117+ , traceIdents: options.traceIdents
111118 }
112119 options.onCodegenAfter
backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Convert.purs+17−4
@@ -272,7 +272,9 @@ codegenExpr env@(CodegenEnv { currentModule, inlineApp }) tcoExpr@(TcoExpr _ exp
272272 UncurriedEffectApp a bs ->
273273 case a of
274274 TcoExpr _ (Var qual)
275− | Just expr' <- inlineApp env qual (InlineEffectApp bs) ->
275+ -- This is intentionally invoking this with InlineApp as we
276+ -- are in a "pure" context, rather than binding an uncurried effect.
277+ | Just expr' <- inlineApp env qual (InlineApp bs) ->
276278 expr'
277279 _ ->
278280 codegenEffectBlock env tcoExpr
@@ -291,6 +293,8 @@ codegenExpr env@(CodegenEnv { currentModule, inlineApp }) tcoExpr@(TcoExpr _ exp
291293 [ build $ EsReturn $ Just $ codegenCtor env currentModule ct ty tag $
292294 (build <<< EsIdent <<< Qualified Nothing <<< toEsIdent <<< Ident) <$> fields
293295 ]
296+ CtorSaturated qual _ _ _ [] ->
297+ codegenExpr env (TcoExpr mempty (Var qual))
294298 CtorSaturated (Qualified qual _) ct ty tag fields ->
295299 codegenCtor env (fromMaybe currentModule qual) ct ty tag (codegenExpr env <<< snd <$> fields)
296300 PrimOp op ->
@@ -465,13 +469,18 @@ codegenBlockBranches mode env bs def = case mode.return of
465469 Tuple (codegenExpr env a) $ codegenBlockStatements mode env b
466470
467471codegenBindEffect :: CodegenEnv -> TcoExpr -> EsExpr
468−codegenBindEffect env tcoExpr@(TcoExpr _ expr) = case expr of
472+codegenBindEffect env@(CodegenEnv { inlineApp }) tcoExpr@(TcoExpr _ expr) = case expr of
469473 PrimEffect a ->
470474 codegenPrimEffect env a
471475 Branch _ _ ->
472476 build $ EsCall (esArrowFunction [] (codegenBlockStatements effectMode env tcoExpr)) []
473477 UncurriedEffectApp a bs ->
474− build $ EsCall (codegenExpr env a) (EsArrayValue <<< codegenExpr env <$> bs)
478+ case a of
479+ TcoExpr _ (Var qual)
480+ | Just expr' <- inlineApp env qual (InlineEffectApp bs) ->
481+ expr'
482+ _ ->
483+ build $ EsCall (codegenExpr env a) (EsArrayValue <<< codegenExpr env <$> bs)
475484 _ ->
476485 build $ EsCall (codegenExpr env tcoExpr) []
477486
@@ -695,7 +704,11 @@ codegenPrimOp env@(CodegenEnv { options }) = case _ of
695704 OpIntBitZeroFillShiftRight ->
696705 build $ EsBinary EsZeroFillShiftRight expr1 expr2
697706 OpIntNum num ->
698− build $ EsBinary EsBitOr (build (EsBinary (numOp num) expr1 expr2)) (build (EsInt 0))
707+ case num of
708+ OpDivide ->
709+ build $ EsRuntime $ EsIntDiv expr1 expr2
710+ _ ->
711+ build $ EsBinary EsBitOr (build (EsBinary (numOp num) expr1 expr2)) (build (EsInt 0))
699712 OpIntOrd ord ->
700713 build $ EsBinary (ordOp ord) expr1 expr2
701714 OpNumberNum num ->
backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Foreign.purs+45−26
@@ -4,29 +4,32 @@ import Prelude
44
55import Data.Array.NonEmpty as NonEmptyArray
66import Data.Enum (fromEnum)
7+import Data.Lazy as Lazy
78import Data.Map (Map)
89import Data.Map as Map
910import Data.Maybe (Maybe(..))
1011import Data.Tuple (Tuple(..))
1112import PureScript.Backend.Optimizer.CoreFn (Ident, Literal(..), Qualified)
12−import PureScript.Backend.Optimizer.Semantics (BackendSemantics(..), ExternSpine(..), evalApp, evalPrimOp, makeLet)
13+import PureScript.Backend.Optimizer.Semantics (BackendSemantics(..), ExternSpine(..), SemConditional(..), evalApp, evalPrimOp, liftInt, makeEffectBind, makeLet)
1314import PureScript.Backend.Optimizer.Semantics.Foreign (ForeignEval, ForeignSemantics, qualified)
14−import PureScript.Backend.Optimizer.Syntax (BackendOperator(..), BackendOperator2(..))
15+import PureScript.Backend.Optimizer.Syntax (BackendOperator(..), BackendOperator1(..), BackendOperator2(..), BackendOperatorOrd(..))
1516import PureScript.Backend.Optimizer.Utils (foldr1Array)
1617
18+-- NOTE: As a precaution, do not inline ST "thaw" functions to an unsafe
19+-- coercion as the optimizer may analyze the binding as a known immutable value.
1720esForeignSemantics :: Map (Qualified Ident) ForeignEval
1821esForeignSemantics = Map.fromFoldable
1922 [ control_monad_st_internal_for
2023 , control_monad_st_internal_foreach
2124 , control_monad_st_internal_while
22− , data_array_st_push
23− , data_array_st_unshift
25+ , data_array_indexImpl
2426 , data_array_st_unsafeFreeze
25− , data_array_st_unsafeThaw
2627 , data_bounded_topInt
2728 , data_bounded_bottomInt
2829 , data_bounded_topChar
2930 , data_bounded_bottomChar
31+ , data_bounded_topNumber
32+ , data_bounded_bottomNumber
3033 , data_enum_toCharCode
3134 , data_show_showCharImpl
3235 , data_show_showIntImpl
@@ -44,29 +47,32 @@ esForeignSemantics = Map.fromFoldable
4447 , foreign_object_st_unsafe_unsafeFreeze
4548 ]
4649
47−data_array_st_push :: ForeignSemantics
48−data_array_st_push = Tuple (qualified "Data.Array.ST" "push") $ arraySTAll (qualified "Data.Array.ST" "pushAll")
49−
50−data_array_st_unshift :: ForeignSemantics
51−data_array_st_unshift = Tuple (qualified "Data.Array.ST" "unshift") $ arraySTAll (qualified "Data.Array.ST" "unshiftAll")
52−
53−arraySTAll :: Qualified Ident -> ForeignEval
54−arraySTAll ident env _ = case _ of
55− [ ExternApp [ val ] ] ->
56− Just $
57− makeLet Nothing val \nextVal ->
58− SemLam Nothing \nextRef ->
59− SemEffectDefer $
60− evalApp env (NeutStop ident) [ NeutLit (LitArray [ nextVal ]), nextRef ]
61− _ ->
62− Nothing
50+data_array_indexImpl :: ForeignSemantics
51+data_array_indexImpl = Tuple (qualified "Data.Array" "indexImpl") go
52+ where
53+ go env _ = case _ of
54+ [ ExternUncurriedApp [ just, nothing, arr, ix ] ] ->
55+ Just $ makeLet Nothing arr \arr' ->
56+ makeLet Nothing ix \ix' ->
57+ SemBranch
58+ ( NonEmptyArray.singleton $ SemConditional
59+ ( Lazy.defer \_ ->
60+ evalPrimOp env $ Op2 OpBooleanAnd
61+ (evalPrimOp env (Op2 (OpIntOrd OpGte) ix' (liftInt 0)))
62+ (evalPrimOp env (Op2 (OpIntOrd OpLt) ix' (evalPrimOp env (Op1 OpArrayLength arr'))))
63+ )
64+ ( Lazy.defer \_ ->
65+ evalApp env just
66+ [ evalPrimOp env (Op2 OpArrayIndex arr' ix') ]
67+ )
68+ )
69+ (pure nothing)
70+ _ ->
71+ Nothing
6372
6473data_array_st_unsafeFreeze :: ForeignSemantics
6574data_array_st_unsafeFreeze = Tuple (qualified "Data.Array.ST" "unsafeFreeze") unsafeSTCoerce
6675
67−data_array_st_unsafeThaw :: ForeignSemantics
68−data_array_st_unsafeThaw = Tuple (qualified "Data.Array.ST" "unsafeThaw") unsafeSTCoerce
69−
7076unsafeSTCoerce :: ForeignEval
7177unsafeSTCoerce _ _ = case _ of
7278 [ ExternApp [ ref ] ] ->
@@ -85,6 +91,16 @@ data_bounded_bottomInt = Tuple (qualified "Data.Bounded" "bottomInt") go
8591 where
8692 go _ _ = const $ Just $ litInt bottom
8793
94+data_bounded_topNumber :: ForeignSemantics
95+data_bounded_topNumber = Tuple (qualified "Data.Bounded" "topNumber") go
96+ where
97+ go _ _ = const $ Just $ litNumber top
98+
99+data_bounded_bottomNumber :: ForeignSemantics
100+data_bounded_bottomNumber = Tuple (qualified "Data.Bounded" "bottomNumber") go
101+ where
102+ go _ _ = const $ Just $ litNumber bottom
103+
88104data_bounded_topChar :: ForeignSemantics
89105data_bounded_topChar = Tuple (qualified "Data.Bounded" "topChar") go
90106 where
@@ -202,7 +218,7 @@ foreign_object_st_delete = Tuple (qualified "Foreign.Object.ST" "delete") go
202218 Just $
203219 makeLet Nothing a \a' ->
204220 SemLam Nothing \b ->
205− SemEffectBind Nothing (evalApp env (NeutStop qual) [ a', b ]) \_ ->
221+ makeEffectBind Nothing (evalApp env (NeutStop qual) [ a', b ]) \_ ->
206222 SemEffectPure b
207223 _ ->
208224 Nothing
@@ -216,7 +232,7 @@ foreign_object_st_poke = Tuple (qualified "Foreign.Object.ST" "poke") go
216232 makeLet Nothing a \a' ->
217233 makeLet Nothing b \b' ->
218234 SemLam Nothing \c ->
219− SemEffectBind Nothing (evalApp env (NeutStop qual) [ a', b', c ]) \_ ->
235+ makeEffectBind Nothing (evalApp env (NeutStop qual) [ a', b', c ]) \_ ->
220236 SemEffectPure c
221237 _ ->
222238 Nothing
@@ -270,6 +286,9 @@ whileLoop env qual = case _ of
270286litInt :: Int -> BackendSemantics
271287litInt = NeutLit <<< LitInt
272288
289+litNumber :: Number -> BackendSemantics
290+litNumber = NeutLit <<< LitNumber
291+
273292litChar :: Char -> BackendSemantics
274293litChar = NeutLit <<< LitChar
275294
backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Inline.purs+63
@@ -25,9 +25,16 @@ esInlineMap = Map.fromFoldable
2525 , control_monad_st_internal_foreach
2626 , control_monad_st_internal_run
2727 , control_monad_st_internal_while
28+ , data_array_st_freezeImpl
29+ , data_array_st_thawImpl
2830 , data_array_st_new
2931 , data_array_st_pushAll
32+ , data_array_st_pushAllImpl
33+ , data_array_st_pushImpl
34+ , data_array_st_unsafeThawImpl
3035 , data_array_st_unshiftAll
36+ , data_array_st_unshiftAllImpl
37+ , data_semigroup_concatArray
3138 , effect_forE
3239 , effect_foreachE
3340 , effect_whileE
@@ -61,6 +68,28 @@ control_monad_st_internal_foreach = Tuple (qualified "Control.Monad.ST.Internal"
6168control_monad_st_internal_while :: EsInline
6269control_monad_st_internal_while = Tuple (qualified "Control.Monad.ST.Internal" "while") whileLoop
6370
71+data_array_st_freezeImpl :: EsInline
72+data_array_st_freezeImpl = Tuple (qualified "Data.Array.ST" "freezeImpl") arrayCopy
73+
74+data_array_st_thawImpl :: EsInline
75+data_array_st_thawImpl = Tuple (qualified "Data.Array.ST" "thawImpl") arrayCopy
76+
77+arrayCopy :: EsInlineCall
78+arrayCopy env _ = case _ of
79+ InlineEffectApp [ a ] ->
80+ Just $ build $ EsArray [ EsArraySpread (codegenExpr env a) ]
81+ _ ->
82+ Nothing
83+
84+data_array_st_unsafeThawImpl :: EsInline
85+data_array_st_unsafeThawImpl = Tuple (qualified "Data.Array.ST" "unsafeThawImpl") go
86+ where
87+ go env _ = case _ of
88+ InlineEffectApp [ TcoExpr _ (Lit (LitArray arr)) ] ->
89+ Just $ build $ EsArray $ EsArrayValue <<< codegenExpr env <$> arr
90+ _ ->
91+ Nothing
92+
6493data_array_st_new :: EsInline
6594data_array_st_new = Tuple (qualified "Data.Array.ST" "new") go
6695 where
@@ -73,9 +102,18 @@ data_array_st_new = Tuple (qualified "Data.Array.ST" "new") go
73102data_array_st_pushAll :: EsInline
74103data_array_st_pushAll = Tuple (qualified "Data.Array.ST" "pushAll") $ arraySTAll "push"
75104
105+data_array_st_pushAllImpl :: EsInline
106+data_array_st_pushAllImpl = Tuple (qualified "Data.Array.ST" "pushAllImpl") $ arraySTAllImpl "push"
107+
108+data_array_st_pushImpl :: EsInline
109+data_array_st_pushImpl = Tuple (qualified "Data.Array.ST" "pushImpl") $ arraySTImpl "push"
110+
76111data_array_st_unshiftAll :: EsInline
77112data_array_st_unshiftAll = Tuple (qualified "Data.Array.ST" "unshiftAll") $ arraySTAll "unshift"
78113
114+data_array_st_unshiftAllImpl :: EsInline
115+data_array_st_unshiftAllImpl = Tuple (qualified "Data.Array.ST" "unshiftAllImpl") $ arraySTAllImpl "unshift"
116+
79117arraySTAll :: String -> EsInlineCall
80118arraySTAll method env _ = case _ of
81119 InlineApp [ TcoExpr _ (Lit (LitArray vals)), arr ] ->
@@ -85,6 +123,31 @@ arraySTAll method env _ = case _ of
85123 _ ->
86124 Nothing
87125
126+arraySTAllImpl :: String -> EsInlineCall
127+arraySTAllImpl method env _ = case _ of
128+ InlineEffectApp [ TcoExpr _ (Lit (LitArray vals)), arr ] ->
129+ Just $ build $ EsCall (build (EsAccess (codegenExpr env arr) method)) $ EsArrayValue <<< codegenExpr env <$> vals
130+ InlineEffectApp [ vals, arr ] ->
131+ Just $ build $ EsCall (build (EsAccess (codegenExpr env arr) method)) $ spreadConcatArray $ codegenExpr env vals
132+ _ ->
133+ Nothing
134+
135+arraySTImpl :: String -> EsInlineCall
136+arraySTImpl method env _ = case _ of
137+ InlineEffectApp [ val, arr ] ->
138+ Just $ build $ EsCall (build (EsAccess (codegenExpr env arr) method)) [ EsArrayValue (codegenExpr env val) ]
139+ _ ->
140+ Nothing
141+
142+data_semigroup_concatArray :: EsInline
143+data_semigroup_concatArray = Tuple (qualified "Data.Semigroup" "concatArray") go
144+ where
145+ go env _ = case _ of
146+ InlineApp [ a, b ] ->
147+ Just $ build $ EsArray $ spreadConcatArray (codegenExpr env a) <> spreadConcatArray (codegenExpr env b)
148+ _ ->
149+ Nothing
150+
88151effect_forE :: EsInline
89152effect_forE = Tuple (qualified "Effect" "forE") forRangeLoop
90153
backend-es/src/PureScript/Backend/Optimizer/Codegen/EcmaScript/Syntax.purs+116−41
@@ -44,10 +44,10 @@ import Data.Newtype (class Newtype)
4444import Data.Set (Set)
4545import Data.Set as Set
4646import Data.String as String
47−import Data.Traversable (traverse)
4847import Data.Tuple (Tuple(..), fst, snd)
4948import Dodo as Dodo
5049import Dodo.Common as Dodo.Common
50+import Partial.Unsafe (unsafePartial)
5151import PureScript.Backend.Optimizer.Codegen.EcmaScript.Common (esAccessor, esApp, esAssign, esBoolean, esEscapeIdent, esEscapeProp, esEscapeSpecial, esIndex, esInt, esModuleName, esNumber, esString, esTernary)
5252import PureScript.Backend.Optimizer.CoreFn (Ident(..), ModuleName(..), Qualified(..))
5353
@@ -92,6 +92,7 @@ data EsSyntax a
9292 | EsContinue
9393 | EsUndefined
9494
95+derive instance Eq a => Eq (EsSyntax a)
9596derive instance Functor EsSyntax
9697
9798instance Foldable EsSyntax where
@@ -128,6 +129,7 @@ data EsArrayElement a
128129 = EsArrayValue a
129130 | EsArraySpread a
130131
132+derive instance Eq a => Eq (EsArrayElement a)
131133derive instance Functor EsArrayElement
132134
133135instance Foldable EsArrayElement where
@@ -142,10 +144,13 @@ data EsObjectElement a
142144 | EsObjectField String a
143145 | EsObjectSpread a
144146
147+derive instance Eq a => Eq (EsObjectElement a)
145148derive instance Functor EsObjectElement
146149
147150data EsBindingPattern = EsBindingIdent EsIdent
148151
152+derive instance Eq EsBindingPattern
153+
149154instance Foldable EsObjectElement where
150155 foldr a = foldrDefault a
151156 foldl a = foldlDefault a
@@ -174,12 +179,16 @@ data EsBinaryOp
174179 | EsEquals
175180 | EsNotEquals
176181
182+derive instance Eq EsBinaryOp
183+
177184data EsUnaryOp
178185 = EsNot
179186 | EsNegate
180187 | EsBitNegate
181188 | EsDelete
182189
190+derive instance Eq EsUnaryOp
191+
183192data EsPrec
184193 = EsPrecStatement
185194 | EsPrecControl
@@ -197,7 +206,9 @@ data EsRuntimeOp a
197206 = EsBinding a
198207 | EsRange a a
199208 | EsFail
209+ | EsIntDiv a a
200210
211+derive instance Eq a => Eq (EsRuntimeOp a)
201212derive instance Functor EsRuntimeOp
202213
203214instance Foldable EsRuntimeOp where
@@ -205,6 +216,7 @@ instance Foldable EsRuntimeOp where
205216 EsBinding a -> f a
206217 EsRange a b -> f a <> f b
207218 EsFail -> mempty
219+ EsIntDiv a b -> f a <> f b
208220 foldr a = foldrDefault a
209221 foldl a = foldlDefault a
210222
@@ -213,10 +225,15 @@ data EsExpr = EsExpr EsAnalysis (EsSyntax EsExpr)
213225instance HasSyntax EsExpr where
214226 syntaxOf (EsExpr _ syn) = syn
215227
228+instance Eq EsExpr where
229+ eq (EsExpr (EsAnalysis s1) a) (EsExpr (EsAnalysis s2) b) =
230+ s1.size == s2.size && a == b
231+
216232newtype EsAnalysis = EsAnalysis
217233 { deps :: Set ModuleName
218234 , runtime :: Boolean
219235 , pure :: Boolean
236+ , size :: Int
220237 }
221238
222239derive instance Newtype EsAnalysis _
@@ -226,10 +243,11 @@ instance Semigroup EsAnalysis where
226243 { deps: a.deps <> b.deps
227244 , runtime: a.runtime || b.runtime
228245 , pure: a.pure && b.pure
246+ , size: a.size + b.size
229247 }
230248
231249instance Monoid EsAnalysis where
232− mempty = EsAnalysis { deps: mempty, runtime: false, pure: true }
250+ mempty = EsAnalysis { deps: mempty, runtime: false, pure: true, size: 0 }
233251
234252needsDep :: ModuleName -> EsAnalysis -> EsAnalysis
235253needsDep mn (EsAnalysis a) = EsAnalysis a { deps = Set.insert mn a.deps }
@@ -243,56 +261,58 @@ notPure (EsAnalysis a) = EsAnalysis a { pure = false }
243261alwaysPure :: EsAnalysis -> EsAnalysis
244262alwaysPure (EsAnalysis a) = EsAnalysis a { pure = true }
245263
264+bumpSize :: EsAnalysis -> EsAnalysis
265+bumpSize (EsAnalysis a) = EsAnalysis a { size = a.size + 1 }
266+
246267esAnalysisOf :: EsExpr -> EsAnalysis
247268esAnalysisOf (EsExpr a _) = a
248269
249270build :: EsSyntax EsExpr -> EsExpr
250271build syn = case syn of
251272 EsIdent (Qualified (Just mn) _) ->
252− EsExpr (needsDep mn mempty) syn
273+ EsExpr (needsDep mn (bumpSize mempty)) syn
253274 EsRuntime op ->
254− EsExpr (needsRuntime (foldMap esAnalysisOf op)) syn
275+ EsExpr (needsRuntime (bumpSize (foldMap esAnalysisOf op))) syn
255276 EsCall (EsExpr _ (EsArrowFunction [] bs)) []
256277 | Just expr <- inlineCallBlock bs ->
257278 expr
258− EsReturn (Just b)
259− | Just expr' <- inlineLoopBlockStatement b ->
260− expr'
261279 EsReturn (Just (EsExpr _ EsUndefined)) ->
262280 build $ EsReturn Nothing
263− EsArrowFunction as bs
264− | Just (EsExpr _ (EsReturn Nothing)) <- Array.last bs ->
265− esArrowFunction as $ Array.dropEnd 1 bs
266281 EsArrowFunction as [ block ]
267282 | Just bs <- inlineReturnBlock block ->
268283 esArrowFunction as bs
269284 EsArrowFunction as bs -> do
270− let Tuple s bs' = buildStatements bs
271− EsExpr (alwaysPure s) $ EsArrowFunction as bs'
272− EsIfElse a [ block ] cs
273− | Just bs <- inlineReturnBlock block ->
274− build $ EsIfElse a bs cs
285+ let bs' = buildStatements bs
286+ case removeTrailingReturn bs' of
287+ Just bs'' ->
288+ build $ EsArrowFunction as bs''
289+ Nothing ->
290+ EsExpr (alwaysPure (bumpSize (foldMap esAnalysisOf bs'))) $ EsArrowFunction as bs'
275291 EsIfElse a bs [ block ]
276292 | Just cs <- inlineReturnBlock block ->
277293 build $ EsIfElse a bs cs
278294 EsIfElse a bs cs -> do
279− let Tuple s1 bs' = buildStatements bs
280− let Tuple s2 cs' = buildStatements cs
281− EsExpr (esAnalysisOf a <> s1 <> s2) $ EsIfElse a bs' cs'
282− EsWhile a bs
283− | Just bs' <- removeTrailingContinue bs ->
284− build $ EsWhile a bs'
285− | otherwise -> do
286− let Tuple s bs' = buildStatements bs
287− EsExpr (esAnalysisOf a <> s) $ EsWhile a bs'
288− EsForOf a b cs
289− | Just cs' <- removeTrailingContinue cs ->
290− build $ EsForOf a b cs'
291− | otherwise -> do
292− let Tuple s cs' = buildStatements cs
293− EsExpr (esAnalysisOf b <> s) $ EsForOf a b cs'
295+ let bs' = buildStatements bs
296+ let cs' = buildStatements cs
297+ EsExpr (bumpSize (esAnalysisOf a <> foldMap esAnalysisOf bs' <> foldMap esAnalysisOf cs')) $ EsIfElse a bs' cs'
298+ EsWhile a bs -> do
299+ let bs' = buildStatements bs
300+ case removeTrailingContinue bs' of
301+ Just bs'' ->
302+ build $ EsWhile a bs''
303+ Nothing ->
304+ EsExpr (bumpSize (esAnalysisOf a <> foldMap esAnalysisOf bs')) $ EsWhile a bs'
305+ EsForOf a b cs -> do
306+ let cs' = buildStatements cs
307+ case removeTrailingContinue cs' of
308+ Just cs'' ->
309+ build $ EsForOf a b cs''
310+ Nothing ->
311+ EsExpr (bumpSize (esAnalysisOf b <> foldMap esAnalysisOf cs')) $ EsForOf a b cs'
312+ EsUnary EsNot (EsExpr _ (EsBinary EsEquals a b)) ->
313+ build $ EsBinary EsNotEquals a b
294314 _ ->
295− EsExpr (pureAnn (foldMap esAnalysisOf syn)) syn
315+ EsExpr (pureAnn (bumpSize (foldMap esAnalysisOf syn))) syn
296316 where
297317 pureAnn = case syn of
298318 EsAccess _ _ -> notPure
@@ -303,14 +323,49 @@ build syn = case syn of
303323 EsArrowFunction _ _ -> alwaysPure
304324 _ -> identity
305325
306−buildStatements :: Array EsExpr -> Tuple EsAnalysis (Array EsExpr)
307−buildStatements = traverse go
326+buildStatements :: Array EsExpr -> Array EsExpr
327+buildStatements = (go =<< _) <<< mergeBranchTails
308328 where
309− go expr = case expr of
310− _ | Just expr' <- inlineLoopBlockStatement expr ->
311− go expr'
312− _ ->
313− Tuple (esAnalysisOf expr) expr
329+ go = case _ of
330+ EsExpr _ (EsReturn (Just expr'))
331+ | Just expr'' <- inlineLoopBlockStatement expr' ->
332+ Array.snoc (go expr'') $ build $ EsReturn Nothing
333+ expr
334+ | Just expr' <- inlineLoopBlockStatement expr ->
335+ go expr'
336+ expr ->
337+ [ expr ]
338+
339+ -- For nested if/else blocks, merges a duplicate tail of alternatives
340+ -- via fallthrough. If an inner branch has a tail that matches the
341+ -- parent's tail, we can just delete the tail from the inner branch.
342+ -- We can't do this in BackendSyntax because it only has complete
343+ -- if/else, but ES can exploit imperative control-flow.
344+ mergeBranchTails :: Array EsExpr -> Array EsExpr
345+ mergeBranchTails as = do
346+ let
347+ len = Array.length as
348+ loop ix
349+ | ix == len = as
350+ | otherwise = case unsafePartial (Array.unsafeIndex as ix) of
351+ EsExpr _ (EsIfElse hd ds [])
352+ | Just ta <- Array.index as (ix + 1)
353+ , Just tb <- Array.findIndex (eq ta) ds
354+ , Array.drop (tb + 1) ds == Array.drop (ix + 2) as ->
355+ case Array.take tb ds of
356+ [] ->
357+ Array.take ix as <> Array.drop (ix + 1) as
358+ [ EsExpr _ (EsIfElse bb cc []) ] ->
359+ Array.take ix as
360+ <> [ build $ EsIfElse (build (EsBinary EsAnd hd bb)) cc [] ]
361+ <> Array.drop (ix + 1) as
362+ ds' ->
363+ Array.take ix as
364+ <> [ build $ EsIfElse hd ds' [] ]
365+ <> Array.drop (ix + 1) as
366+ _ ->
367+ loop (ix + 1)
368+ loop 0
314369
315370inlineReturnBlock :: EsExpr -> Maybe (Array EsExpr)
316371inlineReturnBlock (EsExpr _ expr) = case expr of
@@ -336,11 +391,24 @@ inlineLoopBlockStatement (EsExpr _ expr) = case expr of
336391 _ ->
337392 Nothing
338393
394+removeTrailingReturn :: Array EsExpr -> Maybe (Array EsExpr)
395+removeTrailingReturn stmts = case Array.last stmts of
396+ Just (EsExpr _ (EsIfElse a bs []))
397+ | Just cs <- removeTrailingReturn bs ->
398+ Just $ Array.snoc (Array.dropEnd 1 stmts) $ build $ EsIfElse a cs []
399+ Just (EsExpr _ (EsReturn Nothing)) ->
400+ Just (Array.dropEnd 1 stmts)
401+ Just expr
402+ | Just stmts' <- inlineReturnBlock expr ->
403+ Just (Array.dropEnd 1 stmts <> stmts')
404+ _ ->
405+ Nothing
406+
339407removeTrailingContinue :: Array EsExpr -> Maybe (Array EsExpr)
340408removeTrailingContinue stmts = case Array.last stmts of
341− Just (EsExpr s (EsIfElse a bs []))
409+ Just (EsExpr _ (EsIfElse a bs []))
342410 | Just cs <- removeTrailingContinue bs ->
343− Just $ Array.snoc (Array.dropEnd 1 stmts) $ EsExpr s $ EsIfElse a cs []
411+ Just $ Array.snoc (Array.dropEnd 1 stmts) $ build $ EsIfElse a cs []
344412 Just (EsExpr _ EsContinue) ->
345413 Just (Array.dropEnd 1 stmts)
346414 _ ->
@@ -417,12 +485,19 @@ print opts syn = case syn of
417485 EsRuntime op ->
418486 Tuple EsPrecCall $ case op of
419487 EsBinding a ->
420− printPure opts $ esApp (Dodo.text "$runtime.binding") [ snd (print opts (syntaxOf a)) ]
488+ printPure opts $ esApp (Dodo.text "$runtime.binding")
489+ [ snd (print opts (syntaxOf a))
490+ ]
421491 EsRange a b ->
422492 esApp (Dodo.text "$runtime.range")
423493 [ snd (print opts (syntaxOf a))
424494 , snd (print opts (syntaxOf b))
425495 ]
496+ EsIntDiv a b ->
497+ printPure opts $ esApp (Dodo.text "$runtime.intDiv")
498+ [ snd (print opts (syntaxOf a))
499+ , snd (print opts (syntaxOf b))
500+ ]
426501 EsFail ->
427502 Dodo.text "$runtime.fail()"
428503 EsCall a bs -> do
backend-es/src/Version.js+1−1
@@ -1 +1 @@
1−export const version = "v1.3.2";
1+export const version = "v1.4.3";
backend-es/test-snapshots/.gitignorenew file+3
@@ -0,0 +1,3 @@
1+.spago
2+output
3+output-es
backend-es/test-snapshots/snapshots-out/Snapshot.AssocArrayAppend.jsnew file+4
@@ -0,0 +1,4 @@
1+const test3 = x => ["a", "b", ...x, ...x, ...x, ...x, "c", "d", "e", ...x, ...x, ...x, ...x, "f", "g"];
2+const test2 = x => ["a", "b", ...x, ...x, ...x, ...x, "c", "d"];
3+const test1 = x => ["a", "b", ...x, ...x, ...x, ...x, "c", "d"];
4+export {test1, test2, test3};
backend-es/test-snapshots/snapshots-out/Snapshot.AssocIntOps.jsnew file+7
@@ -0,0 +1,7 @@
1+const test6 = x => (((((((((2 * x | 0) * x | 0) * x | 0) * x | 0) * 60 | 0) * x | 0) * x | 0) * x | 0) * x | 0) * 42 | 0;
2+const test5 = x => ((((2 * x | 0) * x | 0) * x | 0) * x | 0) * 12 | 0;
3+const test4 = x => ((((2 * x | 0) * x | 0) * x | 0) * x | 0) * 12 | 0;
4+const test3 = x => (((((((((3 + x | 0) + x | 0) + x | 0) + x | 0) + 12 | 0) + x | 0) + x | 0) + x | 0) + x | 0) + 13 | 0;
5+const test2 = x => ((((3 + x | 0) + x | 0) + x | 0) + x | 0) + 7 | 0;
6+const test1 = x => ((((3 + x | 0) + x | 0) + x | 0) + x | 0) + 7 | 0;
7+export {test1, test2, test3, test4, test5, test6};
backend-es/test-snapshots/snapshots-out/Snapshot.AssocNumberOps.jsnew file+7
@@ -0,0 +1,7 @@
1+const test6 = x => 2.0 * x * x * x * x * 60.0 * x * x * x * x * 42.0;
2+const test5 = x => 2.0 * x * x * x * x * 12.0;
3+const test4 = x => 2.0 * x * x * x * x * 12.0;
4+const test3 = x => 3.0 + x + x + x + x + 12.0 + x + x + x + x + 13.0;
5+const test2 = x => 3.0 + x + x + x + x + 7.0;
6+const test1 = x => 3.0 + x + x + x + x + 7.0;
7+export {test1, test2, test3, test4, test5, test6};
backend-es/test-snapshots/snapshots-out/Snapshot.AssocStringAppend.jsnew file+4
@@ -0,0 +1,4 @@
1+const test3 = x => "ab" + x + x + x + x + "cde" + x + x + x + x + "fg";
2+const test2 = x => "ab" + x + x + x + x + "cd";
3+const test1 = x => "ab" + x + x + x + x + "cd";
4+export {test1, test2, test3};
backend-es/test/snapshots-out/Snapshot.BackendSemantics01.js → backend-es/test-snapshots/snapshots-out/Snapshot.BackendSemantics01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.BackendSemantics02.js → backend-es/test-snapshots/snapshots-out/Snapshot.BackendSemantics02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.BranchSpecialization01.js → backend-es/test-snapshots/snapshots-out/Snapshot.BranchSpecialization01.jsrenamed+1−2
@@ -9,8 +9,7 @@ const eqTest = {
99 if (x === "Foo") { return y === "Foo"; }
1010 if (x === "Bar") { return y === "Bar"; }
1111 if (x === "Baz") { return y === "Baz"; }
12− if (x === "Qux") { return y === "Qux"; }
13− return false;
12+ return x === "Qux" && y === "Qux";
1413 }
1514};
1615const test1 = a => a === "Baz";
backend-es/test/snapshots-out/Snapshot.CaptureDerefRegression01.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaptureDerefRegression01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseArray.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseArray.jsrenamed+1−4
@@ -1,9 +1,6 @@
11const test1 = v => {
22 if (v.length === 0) { return "0"; }
3− if (v.length === 1) {
4− if (v[0] === 1) { return "1"; }
5− return "1";
6− }
3+ if (v.length === 1) { return "1"; }
74 if (v.length === 2) {
85 if (v[1] === 2) { return "2"; }
96 return "catch";
backend-es/test/snapshots-out/Snapshot.CaseBoolean.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseBoolean.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseChar.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseChar.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseGrafting.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseGrafting.jsrenamed+1−6
@@ -4,12 +4,7 @@ const test1 = v => v1 => v2 => {
44 if (v2) { return 1; }
55 return 3;
66 }
7− if (!v) {
8− if (v1) { return 2; }
9− if (!v2) { return 3; }
10− if (v2) { return 4; }
11− $runtime.fail();
12− }
7+ if (!v && v1) { return 2; }
138 if (!v2) { return 3; }
149 if (v2) { return 4; }
1510 $runtime.fail();
backend-es/test/snapshots-out/Snapshot.CaseGuarded.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseGuarded.jsrenamed+5−38
@@ -3,24 +3,8 @@ const $Product3 = (_1, _2, _3) => ({tag: "Product3", _1, _2, _3});
33const Product3 = value0 => value1 => value2 => $Product3(value0, value1, value2);
44const NInt = x => x;
55const test5 = v => {
6− if (v.tag === "Just") {
7− if (v._1.tag === "Right") { return v._1._1; }
8− if (v.tag === "Just") {
9− if (v._1.tag === "Left") {
10− if (v._1._1 === 2) { return 4; }
11− return 5;
12− }
13− return 5;
14− }
15− return 5;
16− }
17− if (v.tag === "Just") {
18− if (v._1.tag === "Left") {
19− if (v._1._1 === 2) { return 4; }
20− return 5;
21− }
22− return 5;
23− }
6+ if (v.tag === "Just" && v._1.tag === "Right") { return v._1._1; }
7+ if (v.tag === "Just" && v._1.tag === "Left" && v._1._1 === 2) { return 4; }
248 return 5;
259};
2610const test4 = v => v1 => {
@@ -40,7 +24,6 @@ const test4 = v => v1 => {
4024 if (v.c === v1.e) { return 7; }
4125 if (v.c < v1.e) { return 8; }
4226 if (v.c > v1.e) { return 9; }
43− return (11 + v.c | 0) + v1.f | 0;
4427 }
4528 return (11 + v.c | 0) + v1.f | 0;
4629 }
@@ -50,13 +33,7 @@ const test4 = v => v1 => {
5033 if (v.c > v1.e) { return 9; }
5134 return (11 + v.c | 0) + v1.f | 0;
5235 }
53− if (v.b === 2) {
54− if (v1.d === 1) {
55− if (v1.f === 10) { return 10; }
56− return (11 + v.c | 0) + v1.f | 0;
57− }
58− return (11 + v.c | 0) + v1.f | 0;
59− }
36+ if (v.b === 2 && v1.d === 1 && v1.f === 10) { return 10; }
6037 return (11 + v.c | 0) + v1.f | 0;
6138};
6239const test3 = v => {
@@ -73,18 +50,8 @@ const test2 = v => {
7350};
7451const test1 = v => {
7552 if (v < 1) { return "n: " + Data$dShow.showIntImpl(v); }
76− if (v > 1) {
77− if (v < 100) { return "1 < x < 100: " + Data$dShow.showIntImpl(v); }
78− if (v > 1) {
79− if (v < 50) { return "1 < x < 50: " + Data$dShow.showIntImpl(v); }
80− return "catch";
81− }
82− return "catch";
83− }
84− if (v > 1) {
85− if (v < 50) { return "1 < x < 50: " + Data$dShow.showIntImpl(v); }
86− return "catch";
87− }
53+ if (v > 1 && v < 100) { return "1 < x < 100: " + Data$dShow.showIntImpl(v); }
54+ if (v > 1 && v < 50) { return "1 < x < 50: " + Data$dShow.showIntImpl(v); }
8855 return "catch";
8956};
9057export {$Product3, NInt, Product3, test1, test2, test3, test4, test5};
backend-es/test/snapshots-out/Snapshot.CaseHeuristics.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseHeuristics.jsrenamed+9−48
@@ -9,18 +9,11 @@ const testPBAN = v => v1 => {
99 if (v1._1 === 1) { return 1; }
1010 return 4;
1111 }
12− if (v._1 === 2) {
13− if (v1._1 === 2) { return 2; }
14− return 4;
15− }
16− return 4;
12+ if (v._1 === 2 && v1._1 === 2) { return 2; }
1713 }
1814 return 4;
1915 }
20− if (v.tag === "Two") {
21− if (v1.tag === "Two") { return 3; }
22− return 4;
23− }
16+ if (v.tag === "Two" && v1.tag === "Two") { return 3; }
2417 return 4;
2518};
2619const testPBA = v => v1 => {
@@ -30,53 +23,24 @@ const testPBA = v => v1 => {
3023 if (v1._1 === 1) { return 1; }
3124 return 4;
3225 }
33− if (v._1 === 2) {
34− if (v1._1 === 2) { return 2; }
35− return 4;
36− }
37− return 4;
38− }
39− return 4;
40− }
41− if (v.tag === "Two") {
42− if (v._1 === 1) {
43− if (v1.tag === "Two") { return 3; }
44− return 4;
26+ if (v._1 === 2 && v1._1 === 2) { return 2; }
4527 }
4628 return 4;
4729 }
30+ if (v.tag === "Two" && v._1 === 1 && v1.tag === "Two") { return 3; }
4831 return 4;
4932};
5033const testPB = v => v1 => {
5134 if (v.tag === "One") {
52− if (v._1 === 1) {
53− if (v1.tag === "One") {
54− if (v1._1 === 1) { return 1; }
55− return 4;
56− }
57− if (v1.tag === "Zero") { return 3; }
35+ if (v._1 === 1 && v1.tag === "One") {
36+ if (v1._1 === 1) { return 1; }
5837 return 4;
5938 }
6039 if (v1.tag === "Zero") { return 3; }
6140 return 4;
6241 }
63− if (v.tag === "Two") {
64− if (v._1 === 2) {
65− if (v._2 === 3) {
66− if (v1.tag === "Two") {
67− if (v1._1 === 2) {
68− if (v1._2 === 3) { return 2; }
69− return 4;
70− }
71− return 4;
72− }
73− if (v1.tag === "Zero") { return 3; }
74− return 4;
75− }
76− if (v1.tag === "Zero") { return 3; }
77− return 4;
78− }
79− if (v1.tag === "Zero") { return 3; }
42+ if (v.tag === "Two" && v._1 === 2 && v._2 === 3 && v1.tag === "Two") {
43+ if (v1._1 === 2 && v1._2 === 3) { return 2; }
8044 return 4;
8145 }
8246 if (v1.tag === "Zero") { return 3; }
@@ -94,10 +58,7 @@ const testP = v => v1 => v2 => {
9458 if (v2 === 3) { return 3; }
9559 return 5;
9660 }
97− if (v === 1) {
98− if (v2 === 4) { return 4; }
99− return 5;
100− }
61+ if (v === 1 && v2 === 4) { return 4; }
10162 return 5;
10263};
10364export {$Column, One, Two, Zero, testP, testPB, testPBA, testPBAN};
backend-es/test/snapshots-out/Snapshot.CaseInt.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseInt.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseJacobs.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseJacobs.jsrenamed−1
@@ -27,7 +27,6 @@ const test1 = v => {
2727 if (v._1.tag === "Zero") { return "e2: " + showExpr.show(v._2); }
2828 if (v._2.tag === "Zero") { return "e4: " + showExpr.show(v._1); }
2929 if (v._1.tag === "Add") { return "e5: " + showExpr.show(v._1._1) + " " + showExpr.show(v._1._2) + " " + showExpr.show(v._2); }
30− return "e7: " + showExpr.show(v);
3130 }
3231 return "e7: " + showExpr.show(v);
3332};
backend-es/test-snapshots/snapshots-out/Snapshot.CaseLeafTco.jsnew file+37
@@ -0,0 +1,37 @@
1+const test1 = test1$a0$copy => test1$a1$copy => {
2+ let test1$a0 = test1$a0$copy, test1$a1 = test1$a1$copy, test1$c = true, test1$r;
3+ while (test1$c) {
4+ const b = test1$a0, arr = test1$a1;
5+ const $0 = arr.length - 1 | 0;
6+ if ($0 >= 0 && $0 < arr.length) {
7+ if (0 < arr.length) {
8+ if (arr[$0] === 2 && arr[0] === 1) {
9+ test1$c = false;
10+ test1$r = arr;
11+ continue;
12+ }
13+ const $1 = arr[$0];
14+ if (b) {
15+ test1$c = false;
16+ test1$r = [];
17+ continue;
18+ }
19+ test1$a0 = b;
20+ test1$a1 = [$1, arr[0], 3, $1, 5, 6, 7, 8, 9, 10, arr[0], 12, 13, 14, 15, 16, 17, ...arr];
21+ continue;
22+ }
23+ test1$c = false;
24+ test1$r = [...arr, arr[$0]];
25+ continue;
26+ }
27+ if (0 < arr.length) {
28+ test1$c = false;
29+ test1$r = [...arr, arr[0]];
30+ continue;
31+ }
32+ test1$c = false;
33+ test1$r = arr;
34+ }
35+ return test1$r;
36+};
37+export {test1};
backend-es/test/snapshots-out/Snapshot.CaseMulti.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseMulti.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseNamed.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNamed.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseNewtype.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNewtype.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseNumber.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseNumber.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CasePartial.js → backend-es/test-snapshots/snapshots-out/Snapshot.CasePartial.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseProduct.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseProduct.jsrenamed+2−12
@@ -2,22 +2,12 @@ const $Product3 = (_1, _2, _3) => ({tag: "Product3", _1, _2, _3});
22const Product3 = value0 => value1 => value2 => $Product3(value0, value1, value2);
33const test1 = v => {
44 if (v._1 === 1) {
5− if (v._3 === 3) {
6− if (v._2 === 2) { return "1"; }
7− if (v._2 === 4) { return "2"; }
8− return "catch";
9− }
5+ if (v._3 === 3 && v._2 === 2) { return "1"; }
106 if (v._2 === 4) { return "2"; }
117 return "catch";
128 }
139 if (v._2 === 4) { return "2"; }
14− if (v._1 === 4) {
15− if (v._2 === 5) {
16− if (v._3 === 6) { return "3"; }
17− return "catch";
18− }
19− return "catch";
20− }
10+ if (v._1 === 4 && v._2 === 5 && v._3 === 6) { return "3"; }
2111 return "catch";
2212};
2313export {$Product3, Product3, test1};
backend-es/test/snapshots-out/Snapshot.CaseRecord.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseRecord.jsrenamed+4−12
@@ -20,16 +20,11 @@ const test3 = v => {
2020};
2121const test2 = v => {
2222 if (v.a.c === 2) {
23− if (v.d.e === 1) {
24− if (v.d.f === 2) {
25− if (v.a.b === 1) { return 1; }
26− return 2;
27− }
28− if (v.a.b === 1) { return 3; }
29− return 4;
23+ if (v.d.e === 1 && v.d.f === 2) {
24+ if (v.a.b === 1) { return 1; }
25+ return 2;
3026 }
3127 if (v.a.b === 1) { return 3; }
32− return 4;
3328 }
3429 return 4;
3530};
@@ -37,10 +32,7 @@ const test1 = v => {
3732 if (v.a === 1) { return "0"; }
3833 if (v.b === 1) { return "1"; }
3934 if (v.c === 1) { return "2"; }
40− if (v.a === 2) {
41− if (v.b === 2) { return "3"; }
42− return "catch";
43− }
35+ if (v.a === 2 && v.b === 2) { return "3"; }
4436 return "catch";
4537};
4638export {test1, test2, test3, test4, test5, test6};
backend-es/test-snapshots/snapshots-out/Snapshot.CaseRedBlackTree.jsnew file+55
@@ -0,0 +1,55 @@
1+import * as $runtime from "../runtime.js";
2+const $Color = tag => tag;
3+const $RedBlackTree = (tag, _1, _2, _3, _4) => ({tag, _1, _2, _3, _4});
4+const Red = /* #__PURE__ */ $Color("Red");
5+const Black = /* #__PURE__ */ $Color("Black");
6+const Leaf = /* #__PURE__ */ $RedBlackTree("Leaf");
7+const Node = value0 => value1 => value2 => value3 => $RedBlackTree("Node", value0, value1, value2, value3);
8+const test1 = () => v => {
9+ if (v.tag === "Node" && v._1 === "Black") {
10+ if (v._2.tag === "Node") {
11+ if (v._2._1 === "Red") {
12+ if (v._2._2.tag === "Node") {
13+ if (v._2._2._1 === "Red") { return {i: 1, a: v._2._2._2, x: v._2._2._3, b: v._2._2._4, y: v._2._3, c: v._2._4, z: v._3, d: v._4}; }
14+ if (v._2._4.tag === "Node") {
15+ if (v._2._4._1 === "Red") { return {i: 2, a: v._2._2, x: v._2._3, b: v._2._4._2, y: v._2._4._3, c: v._2._4._4, z: v._3, d: v._4}; }
16+ if (v._4.tag === "Node" && v._4._1 === "Red") {
17+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
18+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
19+ }
20+ $runtime.fail();
21+ }
22+ if (v._4.tag === "Node" && v._4._1 === "Red") {
23+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
24+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
25+ }
26+ $runtime.fail();
27+ }
28+ if (v._2._4.tag === "Node") {
29+ if (v._2._4._1 === "Red") { return {i: 2, a: v._2._2, x: v._2._3, b: v._2._4._2, y: v._2._4._3, c: v._2._4._4, z: v._3, d: v._4}; }
30+ if (v._4.tag === "Node" && v._4._1 === "Red") {
31+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
32+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
33+ }
34+ $runtime.fail();
35+ }
36+ if (v._4.tag === "Node" && v._4._1 === "Red") {
37+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
38+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
39+ }
40+ $runtime.fail();
41+ }
42+ if (v._4.tag === "Node" && v._4._1 === "Red") {
43+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
44+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
45+ }
46+ $runtime.fail();
47+ }
48+ if (v._4.tag === "Node" && v._4._1 === "Red") {
49+ if (v._4._2.tag === "Node" && v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
50+ if (v._4._4.tag === "Node" && v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
51+ }
52+ }
53+ $runtime.fail();
54+};
55+export {$Color, $RedBlackTree, Black, Leaf, Node, Red, test1};
backend-es/test/snapshots-out/Snapshot.CaseString.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseString.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.CaseSum.js → backend-es/test-snapshots/snapshots-out/Snapshot.CaseSum.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.ConvertableOptions01.js → backend-es/test-snapshots/snapshots-out/Snapshot.ConvertableOptions01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Cps01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Cps01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Cps02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Cps02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesEq01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesEq01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesEq02.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesEq02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesFunction01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesFunction01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesFunctor01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesFunctor01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesMonoid01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesMonoid01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.DefaultRulesSemigroup01.js → backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesSemigroup01.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.DefaultRulesSemigroup02.jsnew file+6
@@ -0,0 +1,6 @@
1+const append = ra => rb => ({bar: [...ra.bar, ...rb.bar], foo: ra.foo + rb.foo});
2+const test4 = {bar: ["hello", "World!"], foo: "hello, World!"};
3+const test3 = /* #__PURE__ */ append({foo: "hello", bar: ["hello"]});
4+const test2 = a => b => ({bar: [...a.bar, ...b.bar], foo: a.foo + b.foo});
5+const test1 = append;
6+export {append, test1, test2, test3, test4};
backend-es/test/snapshots-out/Snapshot.EffectBind01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind04.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind04.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind05.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind05.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind06.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind06.jsrenamed+1−1
@@ -3,6 +3,6 @@ const test = random => () => {
33 const x1 = random();
44 const y = random();
55 const m = random();
6− return (x + (x1 + y | 0) | 0) - m | 0;
6+ return ((x + x1 | 0) + y | 0) - m | 0;
77};
88export {test};
backend-es/test/snapshots-out/Snapshot.EffectBind07.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind07.jsrenamed+1−1
@@ -6,6 +6,6 @@ const test = random => value => () => {
66 const x1 = random();
77 const y = random();
88 const m = random();
9− return (x + (((x1 + y | 0) + a | 0) + a | 0) | 0) - m | 0;
9+ return ((((x + x1 | 0) + y | 0) + a | 0) + a | 0) - m | 0;
1010};
1111export {test};
backend-es/test/snapshots-out/Snapshot.EffectBind08.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind08.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectBind09.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectBind09.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoopCaseRegression.jsnew file+14
@@ -0,0 +1,14 @@
1+import * as $runtime from "../runtime.js";
2+import * as Effect$dConsole from "../Effect.Console/index.js";
3+const test = eff => () => {
4+ const res = eff();
5+ if (res.tag === "Nothing") { return; }
6+ if (res.tag === "Just") {
7+ for (const a of res._1) {
8+ Effect$dConsole.log(a)();
9+ }
10+ return;
11+ }
12+ $runtime.fail();
13+};
14+export {test};
backend-es/test/snapshots-out/Snapshot.EffectLoops01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectLoops02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectLoops03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectLoops03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectPure01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectPure01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectRefs01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectRefs01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectRefs02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectRefs02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EffectUnsafe01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EffectUnsafe01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EsPrecedence01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence01.jsrenamed+1−1
@@ -1,5 +1,5 @@
11const test1 = f => a => b => {
2− if ((f(a) ? f(b) : false) ? f(a) : true) { return f(a); }
2+ if (f(a) && f(b) ? f(a) : true) { return f(a); }
33 return f();
44};
55export {test1};
backend-es/test/snapshots-out/Snapshot.EsPrecedence02.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EsPrecedence03.js → backend-es/test-snapshots/snapshots-out/Snapshot.EsPrecedence03.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.EsSharedElse.jsnew file+6
@@ -0,0 +1,6 @@
1+const test1 = a => b => c => {
2+ if (a && b) { return 1; }
3+ if (c) { return 2; }
4+ return 3;
5+};
6+export {test1};
backend-es/test/snapshots-out/Snapshot.EscapeIdentifiers.js → backend-es/test-snapshots/snapshots-out/Snapshot.EscapeIdentifiers.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.EtaReduceRegression01.js → backend-es/test-snapshots/snapshots-out/Snapshot.EtaReduceRegression01.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.FloatLetRegression01.jsnew file+5
@@ -0,0 +1,5 @@
1+const test = f => {
2+ const c = f(2);
3+ return {b: f(1), c1: c, c2: c};
4+};
5+export {test};
backend-es/test/snapshots-out/Snapshot.FunctionCompose01.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.FunctionCompose02.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.FunctionCompose03.js → backend-es/test-snapshots/snapshots-out/Snapshot.FunctionCompose03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Fusion01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Fusion01.jsrenamed+7−2
@@ -1,12 +1,17 @@
11// @inline export overArray arity=1
22import * as $runtime from "../runtime.js";
33import * as Data$dArray from "../Data.Array/index.js";
4−import * as Data$dList from "../Data.List/index.js";
54import * as Data$dList$dTypes from "../Data.List.Types/index.js";
5+import * as Data$dMaybe from "../Data.Maybe/index.js";
66import * as Data$dShow from "../Data.Show/index.js";
77import * as Data$dString$dCodeUnits from "../Data.String.CodeUnits/index.js";
8+import * as Data$dTuple from "../Data.Tuple/index.js";
89import * as Data$dUnfoldable from "../Data.Unfoldable/index.js";
9−const toUnfoldable = /* #__PURE__ */ Data$dList.toUnfoldable(Data$dUnfoldable.unfoldableArray);
10+const toUnfoldable = /* #__PURE__ */ (() => Data$dUnfoldable.unfoldableArray.unfoldr(xs => {
11+ if (xs.tag === "Nil") { return Data$dMaybe.Nothing; }
12+ if (xs.tag === "Cons") { return Data$dMaybe.$Maybe("Just", Data$dTuple.$Tuple(xs._1, xs._2)); }
13+ $runtime.fail();
14+}))();
1015const test = x => Data$dArray.reverse(toUnfoldable((() => {
1116 const loop = loop$a0$copy => loop$a1$copy => {
1217 let loop$a0 = loop$a0$copy, loop$a1 = loop$a1$copy, loop$c = true, loop$r;
backend-es/test/snapshots-out/Snapshot.Fusion02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Fusion02.jsrenamed+7−2
@@ -6,12 +6,17 @@
66// @inline export overArray arity=1
77import * as $runtime from "../runtime.js";
88import * as Data$dArray from "../Data.Array/index.js";
9−import * as Data$dList from "../Data.List/index.js";
109import * as Data$dList$dTypes from "../Data.List.Types/index.js";
10+import * as Data$dMaybe from "../Data.Maybe/index.js";
1111import * as Data$dShow from "../Data.Show/index.js";
1212import * as Data$dString$dCodeUnits from "../Data.String.CodeUnits/index.js";
13+import * as Data$dTuple from "../Data.Tuple/index.js";
1314import * as Data$dUnfoldable from "../Data.Unfoldable/index.js";
14−const toUnfoldable = /* #__PURE__ */ Data$dList.toUnfoldable(Data$dUnfoldable.unfoldableArray);
15+const toUnfoldable = /* #__PURE__ */ (() => Data$dUnfoldable.unfoldableArray.unfoldr(xs => {
16+ if (xs.tag === "Nil") { return Data$dMaybe.Nothing; }
17+ if (xs.tag === "Cons") { return Data$dMaybe.$Maybe("Just", Data$dTuple.$Tuple(xs._1, xs._2)); }
18+ $runtime.fail();
19+}))();
1520const test = x => {
1621 const loop = loop$a0$copy => loop$a1$copy => {
1722 let loop$a0 = loop$a0$copy, loop$a1 = loop$a1$copy, loop$c = true, loop$r;
backend-es/test/snapshots-out/Snapshot.HalogenVDomST01.js → backend-es/test-snapshots/snapshots-out/Snapshot.HalogenVDomST01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.HalogenVDomST02.js → backend-es/test-snapshots/snapshots-out/Snapshot.HalogenVDomST02.jsrenamed+5−6
@@ -1,13 +1,12 @@
11import * as Assert from "../Assert/index.js";
2−import * as Data$dArray$dST from "../Data.Array.ST/index.js";
32import * as Data$dEq from "../Data.Eq/index.js";
43import * as Data$dShow from "../Data.Show/index.js";
54import * as Snapshot$dHalogenVDomST01 from "../Snapshot.HalogenVDomST01/index.js";
65const assertEqual = /* #__PURE__ */ Assert.assertEqual({eq: /* #__PURE__ */ Data$dEq.eqArrayImpl(ra => rb => ra.a === rb.a && ra.b === rb.b)})({
7− show: /* #__PURE__ */ Data$dShow.showArrayImpl(record => "{ a: " + Data$dShow.showStringImpl(record.a) + ", b: " + Data$dShow.showIntImpl(record.b) + " " + "}")
6+ show: /* #__PURE__ */ Data$dShow.showArrayImpl(record => "{ a: " + Data$dShow.showStringImpl(record.a) + ", b: " + Data$dShow.showIntImpl(record.b) + " }")
87});
98const assertEqual3 = /* #__PURE__ */ Assert.assertEqual({eq: /* #__PURE__ */ Data$dEq.eqArrayImpl(ra => rb => ra.a === rb.a && ra.b === rb.b && ra.ix === rb.ix)})({
10− show: /* #__PURE__ */ Data$dShow.showArrayImpl(record => "{ a: " + Data$dShow.showStringImpl(record.a) + ", b: " + Data$dShow.showIntImpl(record.b) + ", ix: " + Data$dShow.showIntImpl(record.ix) + " " + "}")
9+ show: /* #__PURE__ */ Data$dShow.showArrayImpl(record => "{ a: " + Data$dShow.showStringImpl(record.a) + ", b: " + Data$dShow.showIntImpl(record.b) + ", ix: " + Data$dShow.showIntImpl(record.ix) + " }")
1110});
1211const main = () => {
1312 const merged1 = [];
@@ -26,9 +25,9 @@ const main = () => {
2625 return {ix, a: "", b};
2726 }
2827 );
29− const m1 = Data$dArray$dST.freeze(merged1)();
30− const a1 = Data$dArray$dST.freeze(added1)();
31− const d1 = Data$dArray$dST.freeze(deleted1)();
28+ const m1 = [...merged1];
29+ const a1 = [...added1];
30+ const d1 = [...deleted1];
3231 assertEqual("diffWithIxE/merged")({expected: [{a: "1", b: 1}, {a: "2", b: 2}], actual: m1})();
3332 Assert.assertEqual({eq: Data$dEq.eqArrayImpl(Data$dEq.eqIntImpl)})({show: Data$dShow.showArrayImpl(Data$dShow.showIntImpl)})("diffWithIxE/added")({expected: [], actual: a1})();
3433 Assert.assertEqual({eq: Data$dEq.eqArrayImpl(Data$dEq.eqStringImpl)})({show: Data$dShow.showArrayImpl(Data$dShow.showStringImpl)})("diffWithIxE/deleted")({
backend-es/test/snapshots-out/Snapshot.HelloWorld01.js → backend-es/test-snapshots/snapshots-out/Snapshot.HelloWorld01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Heterogeneous01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Heterogeneous01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Html.js → backend-es/test-snapshots/snapshots-out/Snapshot.Html.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.InlineArrayIndex.jsnew file+33
@@ -0,0 +1,33 @@
1+// @inline export testArrayIndex never
2+import * as $runtime from "../runtime.js";
3+import * as Assert from "../Assert/index.js";
4+import * as Data$dMaybe from "../Data.Maybe/index.js";
5+import * as Data$dShow from "../Data.Show/index.js";
6+const assertEqual = /* #__PURE__ */ Assert.assertEqual({
7+ eq: x => y => {
8+ if (x.tag === "Nothing") { return y.tag === "Nothing"; }
9+ return x.tag === "Just" && y.tag === "Just" && x._1 === y._1;
10+ }
11+})({
12+ show: v => {
13+ if (v.tag === "Just") { return "(Just " + Data$dShow.showIntImpl(v._1) + ")"; }
14+ if (v.tag === "Nothing") { return "Nothing"; }
15+ $runtime.fail();
16+ }
17+});
18+const testArrayIndex = arr => ix => {
19+ if (ix >= 0 && ix < arr.length) { return Data$dMaybe.$Maybe("Just", arr[ix]); }
20+ return Data$dMaybe.Nothing;
21+};
22+const main = /* #__PURE__ */ (() => {
23+ const array = [1, 2, 3];
24+ const $0 = assertEqual("index -1")({expected: Data$dMaybe.Nothing, actual: testArrayIndex(array)(-1)});
25+ return () => {
26+ $0();
27+ assertEqual("index 0")({expected: Data$dMaybe.$Maybe("Just", 1), actual: testArrayIndex(array)(0)})();
28+ assertEqual("index 1")({expected: Data$dMaybe.$Maybe("Just", 2), actual: testArrayIndex(array)(1)})();
29+ assertEqual("index 2")({expected: Data$dMaybe.$Maybe("Just", 3), actual: testArrayIndex(array)(2)})();
30+ return assertEqual("index 3")({expected: Data$dMaybe.Nothing, actual: testArrayIndex(array)(3)})();
31+ };
32+})();
33+export {assertEqual, main, testArrayIndex};
backend-es/test/snapshots-out/Snapshot.InlineCase01.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineCase01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.InlineCase02.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineCase02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.InlineDirectivePropSpine01.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineDirectivePropSpine01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.InlineDirectivePropSpine02.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineDirectivePropSpine02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.InlineNever.js → backend-es/test-snapshots/snapshots-out/Snapshot.InlineNever.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceIfThenElse.jsnew file+6
@@ -0,0 +1,6 @@
1+// @inline export fn never
2+const fn = v => 0;
3+const test1 = 42;
4+const extern1 = {a: {b: {c: true}}, d: /* #__PURE__ */ fn({})};
5+const test2 = 42;
6+export {extern1, fn, test1, test2};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceOpArrayLength.jsnew file+9
@@ -0,0 +1,9 @@
1+// @inline export fn' never
2+const test2 = fn => [[1, 2, fn({})], [3, 4], [fn({})]];
3+const test1 = fn => [1, 2, fn({})];
4+const fn$p = v => 0;
5+const extern1 = [1, 2, /* #__PURE__ */ fn$p({})];
6+const extern2 = [extern1, [3], [/* #__PURE__ */ fn$p({})]];
7+const test4 = extern2;
8+const test3 = extern1;
9+export {extern1, extern2, fn$p, test1, test2, test3, test4};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceOpIsTag.jsnew file+15
@@ -0,0 +1,15 @@
1+// @inline export fn' never
2+const $List = (tag, _1, _2) => ({tag, _1, _2});
3+const Cons = value0 => value1 => $List("Cons", value0, value1);
4+const Nil = /* #__PURE__ */ $List("Nil");
5+const test3 = fn => $List("Cons", 0, $List("Cons", 1, fn({})));
6+const test2 = fn => $List("Cons", 0, $List("Cons", 1, fn({})));
7+const test1 = fn => $List("Cons", 0, $List("Cons", 1, fn({})));
8+const fn$p = v => Nil;
9+const extern2 = {a: {b: {c: /* #__PURE__ */ $List("Cons", 1, /* #__PURE__ */ fn$p({}))}}};
10+const extern3 = {d: extern2, e: /* #__PURE__ */ fn$p({})};
11+const test6 = /* #__PURE__ */ (() => $List("Cons", 0, extern2.a.b.c))();
12+const test5 = /* #__PURE__ */ (() => $List("Cons", 0, extern2.a.b.c))();
13+const extern1 = /* #__PURE__ */ $List("Cons", 1, /* #__PURE__ */ fn$p({}));
14+const test4 = /* #__PURE__ */ $List("Cons", 0, extern1);
15+export {$List, Cons, Nil, extern1, extern2, extern3, fn$p, test1, test2, test3, test4, test5, test6};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpBoolean.jsnew file+10
@@ -0,0 +1,10 @@
1+// @inline export fn never
2+const fn = v => 0;
3+const test1 = 42;
4+const test2 = 42;
5+const test3 = 42;
6+const extern1 = {a: {b: {c: true}}, d: /* #__PURE__ */ fn({}), e: true, f: false};
7+const test4 = 42;
8+const test5 = 42;
9+const test6 = 42;
10+export {extern1, fn, test1, test2, test3, test4, test5, test6};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpInt.jsnew file+25
@@ -0,0 +1,25 @@
1+// @inline export fn never
2+// @inline export localTest always
3+// @inline export externTest always
4+const fn = v => 0;
5+const localTest = f => {
6+ const rec = {a: {b: {c: 99}}, d: fn({}), e: 11};
7+ const res = f(rec);
8+ if (res !== -2147483648) { return res; }
9+ return fn(rec);
10+};
11+const test1 = 110;
12+const test2 = 88;
13+const test3 = 1089;
14+const test4 = 9;
15+const extern = {a: {b: {c: 99}}, d: /* #__PURE__ */ fn({}), e: 11};
16+const externTest = f => {
17+ const res = f(extern);
18+ if (res !== -2147483648) { return res; }
19+ return -2147483648;
20+};
21+const test5 = 110;
22+const test6 = 88;
23+const test7 = 1089;
24+const test8 = 9;
25+export {extern, externTest, fn, localTest, test1, test2, test3, test4, test5, test6, test7, test8};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferencePrimOpNumber.jsnew file+25
@@ -0,0 +1,25 @@
1+// @inline export fn never
2+// @inline export localTest always
3+// @inline export externTest always
4+const fn = v => 0.0;
5+const localTest = f => {
6+ const rec = {a: {b: {c: 99.0}}, d: fn({}), e: 11.0};
7+ const res = f(rec);
8+ if (res !== -Infinity) { return res; }
9+ return fn(rec);
10+};
11+const test1 = 110.0;
12+const test2 = 88.0;
13+const test3 = 1089.0;
14+const test4 = 9.0;
15+const extern = {a: {b: {c: 99.0}}, d: /* #__PURE__ */ fn({}), e: 11.0};
16+const externTest = f => {
17+ const res = f(extern);
18+ if (res !== -Infinity) { return res; }
19+ return -Infinity;
20+};
21+const test5 = 110.0;
22+const test6 = 88.0;
23+const test7 = 1089.0;
24+const test8 = 9.0;
25+export {extern, externTest, fn, localTest, test1, test2, test3, test4, test5, test6, test7, test8};
backend-es/test-snapshots/snapshots-out/Snapshot.InlineReferenceRecordUpdate.jsnew file+6
@@ -0,0 +1,6 @@
1+// @inline export fn' never
2+const test1 = fn => fn({}).c;
3+const fn$p = v => ({a: 1, b: 2, c: 3});
4+const extern = {.../* #__PURE__ */ fn$p({}), a: 42};
5+const test2 = /* #__PURE__ */ (() => extern.c)();
6+export {extern, fn$p, test1, test2};
backend-es/test/snapshots-out/Snapshot.KnownConstructor07.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructor07.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors01.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors02.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors03.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors04.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors04.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors05.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors05.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.KnownConstructors06.js → backend-es/test-snapshots/snapshots-out/Snapshot.KnownConstructors06.jsrenamed−2
@@ -15,9 +15,7 @@ const genericTest = {
1515 if (x._1.tag === "Inr") {
1616 if (x._1._1.tag === "Inl") { return Baz; }
1717 if (x._1._1.tag === "Inr") { return Qux; }
18− $runtime.fail();
1918 }
20− $runtime.fail();
2119 }
2220 $runtime.fail();
2321 },
backend-es/test/snapshots-out/Snapshot.Object01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Object01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpArray01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpArray01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpBoolean01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBoolean01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpBoolean02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBoolean02.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpBooleanNotRegression.jsnew file+5
@@ -0,0 +1,5 @@
1+const test = comp => a => b => {
2+ const $0 = comp(a)(b);
3+ return $0 === "LT" || $0 === "GT" || $0 !== "EQ";
4+};
5+export {test};
backend-es/test/snapshots-out/Snapshot.PrimOpChar01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpChar01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpChar02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpChar02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpInt01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt01.jsrenamed+2−2
@@ -1,4 +1,4 @@
1−import * as Data$dEuclideanRing from "../Data.EuclideanRing/index.js";
1+import * as $runtime from "../runtime.js";
22const test9 = a => b => a * b | 0;
33const test8 = a => b => a >= b;
44const test7 = a => b => a <= b;
@@ -8,6 +8,6 @@ const test4 = a => b => a !== b;
88const test3 = a => b => a === b;
99const test2 = a => b => a - b | 0;
1010const test11 = a => -a;
11−const test10 = a => b => Data$dEuclideanRing.intDiv(a)(b);
11+const test10 = a => b => $runtime.intDiv(a, b);
1212const test1 = a => b => a + b | 0;
1313export {test1, test10, test11, test2, test3, test4, test5, test6, test7, test8, test9};
backend-es/test/snapshots-out/Snapshot.PrimOpInt02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt02.jsrenamed+1−9
@@ -1,15 +1,7 @@
1−import * as Data$dEuclideanRing from "../Data.EuclideanRing/index.js";
21const test11 = [-1, 1];
32const intValues = op => [op(1)(1), op(1)(2), op(2)(1), op(1)(-2), op(-1)(2), op(-1)(-1)];
43const test1 = [2, 3, 3, -1, 1, -2];
5−const test10 = [
6− /* #__PURE__ */ Data$dEuclideanRing.intDiv(1)(1),
7− /* #__PURE__ */ Data$dEuclideanRing.intDiv(1)(2),
8− /* #__PURE__ */ Data$dEuclideanRing.intDiv(2)(1),
9− /* #__PURE__ */ Data$dEuclideanRing.intDiv(1)(-2),
10− /* #__PURE__ */ Data$dEuclideanRing.intDiv(-1)(2),
11− /* #__PURE__ */ Data$dEuclideanRing.intDiv(-1)(-1)
12−];
4+const test10 = [1, 0, 2, 0, -1, 1];
135const test2 = [0, -1, 1, 3, -3, 0];
146const test3 = [true, false, false, false, false, true];
157const test4 = [false, true, true, true, true, false];
backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpInt03.jsnew file+5
@@ -0,0 +1,5 @@
1+const test4 = a => (2000000000 + a | 0) + 2000000000 | 0;
2+const test3 = /* #__PURE__ */ (() => 2000000000 * 2000000000 | 0)();
3+const test2 = /* #__PURE__ */ (() => -2000000000 - 2000000000 | 0)();
4+const test1 = /* #__PURE__ */ (() => 2000000000 + 2000000000 | 0)();
5+export {test1, test2, test3, test4};
backend-es/test/snapshots-out/Snapshot.PrimOpIntBit01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntBit01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpIntBit02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntBit02.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpIntDiv.jsnew file+15
@@ -0,0 +1,15 @@
1+// @inline export divNoInline never
2+import * as $runtime from "../runtime.js";
3+import * as Assert from "../Assert/index.js";
4+import * as Data$dEq from "../Data.Eq/index.js";
5+import * as Data$dShow from "../Data.Show/index.js";
6+const divNoInline = a => b => $runtime.intDiv(a, b);
7+const main = /* #__PURE__ */ (() => {
8+ const $0 = Assert.assertEqual(Data$dEq.eqInt)(Data$dShow.showInt)("div1")({expected: 0, actual: divNoInline(1)(0)});
9+ return () => {
10+ $0();
11+ Assert.assertEqual(Data$dEq.eqInt)(Data$dShow.showInt)("div2")({expected: 1, actual: divNoInline(3)(2)})();
12+ return Assert.assertEqual(Data$dEq.eqInt)(Data$dShow.showInt)("div3")({expected: -1, actual: divNoInline(3)(-2)})();
13+ };
14+})();
15+export {divNoInline, main};
backend-es/test/snapshots-out/Snapshot.PrimOpNumber01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpNumber01.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpNumber02.jsnew file+14
@@ -0,0 +1,14 @@
1+const test11 = [-1.5, 1.5];
2+const nan = NaN;
3+const numValues = op => [op(1.5)(1.0), op(1.5)(2.0), op(2.5)(1.0), op(1.5)(-2.0), op(-1.5)(2.0), op(-1.5)(-1.0), op(1.0)(NaN)];
4+const test1 = [2.5, 3.5, 3.5, -0.5, 0.5, -2.5, NaN];
5+const test10 = [1.5, 0.75, 2.5, -0.75, -0.75, 1.5, NaN];
6+const test2 = [0.5, -0.5, 1.5, 3.5, -3.5, -0.5, NaN];
7+const test3 = [false, false, false, false, false, false, false];
8+const test4 = [true, true, true, true, true, true, true];
9+const test5 = [false, true, false, false, true, true, false];
10+const test6 = [true, false, true, true, false, false, false];
11+const test7 = [false, true, false, false, true, true, false];
12+const test8 = [true, false, true, true, false, false, false];
13+const test9 = [1.5, 3.0, 2.5, -3.0, -3.0, 1.5, NaN];
14+export {nan, numValues, test1, test10, test11, test2, test3, test4, test5, test6, test7, test8, test9};
backend-es/test/snapshots-out/Snapshot.PrimOpString01.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpString02.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.PrimOpString03.js → backend-es/test-snapshots/snapshots-out/Snapshot.PrimOpString03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.ProfunctorLenses01.js → backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.ProfunctorLenses02.js → backend-es/test-snapshots/snapshots-out/Snapshot.ProfunctorLenses02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.RecordUnion01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecordUnion01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.RecursionSchemes01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursionSchemes01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.RecursiveBindingGroup01.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursiveBindingGroup01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.RecursiveBindingGroup02.js → backend-es/test-snapshots/snapshots-out/Snapshot.RecursiveBindingGroup02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STArray01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STArray02.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STArray03.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STArray04.js → backend-es/test-snapshots/snapshots-out/Snapshot.STArray04.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.STArray05.jsnew file+7
@@ -0,0 +1,7 @@
1+const test = x => {
2+ const $0 = x ? (a => () => a.push(1)) : a => () => a.unshift(2);
3+ const arr = [];
4+ $0(arr)();
5+ return arr;
6+};
7+export {test};
backend-es/test-snapshots/snapshots-out/Snapshot.STArrayUnsafeThawFreezeLengthRegression.jsnew file+7
@@ -0,0 +1,7 @@
1+const test = x => {
2+ const result = [x];
3+ result.push(12);
4+ result.push(result.length);
5+ return result;
6+};
7+export {test};
backend-es/test/snapshots-out/Snapshot.STLoops01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STLoops02.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STLoops03.js → backend-es/test-snapshots/snapshots-out/Snapshot.STLoops03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STObject01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STObject01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.STRun01.js → backend-es/test-snapshots/snapshots-out/Snapshot.STRun01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.ShowLiterals.js → backend-es/test-snapshots/snapshots-out/Snapshot.ShowLiterals.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.StringLiteral01.js → backend-es/test-snapshots/snapshots-out/Snapshot.StringLiteral01.jsrenamed+2−1
@@ -1,4 +1,5 @@
1+const test4 = "\udc11";
12const test3 = "\u0000";
23const test2 = "\u0012";
34const test1 = "B";
4−export {test1, test2, test3};
5+export {test1, test2, test3, test4};
backend-es/test/snapshots-out/Snapshot.Tco01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Tco02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Tco03.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco03.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Tco04.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco04.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Tco05.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco05.jsrenamed+4−11
@@ -1,14 +1,11 @@
1−import * as $runtime from "../runtime.js";
2−import * as Data$dArray from "../Data.Array/index.js";
31import * as Data$dMaybe from "../Data.Maybe/index.js";
42const span = p => arr => {
53 const go = go$a0$copy => {
64 let go$a0 = go$a0$copy, go$c = true, go$r;
75 while (go$c) {
86 const i = go$a0;
9− const v = Data$dArray.index(arr)(i);
10− if (v.tag === "Just") {
11− if (p(v._1)) {
7+ if (i >= 0 && i < arr.length) {
8+ if (p(arr[i])) {
129 go$a0 = i + 1 | 0;
1310 continue;
1411 }
@@ -16,12 +13,8 @@ const span = p => arr => {
1613 go$r = Data$dMaybe.$Maybe("Just", i);
1714 continue;
1815 }
19− if (v.tag === "Nothing") {
20− go$c = false;
21− go$r = Data$dMaybe.Nothing;
22− continue;
23− }
24− $runtime.fail();
16+ go$c = false;
17+ go$r = Data$dMaybe.Nothing;
2518 }
2619 return go$r;
2720 };
backend-es/test/snapshots-out/Snapshot.Tco06.js → backend-es/test-snapshots/snapshots-out/Snapshot.Tco06.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.TopLevelHygiene01.js → backend-es/test-snapshots/snapshots-out/Snapshot.TopLevelHygiene01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.TopLevelHygiene02.js → backend-es/test-snapshots/snapshots-out/Snapshot.TopLevelHygiene02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedEffectFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedEffectFns01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedEffectFns02.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedEffectFns02.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedFns01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedLocalAbs01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedLocalAbs01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedSTFns01.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedSTFns01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.UncurriedSTFns02.js → backend-es/test-snapshots/snapshots-out/Snapshot.UncurriedSTFns02.jsrenamed

The content is the same.

backend-es/test-snapshots/snapshots-out/Snapshot.UnpackArray01.jsnew file+2
@@ -0,0 +1,2 @@
1+const test = fn1 => fn2 => fn1("foo")("baz");
2+export {test};
backend-es/test/snapshots-out/Snapshot.UnsafePerformEffect.js → backend-es/test-snapshots/snapshots-out/Snapshot.UnsafePerformEffect.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.VanLaarhovenTraversals01.js → backend-es/test-snapshots/snapshots-out/Snapshot.VanLaarhovenTraversals01.jsrenamed+8−8
@@ -6,24 +6,24 @@ const Abs = value0 => value1 => $Fun("Abs", value0, value1);
66const App = value0 => value1 => $Fun("App", value0, value1);
77const traverseFun1 = dictApplicative => {
88 const Apply0 = dictApplicative.Apply0();
9− const map = Apply0.Functor0().map;
9+ const $0 = Apply0.Functor0();
1010 return k => v => {
11− if (v.tag === "Abs") { return map(Abs(v._1))(k(v._2)); }
12− if (v.tag === "App") { return Apply0.apply(map(App)(k(v._1)))(k(v._2)); }
11+ if (v.tag === "Abs") { return $0.map(Abs(v._1))(k(v._2)); }
12+ if (v.tag === "App") { return Apply0.apply($0.map(App)(k(v._1)))(k(v._2)); }
1313 $runtime.fail();
1414 };
1515};
1616const rewriteBottomUpM = dictMonad => {
1717 const Apply0 = dictMonad.Applicative0().Apply0();
18− const map = Apply0.Functor0().map;
19− const $0 = dictMonad.Bind1();
18+ const $0 = Apply0.Functor0();
19+ const $1 = dictMonad.Bind1();
2020 return k => {
2121 const go = a => {
22− if (a.tag === "Abs") { return map(Abs(a._1))($0.bind(go(a._2))(k)); }
23− if (a.tag === "App") { return Apply0.apply(map(App)($0.bind(go(a._1))(k)))($0.bind(go(a._2))(k)); }
22+ if (a.tag === "Abs") { return $0.map(Abs(a._1))($1.bind(go(a._2))(k)); }
23+ if (a.tag === "App") { return Apply0.apply($0.map(App)($1.bind(go(a._1))(k)))($1.bind(go(a._2))(k)); }
2424 $runtime.fail();
2525 };
26− return a => $0.bind(go(a))(k);
26+ return a => $1.bind(go(a))(k);
2727 };
2828};
2929const rewriteBottomUp = k => {
backend-es/test/snapshots-out/Snapshot.Variant01.js → backend-es/test-snapshots/snapshots-out/Snapshot.Variant01.jsrenamed

The content is the same.

backend-es/test/snapshots-out/Snapshot.Variant02.js → backend-es/test-snapshots/snapshots-out/Snapshot.Variant02.jsrenamed

The content is the same.

backend-es/test-snapshots/spago.locknew file+736
@@ -0,0 +1,736 @@
1+{
2+ "workspace": {
3+ "packages": {
4+ "backend-es-test-snapshots": {
5+ "path": "./",
6+ "core": {
7+ "dependencies": [
8+ {
9+ "arrays": ">=7.3.0 <8.0.0"
10+ },
11+ {
12+ "console": ">=6.1.0 <7.0.0"
13+ },
14+ {
15+ "convertable-options": ">=1.0.0 <2.0.0"
16+ },
17+ {
18+ "effect": ">=4.0.0 <5.0.0"
19+ },
20+ {
21+ "either": ">=6.1.0 <7.0.0"
22+ },
23+ {
24+ "exceptions": ">=6.1.0 <7.0.0"
25+ },
26+ {
27+ "exists": ">=6.0.0 <7.0.0"
28+ },
29+ {
30+ "foldable-traversable": ">=6.0.0 <7.0.0"
31+ },
32+ {
33+ "foreign-object": ">=4.1.0 <5.0.0"
34+ },
35+ {
36+ "functions": ">=6.0.0 <7.0.0"
37+ },
38+ {
39+ "heterogeneous": ">=0.7.0 <0.8.0"
40+ },
41+ {
42+ "identity": ">=6.0.0 <7.0.0"
43+ },
44+ {
45+ "integers": ">=6.0.0 <7.0.0"
46+ },
47+ {
48+ "lists": ">=7.0.0 <8.0.0"
49+ },
50+ {
51+ "maybe": ">=6.0.0 <7.0.0"
52+ },
53+ {
54+ "partial": ">=4.0.0 <5.0.0"
55+ },
56+ {
57+ "prelude": ">=6.0.2 <7.0.0"
58+ },
59+ {
60+ "profunctor-lenses": ">=8.0.0 <9.0.0"
61+ },
62+ {
63+ "record": ">=4.0.0 <5.0.0"
64+ },
65+ {
66+ "refs": ">=6.0.0 <7.0.0"
67+ },
68+ {
69+ "safe-coerce": ">=2.0.0 <3.0.0"
70+ },
71+ {
72+ "st": ">=6.2.0 <7.0.0"
73+ },
74+ {
75+ "strings": ">=6.0.1 <7.0.0"
76+ },
77+ {
78+ "tuples": ">=7.0.0 <8.0.0"
79+ },
80+ {
81+ "type-equality": ">=4.0.1 <5.0.0"
82+ },
83+ {
84+ "unsafe-coerce": ">=6.0.0 <7.0.0"
85+ },
86+ {
87+ "variant": ">=8.0.0 <9.0.0"
88+ }
89+ ],
90+ "build_plan": [
91+ "arrays",
92+ "bifunctors",
93+ "console",
94+ "const",
95+ "contravariant",
96+ "control",
97+ "convertable-options",
98+ "distributive",
99+ "effect",
100+ "either",
101+ "enums",
102+ "exceptions",
103+ "exists",
104+ "foldable-traversable",
105+ "foreign-object",
106+ "functions",
107+ "functors",
108+ "gen",
109+ "heterogeneous",
110+ "identity",
111+ "integers",
112+ "invariant",
113+ "lazy",
114+ "lists",
115+ "maybe",
116+ "newtype",
117+ "nonempty",
118+ "numbers",
119+ "ordered-collections",
120+ "orders",
121+ "partial",
122+ "prelude",
123+ "profunctor",
124+ "profunctor-lenses",
125+ "record",
126+ "refs",
127+ "safe-coerce",
128+ "st",
129+ "strings",
130+ "tailrec",
131+ "transformers",
132+ "tuples",
133+ "type-equality",
134+ "typelevel-prelude",
135+ "unfoldable",
136+ "unsafe-coerce",
137+ "variant"
138+ ]
139+ },
140+ "test": {
141+ "dependencies": [],
142+ "build_plan": []
143+ }
144+ }
145+ },
146+ "extra_packages": {}
147+ },
148+ "packages": {
149+ "arrays": {
150+ "type": "registry",
151+ "version": "7.3.0",
152+ "integrity": "sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc=",
153+ "dependencies": [
154+ "bifunctors",
155+ "control",
156+ "foldable-traversable",
157+ "functions",
158+ "maybe",
159+ "nonempty",
160+ "partial",
161+ "prelude",
162+ "safe-coerce",
163+ "st",
164+ "tailrec",
165+ "tuples",
166+ "unfoldable",
167+ "unsafe-coerce"
168+ ]
169+ },
170+ "bifunctors": {
171+ "type": "registry",
172+ "version": "6.1.0",
173+ "integrity": "sha256-6enQzl1vqnFTQZ1WX9BnoOOVdPGO9WZvVXldHckVQvY=",
174+ "dependencies": [
175+ "const",
176+ "either",
177+ "newtype",
178+ "prelude",
179+ "tuples"
180+ ]
181+ },
182+ "console": {
183+ "type": "registry",
184+ "version": "6.1.0",
185+ "integrity": "sha256-CxmAzjgyuGDmt9FZW51VhV6rBPwR6o0YeKUzA9rSzcM=",
186+ "dependencies": [
187+ "effect",
188+ "prelude"
189+ ]
190+ },
191+ "const": {
192+ "type": "registry",
193+ "version": "6.0.0",
194+ "integrity": "sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc=",
195+ "dependencies": [
196+ "invariant",
197+ "newtype",
198+ "prelude"
199+ ]
200+ },
201+ "contravariant": {
202+ "type": "registry",
203+ "version": "6.0.0",
204+ "integrity": "sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c=",
205+ "dependencies": [
206+ "const",
207+ "either",
208+ "newtype",
209+ "prelude",
210+ "tuples"
211+ ]
212+ },
213+ "control": {
214+ "type": "registry",
215+ "version": "6.0.0",
216+ "integrity": "sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk=",
217+ "dependencies": [
218+ "newtype",
219+ "prelude"
220+ ]
221+ },
222+ "convertable-options": {
223+ "type": "registry",
224+ "version": "1.0.0",
225+ "integrity": "sha256-IFsYp0rXyzUtjoi3jed6yFYAVM+NhfgSn2j/zkjpccM=",
226+ "dependencies": [
227+ "console",
228+ "effect",
229+ "maybe",
230+ "record"
231+ ]
232+ },
233+ "distributive": {
234+ "type": "registry",
235+ "version": "6.0.0",
236+ "integrity": "sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ=",
237+ "dependencies": [
238+ "identity",
239+ "newtype",
240+ "prelude",
241+ "tuples",
242+ "type-equality"
243+ ]
244+ },
245+ "effect": {
246+ "type": "registry",
247+ "version": "4.0.0",
248+ "integrity": "sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M=",
249+ "dependencies": [
250+ "prelude"
251+ ]
252+ },
253+ "either": {
254+ "type": "registry",
255+ "version": "6.1.0",
256+ "integrity": "sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY=",
257+ "dependencies": [
258+ "control",
259+ "invariant",
260+ "maybe",
261+ "prelude"
262+ ]
263+ },
264+ "enums": {
265+ "type": "registry",
266+ "version": "6.0.1",
267+ "integrity": "sha256-HWaD73JFLorc4A6trKIRUeDMdzE+GpkJaEOM1nTNkC8=",
268+ "dependencies": [
269+ "control",
270+ "either",
271+ "gen",
272+ "maybe",
273+ "newtype",
274+ "nonempty",
275+ "partial",
276+ "prelude",
277+ "tuples",
278+ "unfoldable"
279+ ]
280+ },
281+ "exceptions": {
282+ "type": "registry",
283+ "version": "6.1.0",
284+ "integrity": "sha256-K0T89IHtF3vBY7eSAO7eDOqSb2J9kZGAcDN5+IKsF8E=",
285+ "dependencies": [
286+ "effect",
287+ "either",
288+ "maybe",
289+ "prelude"
290+ ]
291+ },
292+ "exists": {
293+ "type": "registry",
294+ "version": "6.0.0",
295+ "integrity": "sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8=",
296+ "dependencies": [
297+ "unsafe-coerce"
298+ ]
299+ },
300+ "foldable-traversable": {
301+ "type": "registry",
302+ "version": "6.0.0",
303+ "integrity": "sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM=",
304+ "dependencies": [
305+ "bifunctors",
306+ "const",
307+ "control",
308+ "either",
309+ "functors",
310+ "identity",
311+ "maybe",
312+ "newtype",
313+ "orders",
314+ "prelude",
315+ "tuples"
316+ ]
317+ },
318+ "foreign-object": {
319+ "type": "registry",
320+ "version": "4.1.0",
321+ "integrity": "sha256-q24okj6mT+yGHYQ+ei/pYPj5ih6sTbu7eDv/WU56JVo=",
322+ "dependencies": [
323+ "arrays",
324+ "foldable-traversable",
325+ "functions",
326+ "gen",
327+ "lists",
328+ "maybe",
329+ "prelude",
330+ "st",
331+ "tailrec",
332+ "tuples",
333+ "typelevel-prelude",
334+ "unfoldable"
335+ ]
336+ },
337+ "functions": {
338+ "type": "registry",
339+ "version": "6.0.0",
340+ "integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=",
341+ "dependencies": [
342+ "prelude"
343+ ]
344+ },
345+ "functors": {
346+ "type": "registry",
347+ "version": "5.0.0",
348+ "integrity": "sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU=",
349+ "dependencies": [
350+ "bifunctors",
351+ "const",
352+ "contravariant",
353+ "control",
354+ "distributive",
355+ "either",
356+ "invariant",
357+ "maybe",
358+ "newtype",
359+ "prelude",
360+ "profunctor",
361+ "tuples",
362+ "unsafe-coerce"
363+ ]
364+ },
365+ "gen": {
366+ "type": "registry",
367+ "version": "4.0.0",
368+ "integrity": "sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI=",
369+ "dependencies": [
370+ "either",
371+ "foldable-traversable",
372+ "identity",
373+ "maybe",
374+ "newtype",
375+ "nonempty",
376+ "prelude",
377+ "tailrec",
378+ "tuples",
379+ "unfoldable"
380+ ]
381+ },
382+ "heterogeneous": {
383+ "type": "registry",
384+ "version": "0.7.0",
385+ "integrity": "sha256-GwpFqhE6nT2brsMbGBqeCEtkdeU9qLgBk8L1YHI+f2A=",
386+ "dependencies": [
387+ "either",
388+ "foldable-traversable",
389+ "functors",
390+ "prelude",
391+ "record",
392+ "tuples",
393+ "variant"
394+ ]
395+ },
396+ "identity": {
397+ "type": "registry",
398+ "version": "6.0.0",
399+ "integrity": "sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY=",
400+ "dependencies": [
401+ "control",
402+ "invariant",
403+ "newtype",
404+ "prelude"
405+ ]
406+ },
407+ "integers": {
408+ "type": "registry",
409+ "version": "6.0.0",
410+ "integrity": "sha256-sf+sK26R1hzwl3NhXR7WAu9zCDjQnfoXwcyGoseX158=",
411+ "dependencies": [
412+ "maybe",
413+ "numbers",
414+ "prelude"
415+ ]
416+ },
417+ "invariant": {
418+ "type": "registry",
419+ "version": "6.0.0",
420+ "integrity": "sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo=",
421+ "dependencies": [
422+ "control",
423+ "prelude"
424+ ]
425+ },
426+ "lazy": {
427+ "type": "registry",
428+ "version": "6.0.0",
429+ "integrity": "sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU=",
430+ "dependencies": [
431+ "control",
432+ "foldable-traversable",
433+ "invariant",
434+ "prelude"
435+ ]
436+ },
437+ "lists": {
438+ "type": "registry",
439+ "version": "7.0.0",
440+ "integrity": "sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI=",
441+ "dependencies": [
442+ "bifunctors",
443+ "control",
444+ "foldable-traversable",
445+ "lazy",
446+ "maybe",
447+ "newtype",
448+ "nonempty",
449+ "partial",
450+ "prelude",
451+ "tailrec",
452+ "tuples",
453+ "unfoldable"
454+ ]
455+ },
456+ "maybe": {
457+ "type": "registry",
458+ "version": "6.0.0",
459+ "integrity": "sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q=",
460+ "dependencies": [
461+ "control",
462+ "invariant",
463+ "newtype",
464+ "prelude"
465+ ]
466+ },
467+ "newtype": {
468+ "type": "registry",
469+ "version": "5.0.0",
470+ "integrity": "sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw=",
471+ "dependencies": [
472+ "prelude",
473+ "safe-coerce"
474+ ]
475+ },
476+ "nonempty": {
477+ "type": "registry",
478+ "version": "7.0.0",
479+ "integrity": "sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs=",
480+ "dependencies": [
481+ "control",
482+ "foldable-traversable",
483+ "maybe",
484+ "prelude",
485+ "tuples",
486+ "unfoldable"
487+ ]
488+ },
489+ "numbers": {
490+ "type": "registry",
491+ "version": "9.0.1",
492+ "integrity": "sha256-/9M6aeMDBdB4cwYDeJvLFprAHZ49EbtKQLIJsneXLIk=",
493+ "dependencies": [
494+ "functions",
495+ "maybe"
496+ ]
497+ },
498+ "ordered-collections": {
499+ "type": "registry",
500+ "version": "3.2.0",
501+ "integrity": "sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM=",
502+ "dependencies": [
503+ "arrays",
504+ "foldable-traversable",
505+ "gen",
506+ "lists",
507+ "maybe",
508+ "partial",
509+ "prelude",
510+ "st",
511+ "tailrec",
512+ "tuples",
513+ "unfoldable"
514+ ]
515+ },
516+ "orders": {
517+ "type": "registry",
518+ "version": "6.0.0",
519+ "integrity": "sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink=",
520+ "dependencies": [
521+ "newtype",
522+ "prelude"
523+ ]
524+ },
525+ "partial": {
526+ "type": "registry",
527+ "version": "4.0.0",
528+ "integrity": "sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4=",
529+ "dependencies": []
530+ },
531+ "prelude": {
532+ "type": "registry",
533+ "version": "6.0.2",
534+ "integrity": "sha256-kiAPZxihtAel8uRiTNdccf4qylp/9J3jNkEHNAD0MsE=",
535+ "dependencies": []
536+ },
537+ "profunctor": {
538+ "type": "registry",
539+ "version": "6.0.1",
540+ "integrity": "sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk=",
541+ "dependencies": [
542+ "control",
543+ "distributive",
544+ "either",
545+ "exists",
546+ "invariant",
547+ "newtype",
548+ "prelude",
549+ "tuples"
550+ ]
551+ },
552+ "profunctor-lenses": {
553+ "type": "registry",
554+ "version": "8.0.0",
555+ "integrity": "sha256-K7f29rHRHgVSb2Y/PaSKtfYPriP6n87BJNO7EhsZHas=",
556+ "dependencies": [
557+ "arrays",
558+ "bifunctors",
559+ "const",
560+ "control",
561+ "distributive",
562+ "either",
563+ "foldable-traversable",
564+ "foreign-object",
565+ "functors",
566+ "identity",
567+ "lists",
568+ "maybe",
569+ "newtype",
570+ "ordered-collections",
571+ "partial",
572+ "prelude",
573+ "profunctor",
574+ "record",
575+ "transformers",
576+ "tuples"
577+ ]
578+ },
579+ "record": {
580+ "type": "registry",
581+ "version": "4.0.0",
582+ "integrity": "sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg=",
583+ "dependencies": [
584+ "functions",
585+ "prelude",
586+ "unsafe-coerce"
587+ ]
588+ },
589+ "refs": {
590+ "type": "registry",
591+ "version": "6.0.0",
592+ "integrity": "sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s=",
593+ "dependencies": [
594+ "effect",
595+ "prelude"
596+ ]
597+ },
598+ "safe-coerce": {
599+ "type": "registry",
600+ "version": "2.0.0",
601+ "integrity": "sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU=",
602+ "dependencies": [
603+ "unsafe-coerce"
604+ ]
605+ },
606+ "st": {
607+ "type": "registry",
608+ "version": "6.2.0",
609+ "integrity": "sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY=",
610+ "dependencies": [
611+ "partial",
612+ "prelude",
613+ "tailrec",
614+ "unsafe-coerce"
615+ ]
616+ },
617+ "strings": {
618+ "type": "registry",
619+ "version": "6.0.1",
620+ "integrity": "sha256-WssD3DbX4OPzxSdjvRMX0yvc9+pS7n5gyPv5I2Trb7k=",
621+ "dependencies": [
622+ "arrays",
623+ "control",
624+ "either",
625+ "enums",
626+ "foldable-traversable",
627+ "gen",
628+ "integers",
629+ "maybe",
630+ "newtype",
631+ "nonempty",
632+ "partial",
633+ "prelude",
634+ "tailrec",
635+ "tuples",
636+ "unfoldable",
637+ "unsafe-coerce"
638+ ]
639+ },
640+ "tailrec": {
641+ "type": "registry",
642+ "version": "6.1.0",
643+ "integrity": "sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk=",
644+ "dependencies": [
645+ "bifunctors",
646+ "effect",
647+ "either",
648+ "identity",
649+ "maybe",
650+ "partial",
651+ "prelude",
652+ "refs"
653+ ]
654+ },
655+ "transformers": {
656+ "type": "registry",
657+ "version": "6.1.0",
658+ "integrity": "sha256-3Bm+Z6tsC/paG888XkywDngJ2JMos+JfOhRlkVfb7gI=",
659+ "dependencies": [
660+ "control",
661+ "distributive",
662+ "effect",
663+ "either",
664+ "exceptions",
665+ "foldable-traversable",
666+ "identity",
667+ "lazy",
668+ "maybe",
669+ "newtype",
670+ "prelude",
671+ "st",
672+ "tailrec",
673+ "tuples",
674+ "unfoldable"
675+ ]
676+ },
677+ "tuples": {
678+ "type": "registry",
679+ "version": "7.0.0",
680+ "integrity": "sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M=",
681+ "dependencies": [
682+ "control",
683+ "invariant",
684+ "prelude"
685+ ]
686+ },
687+ "type-equality": {
688+ "type": "registry",
689+ "version": "4.0.1",
690+ "integrity": "sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw=",
691+ "dependencies": []
692+ },
693+ "typelevel-prelude": {
694+ "type": "registry",
695+ "version": "7.0.0",
696+ "integrity": "sha256-uFF2ph+vHcQpfPuPf2a3ukJDFmLhApmkpTMviHIWgJM=",
697+ "dependencies": [
698+ "prelude",
699+ "type-equality"
700+ ]
701+ },
702+ "unfoldable": {
703+ "type": "registry",
704+ "version": "6.0.0",
705+ "integrity": "sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg=",
706+ "dependencies": [
707+ "foldable-traversable",
708+ "maybe",
709+ "partial",
710+ "prelude",
711+ "tuples"
712+ ]
713+ },
714+ "unsafe-coerce": {
715+ "type": "registry",
716+ "version": "6.0.0",
717+ "integrity": "sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0=",
718+ "dependencies": []
719+ },
720+ "variant": {
721+ "type": "registry",
722+ "version": "8.0.0",
723+ "integrity": "sha256-SR//zQDg2dnbB8ZHslcxieUkCeNlbMToapvmh9onTtw=",
724+ "dependencies": [
725+ "enums",
726+ "lists",
727+ "maybe",
728+ "partial",
729+ "prelude",
730+ "record",
731+ "tuples",
732+ "unsafe-coerce"
733+ ]
734+ }
735+ }
736+}
backend-es/test-snapshots/spago.yamlnew file+36
@@ -0,0 +1,36 @@
1+package:
2+ name: backend-es-test-snapshots
3+ build:
4+ censorProjectWarnings:
5+ - WildcardInferredType
6+ - MissingTypeDeclaration
7+ dependencies:
8+ - arrays: ">=7.3.0 <8.0.0"
9+ - console: ">=6.1.0 <7.0.0"
10+ - convertable-options: ">=1.0.0 <2.0.0"
11+ - effect: ">=4.0.0 <5.0.0"
12+ - either: ">=6.1.0 <7.0.0"
13+ - exceptions: ">=6.1.0 <7.0.0"
14+ - exists: ">=6.0.0 <7.0.0"
15+ - foldable-traversable: ">=6.0.0 <7.0.0"
16+ - foreign-object: ">=4.1.0 <5.0.0"
17+ - functions: ">=6.0.0 <7.0.0"
18+ - heterogeneous: ">=0.7.0 <0.8.0"
19+ - identity: ">=6.0.0 <7.0.0"
20+ - integers: ">=6.0.0 <7.0.0"
21+ - lists: ">=7.0.0 <8.0.0"
22+ - maybe: ">=6.0.0 <7.0.0"
23+ - partial: ">=4.0.0 <5.0.0"
24+ - prelude: ">=6.0.2 <7.0.0"
25+ - profunctor-lenses: ">=8.0.0 <9.0.0"
26+ - record: ">=4.0.0 <5.0.0"
27+ - refs: ">=6.0.0 <7.0.0"
28+ - safe-coerce: ">=2.0.0 <3.0.0"
29+ - st: ">=6.2.0 <7.0.0"
30+ - strings: ">=6.0.1 <7.0.0"
31+ - tuples: ">=7.0.0 <8.0.0"
32+ - type-equality: ">=4.0.1 <5.0.0"
33+ - unsafe-coerce: ">=6.0.0 <7.0.0"
34+ - variant: ">=8.0.0 <9.0.0"
35+workspace:
36+ {}
backend-es/test/snapshots/Assert.purs → backend-es/test-snapshots/src/Assert.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.AssocArrayAppend.pursnew file+12
@@ -0,0 +1,12 @@
1+module Snapshot.AssocArrayAppend where
2+
3+import Prelude
4+
5+test1 :: Array String -> Array String
6+test1 x = [ "a" ] <> ((((([ "b" ] <> x) <> x) <> x) <> x) <> [ "c" ]) <> [ "d" ]
7+
8+test2 :: Array String -> Array String
9+test2 x = [ "a" ] <> ([ "b" ] <> (x <> (x <> (x <> (x <> [ "c" ]))))) <> [ "d" ]
10+
11+test3 :: Array String -> Array String
12+test3 x = [ "a" ] <> ([ "b" ] <> (x <> (x <> (x <> (x <> [ "c" ]))))) <> [ "d" ] <> ((((([ "e" ] <> x) <> x) <> x) <> x) <> [ "f" ]) <> [ "g" ]
backend-es/test-snapshots/src/Snapshot.AssocIntOps.pursnew file+21
@@ -0,0 +1,21 @@
1+module Snapshot.AssocIntOps where
2+
3+import Prelude
4+
5+test1 :: Int -> Int
6+test1 x = 1 + (((((2 + x) + x) + x) + x) + 3) + 4
7+
8+test2 :: Int -> Int
9+test2 x = 1 + (2 + (x + (x + (x + (x + 3))))) + 4
10+
11+test3 :: Int -> Int
12+test3 x = 1 + (2 + (x + (x + (x + (x + 3))))) + 4 + (((((5 + x) + x) + x) + x) + 6) + 7
13+
14+test4 :: Int -> Int
15+test4 x = 1 * (((((2 * x) * x) * x) * x) * 3) * 4
16+
17+test5 :: Int -> Int
18+test5 x = 1 * (2 * (x * (x * (x * (x * 3))))) * 4
19+
20+test6 :: Int -> Int
21+test6 x = 1 * (2 * (x * (x * (x * (x * 3))))) * 4 * (((((5 * x) * x) * x) * x) * 6) * 7
backend-es/test-snapshots/src/Snapshot.AssocNumberOps.pursnew file+21
@@ -0,0 +1,21 @@
1+module Snapshot.AssocNumberOps where
2+
3+import Prelude
4+
5+test1 :: Number -> Number
6+test1 x = 1.0 + (((((2.0 + x) + x) + x) + x) + 3.0) + 4.0
7+
8+test2 :: Number -> Number
9+test2 x = 1.0 + (2.0 + (x + (x + (x + (x + 3.0))))) + 4.0
10+
11+test3 :: Number -> Number
12+test3 x = 1.0 + (2.0 + (x + (x + (x + (x + 3.0))))) + 4.0 + (((((5.0 + x) + x) + x) + x) + 6.0) + 7.0
13+
14+test4 :: Number -> Number
15+test4 x = 1.0 * (((((2.0 * x) * x) * x) * x) * 3.0) * 4.0
16+
17+test5 :: Number -> Number
18+test5 x = 1.0 * (2.0 * (x * (x * (x * (x * 3.0))))) * 4.0
19+
20+test6 :: Number -> Number
21+test6 x = 1.0 * (2.0 * (x * (x * (x * (x * 3.0))))) * 4.0 * (((((5.0 * x) * x) * x) * x) * 6.0) * 7.0
backend-es/test-snapshots/src/Snapshot.AssocStringAppend.pursnew file+12
@@ -0,0 +1,12 @@
1+module Snapshot.AssocStringAppend where
2+
3+import Prelude
4+
5+test1 :: String -> String
6+test1 x = "a" <> ((((("b" <> x) <> x) <> x) <> x) <> "c") <> "d"
7+
8+test2 :: String -> String
9+test2 x = "a" <> ("b" <> (x <> (x <> (x <> (x <> "c"))))) <> "d"
10+
11+test3 :: String -> String
12+test3 x = "a" <> ("b" <> (x <> (x <> (x <> (x <> "c"))))) <> "d" <> ((((("e" <> x) <> x) <> x) <> x) <> "f") <> "g"
backend-es/test/snapshots/Snapshot.BackendSemantics01.purs → backend-es/test-snapshots/src/Snapshot.BackendSemantics01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.BackendSemantics02.purs → backend-es/test-snapshots/src/Snapshot.BackendSemantics02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.BranchSpecialization01.purs → backend-es/test-snapshots/src/Snapshot.BranchSpecialization01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaptureDerefRegression01.purs → backend-es/test-snapshots/src/Snapshot.CaptureDerefRegression01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseCtorNewtype.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorNewtype.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseCtorProduct.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorProduct.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseCtorSum.purs → backend-es/test-snapshots/src/Snapshot.CaseCtorSum.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseGrafting.purs → backend-es/test-snapshots/src/Snapshot.CaseGrafting.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseGuarded.purs → backend-es/test-snapshots/src/Snapshot.CaseGuarded.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseHeuristics.purs → backend-es/test-snapshots/src/Snapshot.CaseHeuristics.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseJacobs.purs → backend-es/test-snapshots/src/Snapshot.CaseJacobs.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLeafTco.purs → backend-es/test-snapshots/src/Snapshot.CaseLeafTco.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitArray.purs → backend-es/test-snapshots/src/Snapshot.CaseLitArray.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitBoolean.purs → backend-es/test-snapshots/src/Snapshot.CaseLitBoolean.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitChar.purs → backend-es/test-snapshots/src/Snapshot.CaseLitChar.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitInt.purs → backend-es/test-snapshots/src/Snapshot.CaseLitInt.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitNumber.purs → backend-es/test-snapshots/src/Snapshot.CaseLitNumber.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitRecord.purs → backend-es/test-snapshots/src/Snapshot.CaseLitRecord.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseLitString.purs → backend-es/test-snapshots/src/Snapshot.CaseLitString.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseMulti.purs → backend-es/test-snapshots/src/Snapshot.CaseMulti.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseNamed.purs → backend-es/test-snapshots/src/Snapshot.CaseNamed.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CasePartial.purs → backend-es/test-snapshots/src/Snapshot.CasePartial.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.CaseRedBlackTree.purs → backend-es/test-snapshots/src/Snapshot.CaseRedBlackTree.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.ConvertableOptions01.purs → backend-es/test-snapshots/src/Snapshot.ConvertableOptions01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Cps01.purs → backend-es/test-snapshots/src/Snapshot.Cps01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Cps02.purs → backend-es/test-snapshots/src/Snapshot.Cps02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesEq01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesEq01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesEq02.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesEq02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesFunction01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesFunction01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesFunctor01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesFunctor01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesMonoid01.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesMonoid01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesSemigroup.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesSemigroup.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.DefaultRulesSemigroup02.purs → backend-es/test-snapshots/src/Snapshot.DefaultRulesSemigroup02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind01.purs → backend-es/test-snapshots/src/Snapshot.EffectBind01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind02.purs → backend-es/test-snapshots/src/Snapshot.EffectBind02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind03.purs → backend-es/test-snapshots/src/Snapshot.EffectBind03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind04.purs → backend-es/test-snapshots/src/Snapshot.EffectBind04.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind05.purs → backend-es/test-snapshots/src/Snapshot.EffectBind05.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind06.purs → backend-es/test-snapshots/src/Snapshot.EffectBind06.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind07.purs → backend-es/test-snapshots/src/Snapshot.EffectBind07.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind08.purs → backend-es/test-snapshots/src/Snapshot.EffectBind08.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectBind09.purs → backend-es/test-snapshots/src/Snapshot.EffectBind09.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.EffectLoopCaseRegression.pursnew file+17
@@ -0,0 +1,17 @@
1+module Snapshot.EffectLoopCaseRegression where
2+
3+import Prelude
4+
5+import Data.Maybe (Maybe(..))
6+import Effect (Effect, foreachE)
7+import Effect.Console as Console
8+
9+test :: Effect (Maybe (Array String)) -> Effect Unit
10+test eff = do
11+ res <- eff
12+ case res of
13+ Nothing ->
14+ pure unit
15+ Just as ->
16+ foreachE as \a ->
17+ Console.log a
backend-es/test/snapshots/Snapshot.EffectLoops01.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectLoops02.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectLoops03.purs → backend-es/test-snapshots/src/Snapshot.EffectLoops03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectPure01.purs → backend-es/test-snapshots/src/Snapshot.EffectPure01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectRefs01.purs → backend-es/test-snapshots/src/Snapshot.EffectRefs01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectRefs02.purs → backend-es/test-snapshots/src/Snapshot.EffectRefs02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EffectUnsafe01.purs → backend-es/test-snapshots/src/Snapshot.EffectUnsafe01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EsPrecedence01.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EsPrecedence02.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EsPrecedence03.purs → backend-es/test-snapshots/src/Snapshot.EsPrecedence03.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.EsSharedElse.pursnew file+15
@@ -0,0 +1,15 @@
1+module Snapshot.EsSharedElse where
2+
3+test1 :: Boolean -> Boolean -> Boolean -> Int
4+test1 a b c =
5+ if a then
6+ if b then
7+ 1
8+ else if c then
9+ 2
10+ else
11+ 3
12+ else if c then
13+ 2
14+ else
15+ 3
backend-es/test/snapshots/Snapshot.EscapeIdentifiers.purs → backend-es/test-snapshots/src/Snapshot.EscapeIdentifiers.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.EtaReduceRegression01.purs → backend-es/test-snapshots/src/Snapshot.EtaReduceRegression01.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.FloatLetRefression01.pursnew file+14
@@ -0,0 +1,14 @@
1+module Snapshot.FloatLetRegression01 where
2+
3+test :: (Int -> Int) -> { b :: Int, c1 :: Int, c2 :: Int }
4+test f =
5+ ( let
6+ b = f 1
7+ in
8+ ( let
9+ c = f 2
10+ in
11+ { x: { y: { b, c1: c, c2: c } } }
12+ ).x
13+ ).y
14+
backend-es/test/snapshots/Snapshot.FunctionCompose01.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.FunctionCompose02.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.FunctionCompose03.purs → backend-es/test-snapshots/src/Snapshot.FunctionCompose03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Fusion01.purs → backend-es/test-snapshots/src/Snapshot.Fusion01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Fusion02.purs → backend-es/test-snapshots/src/Snapshot.Fusion02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.HalogenVDomST01.purs → backend-es/test-snapshots/src/Snapshot.HalogenVDomST01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.HalogenVDomST02.purs → backend-es/test-snapshots/src/Snapshot.HalogenVDomST02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.HelloWorld01.purs → backend-es/test-snapshots/src/Snapshot.HelloWorld01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Heterogeneous01.purs → backend-es/test-snapshots/src/Snapshot.Heterogeneous01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Html.purs → backend-es/test-snapshots/src/Snapshot.Html.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.InlineArrayIndex.pursnew file+36
@@ -0,0 +1,36 @@
1+-- @inline export testArrayIndex never
2+module Snapshot.InlineArrayIndex where
3+
4+import Prelude
5+
6+import Assert (assertEqual)
7+import Data.Array as Array
8+import Data.Maybe (Maybe(..))
9+import Effect (Effect)
10+
11+testArrayIndex :: forall a. Array a -> Int -> Maybe a
12+testArrayIndex arr ix = Array.index arr ix
13+
14+main :: Effect Unit
15+main = do
16+ let array = [ 1, 2, 3 ]
17+ assertEqual "index -1"
18+ { expected: Nothing
19+ , actual: testArrayIndex array (-1)
20+ }
21+ assertEqual "index 0"
22+ { expected: Just 1
23+ , actual: testArrayIndex array 0
24+ }
25+ assertEqual "index 1"
26+ { expected: Just 2
27+ , actual: testArrayIndex array 1
28+ }
29+ assertEqual "index 2"
30+ { expected: Just 3
31+ , actual: testArrayIndex array 2
32+ }
33+ assertEqual "index 3"
34+ { expected: Nothing
35+ , actual: testArrayIndex array 3
36+ }
backend-es/test/snapshots/Snapshot.InlineCase01.purs → backend-es/test-snapshots/src/Snapshot.InlineCase01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.InlineCase02.purs → backend-es/test-snapshots/src/Snapshot.InlineCase02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.InlineDirectivePropSpine01.purs → backend-es/test-snapshots/src/Snapshot.InlineDirectivePropSpine01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.InlineDirectivePropSpine02.purs → backend-es/test-snapshots/src/Snapshot.InlineDirectivePropSpine02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.InlineNever.purs → backend-es/test-snapshots/src/Snapshot.InlineNever.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.InlineReferenceIfThenElse.pursnew file+23
@@ -0,0 +1,23 @@
1+-- @inline export fn never
2+module Snapshot.InlineReferenceIfThenElse where
3+
4+fn :: forall r. r -> Int
5+fn _ = 0
6+
7+test1 :: Int
8+test1 = do
9+ let rec = { a: { b: { c: true } }, d: fn {} }
10+ if rec.a.b.c then
11+ 42
12+ else
13+ fn rec
14+
15+extern1 :: { a :: { b :: { c :: Boolean } }, d :: Int }
16+extern1 = { a: { b: { c: true } }, d: fn {} }
17+
18+test2 :: Int
19+test2 =
20+ if extern1.a.b.c then
21+ 42
22+ else
23+ 99
backend-es/test-snapshots/src/Snapshot.InlineReferenceOpArrayLength.pursnew file+47
@@ -0,0 +1,47 @@
1+-- @inline export fn' never
2+module Snapshot.InlineReferenceOpArrayLength where
3+
4+import Prelude
5+
6+import Data.Array as Array
7+import Data.Maybe (Maybe(..))
8+
9+test1 :: (forall r. r -> Int) -> Array Int
10+test1 fn = do
11+ let array = [ 1, 2, fn {} ]
12+ if Array.length array == 3 then
13+ array
14+ else
15+ []
16+
17+test2 :: (forall r. r -> Int) -> Array (Array Int)
18+test2 fn = do
19+ let array1 = [ 1, 2, fn {} ]
20+ let array2 = [ array1, [ 3, 4 ], [ fn {} ] ]
21+ if Just 3 == (Array.length <$> Array.index array2 0) then
22+ array2
23+ else
24+ [ array1 ] <> array2
25+
26+fn' :: forall r. r -> Int
27+fn' _ = 0
28+
29+extern1 :: Array Int
30+extern1 = [ 1, 2, fn' {} ]
31+
32+extern2 :: Array (Array Int)
33+extern2 = [ extern1, [ 3 ], [ fn' {} ] ]
34+
35+test3 :: Array Int
36+test3 =
37+ if Array.length extern1 == 3 then
38+ extern1
39+ else
40+ []
41+
42+test4 :: Array (Array Int)
43+test4 =
44+ if Just 3 == (Array.length <$> Array.index extern2 0) then
45+ extern2
46+ else
47+ []
backend-es/test-snapshots/src/Snapshot.InlineReferenceOpIsTag.pursnew file+65
@@ -0,0 +1,65 @@
1+-- @inline export fn' never
2+module Snapshot.InlineReferenceOpIsTag where
3+
4+data List a = Cons a (List a) | Nil
5+
6+test1 :: (forall r. r -> List Int) -> List Int
7+test1 fn = do
8+ let list = Cons 1 (fn {})
9+ case list of
10+ Cons _ _ ->
11+ Cons 0 list
12+ _ ->
13+ Nil
14+
15+test2 :: (forall r. r -> List Int) -> List Int
16+test2 fn = do
17+ let rec = { a: { b: { c: Cons 1 (fn {}) } } }
18+ case rec.a.b.c of
19+ list@(Cons _ _) ->
20+ Cons 0 list
21+ _ ->
22+ fn rec
23+
24+test3 :: (forall r. r -> List Int) -> List Int
25+test3 fn = do
26+ let rec1 = { a: { b: { c: Cons 1 (fn {}) } } }
27+ let rec2 = { d: rec1, e: fn {} }
28+ case rec2.d.a.b.c of
29+ list@(Cons _ _) ->
30+ Cons 0 list
31+ _ ->
32+ fn { rec1, rec2 }
33+
34+fn' :: forall r. r -> List Int
35+fn' _ = Nil
36+
37+extern1 :: List Int
38+extern1 = Cons 1 (fn' {})
39+
40+extern2 :: { a :: { b :: { c :: List Int } } }
41+extern2 = { a: { b: { c: Cons 1 (fn' {}) } } }
42+
43+extern3 :: { d :: { a :: { b :: { c :: List Int } } }, e :: List Int }
44+extern3 = { d: extern2, e: fn' {} }
45+
46+test4 :: List Int
47+test4 = case extern1 of
48+ Cons _ _ ->
49+ Cons 0 extern1
50+ _ ->
51+ Nil
52+
53+test5 :: List Int
54+test5 = case extern2.a.b.c of
55+ list@(Cons _ _) ->
56+ Cons 0 list
57+ _ ->
58+ Nil
59+
60+test6 :: List Int
61+test6 = case extern3.d.a.b.c of
62+ list@(Cons _ _) ->
63+ Cons 0 list
64+ _ ->
65+ Nil
backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpBoolean.pursnew file+55
@@ -0,0 +1,55 @@
1+-- @inline export fn never
2+module Snapshot.InlineReferencePrimOpBoolean where
3+
4+import Prelude
5+
6+fn :: forall r. r -> Int
7+fn _ = 0
8+
9+test1 :: Int
10+test1 = do
11+ let rec = { a: { b: { c: true } }, d: fn {}, e: true, f: false }
12+ if rec.a.b.c && rec.e then
13+ 42
14+ else
15+ fn rec
16+
17+test2 :: Int
18+test2 = do
19+ let rec = { a: { b: { c: true } }, d: fn {}, e: true, f: false }
20+ if rec.f || rec.a.b.c then
21+ 42
22+ else
23+ fn rec
24+
25+test3 :: Int
26+test3 = do
27+ let rec = { a: { b: { c: true } }, d: fn {}, e: true, f: false }
28+ if not rec.a.b.c then
29+ fn rec
30+ else
31+ 42
32+
33+extern1 :: { a :: { b :: { c :: Boolean } }, d :: Int, e :: Boolean, f :: Boolean }
34+extern1 = { a: { b: { c: true } }, d: fn {}, e: true, f: false }
35+
36+test4 :: Int
37+test4 =
38+ if extern1.a.b.c && extern1.e then
39+ 42
40+ else
41+ 99
42+
43+test5 :: Int
44+test5 =
45+ if extern1.f || extern1.a.b.c then
46+ 42
47+ else
48+ 99
49+
50+test6 :: Int
51+test6 =
52+ if not extern1.a.b.c then
53+ 99
54+ else
55+ 42
backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpInt.pursnew file+51
@@ -0,0 +1,51 @@
1+-- @inline export fn never
2+-- @inline export localTest always
3+-- @inline export externTest always
4+module Snapshot.InlineReferencePrimOpInt where
5+
6+import Prelude
7+
8+fn :: forall r. r -> Int
9+fn _ = 0
10+
11+type Rec = { a :: { b :: { c :: Int } }, d :: Int, e :: Int }
12+
13+localTest :: (Rec -> Int) -> Int
14+localTest f = do
15+ let rec = { a: { b: { c: 99 }}, d: fn {}, e: 11 }
16+ let res = f rec
17+ if res /= bottom then res
18+ else fn rec
19+
20+test1 :: Int
21+test1 = localTest \rec -> rec.a.b.c + rec.e
22+
23+test2 :: Int
24+test2 = localTest \rec -> rec.a.b.c - rec.e
25+
26+test3 :: Int
27+test3 = localTest \rec -> rec.a.b.c * rec.e
28+
29+test4 :: Int
30+test4 = localTest \rec -> rec.a.b.c / rec.e
31+
32+extern :: Rec
33+extern = { a: { b: { c: 99 }}, d: fn {}, e: 11 }
34+
35+externTest :: (Rec -> Int) -> Int
36+externTest f = do
37+ let res = f extern
38+ if res /= bottom then res
39+ else bottom
40+
41+test5 :: Int
42+test5 = externTest \rec -> rec.a.b.c + rec.e
43+
44+test6 :: Int
45+test6 = externTest \rec -> rec.a.b.c - rec.e
46+
47+test7 :: Int
48+test7 = externTest \rec -> rec.a.b.c * rec.e
49+
50+test8 :: Int
51+test8 = externTest \rec -> rec.a.b.c / rec.e
backend-es/test-snapshots/src/Snapshot.InlineReferencePrimOpNumber.pursnew file+51
@@ -0,0 +1,51 @@
1+-- @inline export fn never
2+-- @inline export localTest always
3+-- @inline export externTest always
4+module Snapshot.InlineReferencePrimOpNumber where
5+
6+import Prelude
7+
8+fn :: forall r. r -> Number
9+fn _ = 0.0
10+
11+type Rec = { a :: { b :: { c :: Number } }, d :: Number, e :: Number }
12+
13+localTest :: (Rec -> Number) -> Number
14+localTest f = do
15+ let rec = { a: { b: { c: 99.0 }}, d: fn {}, e: 11.0 }
16+ let res = f rec
17+ if res /= bottom then res
18+ else fn rec
19+
20+test1 :: Number
21+test1 = localTest \rec -> rec.a.b.c + rec.e
22+
23+test2 :: Number
24+test2 = localTest \rec -> rec.a.b.c - rec.e
25+
26+test3 :: Number
27+test3 = localTest \rec -> rec.a.b.c * rec.e
28+
29+test4 :: Number
30+test4 = localTest \rec -> rec.a.b.c / rec.e
31+
32+extern :: Rec
33+extern = { a: { b: { c: 99.0 }}, d: fn {}, e: 11.0 }
34+
35+externTest :: (Rec -> Number) -> Number
36+externTest f = do
37+ let res = f extern
38+ if res /= bottom then res
39+ else bottom
40+
41+test5 :: Number
42+test5 = externTest \rec -> rec.a.b.c + rec.e
43+
44+test6 :: Number
45+test6 = externTest \rec -> rec.a.b.c - rec.e
46+
47+test7 :: Number
48+test7 = externTest \rec -> rec.a.b.c * rec.e
49+
50+test8 :: Number
51+test8 = externTest \rec -> rec.a.b.c / rec.e
backend-es/test-snapshots/src/Snapshot.InlineReferenceRecordUpdate.pursnew file+31
@@ -0,0 +1,31 @@
1+-- @inline export fn' never
2+module Snapshot.InlineReferenceRecordUpdate where
3+
4+import Prelude
5+
6+import Unsafe.Coerce (unsafeCoerce)
7+
8+test1 :: (forall r. r -> { a :: Int, b :: Int, c :: Int }) -> Int
9+test1 fn = do
10+ let rec1 = fn {}
11+ let rec2 = rec1 { a = 42, b = fn {} }
12+ if rec2.a == 42 then
13+ rec2.c
14+ else
15+ (fn { rec1, rec2 }).c
16+
17+-- unsafeCoerce is needed to construct the polymorphic tail.
18+-- This is only needed to subvert the compiler's record update
19+-- optimization, which is slated to be removed.
20+fn' :: forall r x. r -> { a :: Int, b :: Int, c :: Int | x }
21+fn' _ = unsafeCoerce { a: 1, b: 2, c: 3 }
22+
23+extern :: forall x. { a :: Int, b :: Int, c :: Int | x }
24+extern = (fn' {}) { a = 42 }
25+
26+test2 :: Int
27+test2 =
28+ if extern.a == 42 then
29+ extern.c
30+ else
31+ 0
backend-es/test/snapshots/Snapshot.KnownConstructor07.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructor07.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors01.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors02.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors03.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors04.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors04.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors05.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors05.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.KnownConstructors06.purs → backend-es/test-snapshots/src/Snapshot.KnownConstructors06.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Object01.purs → backend-es/test-snapshots/src/Snapshot.Object01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpArray01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpArray01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpBoolean01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpBoolean01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpBoolean02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpBoolean02.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.PrimOpBooleanNotRegression.pursnew file+9
@@ -0,0 +1,9 @@
1+module Snapshot.PrimOpBooleanNotRegression where
2+
3+import Prelude
4+
5+-- Related to #93.
6+-- Inlines to multiple references to the result of comp. The call
7+-- to comp should not be duplicated due to OpBooleanNot.
8+test :: forall a. (a -> a -> Ordering) -> a -> a -> Boolean
9+test comp a b = comp a b /= EQ
backend-es/test/snapshots/Snapshot.PrimOpChar01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpChar01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpChar02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpChar02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpInt01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpInt01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpInt02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpInt02.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.PrimOpInt03.pursnew file+15
@@ -0,0 +1,15 @@
1+module Snapshot.PrimOpInt03 where
2+
3+import Prelude
4+
5+test1 :: Int
6+test1 = 2000000000 + 2000000000
7+
8+test2 :: Int
9+test2 = -2000000000 - 2000000000
10+
11+test3 :: Int
12+test3 = 2000000000 * 2000000000
13+
14+test4 :: Int -> Int
15+test4 a = 2000000000 + a + 2000000000
backend-es/test/snapshots/Snapshot.PrimOpIntBit01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpIntBit01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpIntBit02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpIntBit02.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.PrimOpIntDiv.pursnew file+16
@@ -0,0 +1,16 @@
1+-- @inline export divNoInline never
2+module Snapshot.PrimOpIntDiv where
3+
4+import Prelude
5+
6+import Assert (assertEqual)
7+import Effect (Effect)
8+
9+divNoInline :: Int -> Int -> Int
10+divNoInline a b = a / b -- This needs to stay eta-expanded to test runtime div
11+
12+main :: Effect Unit
13+main = do
14+ assertEqual "div1" { expected: 0, actual: divNoInline 1 0 }
15+ assertEqual "div2" { expected: 1, actual: divNoInline 3 2 }
16+ assertEqual "div3" { expected: -1, actual: divNoInline 3 (-2) }
backend-es/test/snapshots/Snapshot.PrimOpNumber01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpNumber01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpNumber02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpNumber02.pursrenamed+4
@@ -2,6 +2,9 @@ module Snapshot.PrimOpNumber02 where
22
33import Prelude
44
5+nan :: Number
6+nan = 0.0/0.0
7+
58numValues op =
69 [ 1.5 `op` 1.0
710 , 1.5 `op` 2.0
@@ -9,6 +12,7 @@ numValues op =
912 , 1.5 `op` -2.0
1013 , -1.5 `op` 2.0
1114 , -1.5 `op` -1.0
15+ , 1.0 `op` nan
1216 ]
1317
1418test1 = numValues (+)
backend-es/test/snapshots/Snapshot.PrimOpString01.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpString02.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.PrimOpString03.purs → backend-es/test-snapshots/src/Snapshot.PrimOpString03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.ProfunctorLenses01.purs → backend-es/test-snapshots/src/Snapshot.ProfunctorLenses01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.ProfunctorLenses02.purs → backend-es/test-snapshots/src/Snapshot.ProfunctorLenses02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.RecordUnion01.purs → backend-es/test-snapshots/src/Snapshot.RecordUnion01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.RecursionSchemes01.purs → backend-es/test-snapshots/src/Snapshot.RecursionSchemes01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.RecursiveBindingGroup01.purs → backend-es/test-snapshots/src/Snapshot.RecursiveBindingGroup01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.RecursiveBindingGroup02.purs → backend-es/test-snapshots/src/Snapshot.RecursiveBindingGroup02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STArray01.purs → backend-es/test-snapshots/src/Snapshot.STArray01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STArray02.purs → backend-es/test-snapshots/src/Snapshot.STArray02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STArray03.purs → backend-es/test-snapshots/src/Snapshot.STArray03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STArray04.purs → backend-es/test-snapshots/src/Snapshot.STArray04.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.STArray05.pursnew file+16
@@ -0,0 +1,16 @@
1+module Snapshot.STArray05 (test) where
2+
3+import Prelude
4+
5+import Control.Monad.ST (ST)
6+import Data.Array.ST (STArray)
7+import Data.Array.ST as STArray
8+
9+f :: forall h. (STArray h Int -> ST h Int) -> ST h (STArray h Int)
10+f eff = do
11+ arr <- STArray.new
12+ _ <- eff arr
13+ pure arr
14+
15+test :: Boolean -> Array Int
16+test x = STArray.run (f (if x then \a -> STArray.push 1 a else \a -> STArray.unshift 2 a))
backend-es/test-snapshots/src/Snapshot.STArrayUnsafeThawFreezeLengthRegression.pursnew file+18
@@ -0,0 +1,18 @@
1+module Snapshot.STArrayUnsafeThawFreezeLengthRegression where
2+
3+import Prelude
4+
5+import Control.Monad.ST as ST
6+import Data.Array as Array
7+import Data.Array.ST as STA
8+
9+-- Related to #92.
10+-- The call to `Array.length` should not inline to a constant value.
11+
12+test :: Int -> Array Int
13+test x = ST.run do
14+ result <- STA.unsafeThaw $ Array.singleton x
15+ _ <- STA.push 12 result
16+ len <- Array.length <$> STA.unsafeFreeze result
17+ _ <- STA.push len result
18+ STA.unsafeFreeze result
backend-es/test/snapshots/Snapshot.STLoops01.purs → backend-es/test-snapshots/src/Snapshot.STLoops01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STLoops02.purs → backend-es/test-snapshots/src/Snapshot.STLoops02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STLoops03.purs → backend-es/test-snapshots/src/Snapshot.STLoops03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STObject01.purs → backend-es/test-snapshots/src/Snapshot.STObject01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.STRun01.purs → backend-es/test-snapshots/src/Snapshot.STRun01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.ShowLiterals.purs → backend-es/test-snapshots/src/Snapshot.ShowLiterals.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.StringLiteral01.purs → backend-es/test-snapshots/src/Snapshot.StringLiteral01.pursrenamed+1
@@ -3,3 +3,4 @@ module Snapshot.StringLiteral01 where
33test1 = "\x000042"
44test2 = "\x000012"
55test3 = "\x000000"
6+test4 = "\xdc11"
backend-es/test/snapshots/Snapshot.Tco01.purs → backend-es/test-snapshots/src/Snapshot.Tco01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Tco02.purs → backend-es/test-snapshots/src/Snapshot.Tco02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Tco03.purs → backend-es/test-snapshots/src/Snapshot.Tco03.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Tco04.purs → backend-es/test-snapshots/src/Snapshot.Tco04.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Tco05.purs → backend-es/test-snapshots/src/Snapshot.Tco05.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Tco06.purs → backend-es/test-snapshots/src/Snapshot.Tco06.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.TopLevelHygiene01.purs → backend-es/test-snapshots/src/Snapshot.TopLevelHygiene01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.TopLevelHygiene02.purs → backend-es/test-snapshots/src/Snapshot.TopLevelHygiene02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedEffectFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedEffectFns01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedEffectFns02.purs → backend-es/test-snapshots/src/Snapshot.UncurriedEffectFns02.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedFns01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedLocalAbs01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedLocalAbs01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedSTFns01.purs → backend-es/test-snapshots/src/Snapshot.UncurriedSTFns01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.UncurriedSTFns02.purs → backend-es/test-snapshots/src/Snapshot.UncurriedSTFns02.pursrenamed

The content is the same.

backend-es/test-snapshots/src/Snapshot.UnpackArray01.pursnew file+15
@@ -0,0 +1,15 @@
1+module Snapshot.UnpackArray01 where
2+
3+import Data.Array as Array
4+import Partial.Unsafe (unsafePartial)
5+
6+test :: (String -> String -> String) -> ({} -> String) -> String
7+test fn1 fn2 = unsafePartial do
8+ let
9+ array =
10+ [ "foo"
11+ , "bar"
12+ , "baz"
13+ , fn2 {}
14+ ]
15+ fn1 (Array.unsafeIndex array 0) (Array.unsafeIndex array 2)
backend-es/test/snapshots/Snapshot.UnsafePerformEffect.purs → backend-es/test-snapshots/src/Snapshot.UnsafePerformEffect.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.VanLaarhovenTraversals01.purs → backend-es/test-snapshots/src/Snapshot.VanLaarhovenTraversals01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Variant01.purs → backend-es/test-snapshots/src/Snapshot.Variant01.pursrenamed

The content is the same.

backend-es/test/snapshots/Snapshot.Variant02.purs → backend-es/test-snapshots/src/Snapshot.Variant02.pursrenamed

The content is the same.

backend-es/test/Main.purs+53−18
@@ -16,12 +16,13 @@ import Data.Map as Map
1616import Data.Maybe (Maybe(..), fromMaybe, isJust)
1717import Data.Monoid (power)
1818import Data.Newtype (unwrap)
19+import Data.Set (Set)
1920import Data.Set as Set
2021import Data.String (Pattern(..))
2122import Data.String as String
2223import Data.String.CodeUnits as SCU
2324import Data.TraversableWithIndex (forWithIndex)
24−import Data.Tuple (Tuple(..))
25+import Data.Tuple (Tuple(..), uncurry)
2526import Dodo as Dodo
2627import Effect (Effect)
2728import Effect.Aff (Aff, Error, attempt, launchAff_)
@@ -29,6 +30,7 @@ import Effect.Aff as Error
2930import Effect.Class (liftEffect)
3031import Effect.Class.Console as Console
3132import Effect.Ref as Ref
33+import Node.ChildProcess as ChildProcess
3234import Node.Encoding (Encoding(..))
3335import Node.FS.Aff as FS
3436import Node.Glob.Basic (expandGlobsCwd)
@@ -39,17 +41,27 @@ import PureScript.Backend.Optimizer.Codegen.EcmaScript (codegenModule)
3941import PureScript.Backend.Optimizer.Codegen.EcmaScript.Builder (coreFnModulesFromOutput)
4042import PureScript.Backend.Optimizer.Codegen.EcmaScript.Foreign (esForeignSemantics)
4143import PureScript.Backend.Optimizer.Convert (BackendModule)
42−import PureScript.Backend.Optimizer.CoreFn (Comment(..), Module(..), ModuleName(..))
44+import PureScript.Backend.Optimizer.CoreFn (Comment(..), Ident(..), Module(..), ModuleName(..), Qualified(..))
4345import PureScript.Backend.Optimizer.Directives (parseDirectiveFile)
4446import PureScript.Backend.Optimizer.Directives.Defaults (defaultDirectives)
4547import PureScript.Backend.Optimizer.Semantics.Foreign (coreForeignSemantics)
46−import Test.Utils (bufferToUTF8, copyFile, execWithStdin, loadModuleMain, mkdirp, spawnFromParent)
48+import PureScript.Backend.Optimizer.Tracer.Printer (printModuleSteps)
49+import PureScript.CST.Lexer (lexToken)
50+import PureScript.CST.Types as CST
51+import Test.Utils (bufferToUTF8, copyFile, loadModuleMain, mkdirp, spawnFromParent)
4752
4853type TestArgs =
4954 { accept :: Boolean
5055 , filter :: NonEmptyArray String
56+ , traceIdents :: Set (Qualified Ident)
5157 }
5258
59+data TraceChoice
60+ = TraceToOutput
61+ | TraceToStdOut
62+
63+derive instance Eq TraceChoice
64+
5365argParser :: ArgParser TestArgs
5466argParser =
5567 ArgParser.fromRecord
@@ -63,6 +75,19 @@ argParser =
6375 "Filter tests matching a prefix"
6476 # ArgParser.unfolded1
6577 # ArgParser.default (pure "Snapshot.*")
78+ , traceIdents:
79+ ArgParser.argument [ "--trace-rewrites" ]
80+ "Traces rewrite passes for a top-level definition during optimizations.\n\
81+ \Outputs results to optimization-traces.txt."
82+ # ArgParser.unformat "QUALIFIED_NAME"
83+ ( \str ->
84+ case lexToken str of
85+ Right (CST.TokLowerName (Just (CST.ModuleName mod)) ident) ->
86+ Right $ Set.singleton $ Qualified (Just (ModuleName mod)) (Ident ident)
87+ _ ->
88+ Left $ "Unable to parse qualified name: " <> str
89+ )
90+ # ArgParser.folded
6691 }
6792
6893main :: Effect Unit
@@ -75,49 +100,58 @@ main = do
75100 launchAff_ $ runSnapshotTests args
76101
77102runSnapshotTests :: TestArgs -> Aff Unit
78−runSnapshotTests { accept, filter } = do
79− liftEffect $ Process.chdir $ Path.concat [ "backend-es", "test", "snapshots" ]
80− spawnFromParent "spago" [ "build -u \"-g corefn\"" ]
103+runSnapshotTests { accept, filter, traceIdents } = do
104+ liftEffect $ Process.chdir $ Path.concat [ "backend-es", "test-snapshots" ]
105+ spawnFromParent "spago" [ "build" ]
81106 snapshotDir <- liftEffect Process.cwd
82− snapshotPaths <- expandGlobsCwd [ "Snapshot.*.purs" ]
107+ snapshotPaths <- expandGlobsCwd [ "src/Snapshot.*.purs" ]
83108 outputRef <- liftEffect $ Ref.new Map.empty
84− let snapshotsOut = Path.concat [ "..", "snapshots-out" ]
85− let testOut = Path.concat [ "..", "test-out" ]
109+ let snapshotsOut = "snapshots-out"
110+ let testOut = "output-es"
86111 mkdirp snapshotsOut
87112 mkdirp testOut
88113 coreFnModulesFromOutput "output" filter >>= case _ of
89114 Left errors -> do
90115 for_ errors \(Tuple filePath err) -> do
91116 Console.error $ filePath <> " " <> err
92− liftEffect $ Process.exit 1
117+ liftEffect $ Process.exit' 1
93118 Right coreFnModules -> do
94119 let { directives } = parseDirectiveFile defaultDirectives
95− copyFile (Path.concat [ "..", "..", "runtime.js" ]) (Path.concat [ testOut, "runtime.js" ])
120+ copyFile (Path.concat [ "..", "runtime.js" ]) (Path.concat [ testOut, "runtime.js" ])
121+ stepsRef <- liftEffect $ Ref.new []
96122 coreFnModules # buildModules
97123 { directives
124+ , analyzeCustom: \_ _ -> Nothing
98125 , foreignSemantics: Map.union coreForeignSemantics esForeignSemantics
99− , onCodegenModule: \build (Module { name: ModuleName name, path }) backend -> do
126+ , onCodegenModule: \build (Module { name: ModuleName name, path }) backendMod optimizationSteps -> do
100127 let
101128 formatted =
102129 Dodo.print Dodo.plainText (Dodo.twoSpaces { pageWidth = 180, ribbonRatio = 1.0 }) $
103− codegenModule { intTags: false } build.implementations backend
130+ codegenModule { intTags: false } build.implementations backendMod
104131 let testFileDir = Path.concat [ testOut, name ]
105132 let testFilePath = Path.concat [ testFileDir, "index.js" ]
106133 mkdirp testFileDir
107134 FS.writeTextFile UTF8 testFilePath formatted
108− unless (Set.isEmpty backend.foreign) do
135+ unless (Set.isEmpty backendMod.foreign) do
109136 let foreignSiblingPath = fromMaybe path (String.stripSuffix (Pattern (Path.extname path)) path) <> ".js"
110137 let foreignOutputPath = Path.concat [ testFileDir, "foreign.js" ]
111138 copyFile foreignSiblingPath foreignOutputPath
112139 when (Set.member (Path.concat [ snapshotDir, path ]) snapshotPaths) do
113− void $ liftEffect $ Ref.modify (Map.insert name (Tuple formatted (hasFails backend))) outputRef
140+ void $ liftEffect $ Ref.modify (Map.insert name (Tuple formatted (hasFails backendMod))) outputRef
141+ unless (Array.null optimizationSteps) do
142+ liftEffect $ Ref.modify_ (flip Array.snoc (Tuple backendMod.name optimizationSteps)) stepsRef
114143 , onPrepareModule: \build coreFnMod@(Module { name }) -> do
115144 let total = show build.moduleCount
116145 let index = show (build.moduleIndex + 1)
117146 let padding = power " " (SCU.length total - SCU.length index)
118147 Console.log $ "[" <> padding <> index <> " of " <> total <> "] Building " <> unwrap name
119148 pure coreFnMod
149+ , traceIdents
120150 }
151+ allSteps <- liftEffect (Ref.read stepsRef)
152+ unless (Array.null allSteps) do
153+ let allDoc = Dodo.foldWithSeparator (Dodo.break <> Dodo.break) $ uncurry printModuleSteps <$> allSteps
154+ FS.writeTextFile UTF8 "optimization-traces.txt" $ Dodo.print Dodo.plainText Dodo.twoSpaces allDoc
121155 outputModules <- liftEffect $ Ref.read outputRef
122156 results <- forWithIndex outputModules \name (Tuple output failsWith) -> do
123157 let
@@ -148,11 +182,12 @@ runSnapshotTests { accept, filter } = do
148182 runAcceptedTest
149183 | otherwise -> do
150184 Console.log $ withGraphics (foreground Red) "✗" <> " " <> name <> " failed."
151− diff <- bufferToUTF8 <<< _.stdout =<< execWithStdin ("diff " <> snapshotFilePath <> " -") output
152− Console.log diff
185+ let testFilePath = Path.concat [ testOut, name, "index.js" ]
186+ res <- liftEffect $ ChildProcess.spawnSync "diff" [ snapshotFilePath, testFilePath ]
187+ Console.log =<< bufferToUTF8 res.stdout
153188 pure false
154189 unless (Foldable.and results) do
155− liftEffect $ Process.exit 1
190+ liftEffect $ Process.exit' 1
156191
157192hasFails :: BackendModule -> Maybe String
158193hasFails = findMap go <<< _.comments
backend-es/test/Utils.purs+13−18
@@ -10,9 +10,11 @@ import Effect.Aff (Aff, Error, effectCanceler, error, makeAff, throwError)
1010import Effect.Class (liftEffect)
1111import Node.Buffer (Buffer, freeze)
1212import Node.Buffer.Immutable as ImmutableBuffer
13−import Node.ChildProcess (ChildProcess, ExecResult, Exit(..), defaultExecOptions)
13+import Node.ChildProcess (ChildProcess, exitH)
1414import Node.ChildProcess as ChildProcess
15+import Node.ChildProcess.Types (Exit(..))
1516import Node.Encoding (Encoding(..))
17+import Node.EventEmitter (on_)
1618import Node.FS.Aff as FS
1719import Node.FS.Perms (mkPerms)
1820import Node.FS.Perms as Perms
@@ -20,26 +22,20 @@ import Node.FS.Stats as Stats
2022import Node.FS.Stream (createReadStream, createWriteStream)
2123import Node.Path (FilePath)
2224import Node.Process as Process
25+import Node.Stream (errorH, finishH)
2326import Node.Stream as Stream
2427
2528spawnFromParent :: String -> Array String -> Aff Unit
2629spawnFromParent command args = makeAff \k -> do
2730 childProc <- spawnImpl command args
28− ChildProcess.onExit childProc case _ of
31+ childProc # on_ exitH case _ of
2932 Normally code
30− | code > 0 -> Process.exit code
33+ | code > 0 -> Process.exit' code
3134 | otherwise -> k (Right unit)
3235 BySignal _ ->
33− Process.exit 1
36+ Process.exit' 1
3437 pure $ effectCanceler do
35− ChildProcess.kill SIGABRT childProc
36−
37−execWithStdin :: String -> String -> Aff ExecResult
38−execWithStdin command input = makeAff \k -> do
39− childProc <- ChildProcess.exec command defaultExecOptions (k <<< pure)
40− _ <- Stream.writeString (ChildProcess.stdin childProc) UTF8 input mempty
41− Stream.end (ChildProcess.stdin childProc) mempty
42− pure $ effectCanceler $ ChildProcess.kill SIGABRT childProc
38+ void $ ChildProcess.killSignal SIGABRT childProc
4339
4440bufferToUTF8 :: Buffer -> Aff String
4541bufferToUTF8 = liftEffect <<< map (ImmutableBuffer.toString UTF8) <<< freeze
@@ -62,15 +58,14 @@ copyFile from to = do
6258 stats <- FS.stat from
6359 unless (Stats.isFile stats) do
6460 throwError $ error $ "Not a file: " <> from
61+ --FS.copyFile from to
6562 makeAff \k -> do
6663 src <- createReadStream from
6764 dst <- createWriteStream to
68− res <- Stream.pipe src dst
69− Stream.onError src (k <<< Left)
70− Stream.onError dst (k <<< Left)
71− Stream.onError res (k <<< Left)
72− Stream.onFinish res (k (Right unit))
65+ Stream.pipe src dst
66+ src # on_ errorH (k <<< Left)
67+ dst # on_ errorH (k <<< Left)
68+ dst # on_ finishH (k (Right unit))
7369 pure $ effectCanceler do
74− Stream.destroy res
7570 Stream.destroy dst
7671 Stream.destroy src
backend-es/test/snapshots-out/Snapshot.CaseLeafTco.jsdeleted−65
@@ -1,65 +0,0 @@
1−import * as $runtime from "../runtime.js";
2−import * as Data$dArray from "../Data.Array/index.js";
3−import * as Data$dSemigroup from "../Data.Semigroup/index.js";
4−const test1 = test1$a0$copy => test1$a1$copy => {
5− let test1$a0 = test1$a0$copy, test1$a1 = test1$a1$copy, test1$c = true, test1$r;
6− while (test1$c) {
7− const b = test1$a0, arr = test1$a1;
8− const v = Data$dArray.index(arr)(arr.length - 1 | 0);
9− const v1 = Data$dArray.index(arr)(0);
10− const $0 = (x, y) => {
11− if (b) {
12− test1$c = false;
13− test1$r = [];
14− return;
15− }
16− test1$a0 = b;
17− test1$a1 = Data$dSemigroup.concatArray([y, x, 3, y, 5, 6, 7, 8, 9, 10, x, 12, 13, 14, 15, 16, 17])(arr);
18− };
19− if (v.tag === "Just") {
20− if (v._1 === 2) {
21− if (v1.tag === "Just") {
22− if (v1._1 === 1) {
23− test1$c = false;
24− test1$r = arr;
25− continue;
26− }
27− $0(v1._1, v._1);
28− continue;
29− }
30− if (v1.tag === "Nothing") {
31− test1$c = false;
32− test1$r = Data$dSemigroup.concatArray(arr)([v._1]);
33− continue;
34− }
35− $runtime.fail();
36− }
37− if (v1.tag === "Nothing") {
38− test1$c = false;
39− test1$r = Data$dSemigroup.concatArray(arr)([v._1]);
40− continue;
41− }
42− if (v1.tag === "Just") {
43− $0(v1._1, v._1);
44− continue;
45− }
46− $runtime.fail();
47− }
48− if (v.tag === "Nothing") {
49− if (v1.tag === "Nothing") {
50− test1$c = false;
51− test1$r = arr;
52− continue;
53− }
54− if (v1.tag === "Just") {
55− test1$c = false;
56− test1$r = Data$dSemigroup.concatArray(arr)([v1._1]);
57− continue;
58− }
59− $runtime.fail();
60− }
61− $runtime.fail();
62− }
63− return test1$r;
64−};
65−export {test1};
backend-es/test/snapshots-out/Snapshot.CaseRedBlackTree.jsdeleted−143
@@ -1,143 +0,0 @@
1−import * as $runtime from "../runtime.js";
2−const $Color = tag => tag;
3−const $RedBlackTree = (tag, _1, _2, _3, _4) => ({tag, _1, _2, _3, _4});
4−const Red = /* #__PURE__ */ $Color("Red");
5−const Black = /* #__PURE__ */ $Color("Black");
6−const Leaf = /* #__PURE__ */ $RedBlackTree("Leaf");
7−const Node = value0 => value1 => value2 => value3 => $RedBlackTree("Node", value0, value1, value2, value3);
8−const test1 = () => v => {
9− if (v.tag === "Node") {
10− if (v._1 === "Black") {
11− if (v._2.tag === "Node") {
12− if (v._2._1 === "Red") {
13− if (v._2._2.tag === "Node") {
14− if (v._2._2._1 === "Red") { return {i: 1, a: v._2._2._2, x: v._2._2._3, b: v._2._2._4, y: v._2._3, c: v._2._4, z: v._3, d: v._4}; }
15− if (v._2._4.tag === "Node") {
16− if (v._2._4._1 === "Red") { return {i: 2, a: v._2._2, x: v._2._3, b: v._2._4._2, y: v._2._4._3, c: v._2._4._4, z: v._3, d: v._4}; }
17− if (v._4.tag === "Node") {
18− if (v._4._1 === "Red") {
19− if (v._4._2.tag === "Node") {
20− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
21− if (v._4._4.tag === "Node") {
22− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
23− $runtime.fail();
24− }
25− $runtime.fail();
26− }
27− if (v._4._4.tag === "Node") {
28− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
29− $runtime.fail();
30− }
31− $runtime.fail();
32− }
33− $runtime.fail();
34− }
35− $runtime.fail();
36− }
37− if (v._4.tag === "Node") {
38− if (v._4._1 === "Red") {
39− if (v._4._2.tag === "Node") {
40− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
41− if (v._4._4.tag === "Node") {
42− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
43− $runtime.fail();
44− }
45− $runtime.fail();
46− }
47− if (v._4._4.tag === "Node") {
48− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
49− $runtime.fail();
50− }
51− $runtime.fail();
52− }
53− $runtime.fail();
54− }
55− $runtime.fail();
56− }
57− if (v._2._4.tag === "Node") {
58− if (v._2._4._1 === "Red") { return {i: 2, a: v._2._2, x: v._2._3, b: v._2._4._2, y: v._2._4._3, c: v._2._4._4, z: v._3, d: v._4}; }
59− if (v._4.tag === "Node") {
60− if (v._4._1 === "Red") {
61− if (v._4._2.tag === "Node") {
62− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
63− if (v._4._4.tag === "Node") {
64− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
65− $runtime.fail();
66− }
67− $runtime.fail();
68− }
69− if (v._4._4.tag === "Node") {
70− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
71− $runtime.fail();
72− }
73− $runtime.fail();
74− }
75− $runtime.fail();
76− }
77− $runtime.fail();
78− }
79− if (v._4.tag === "Node") {
80− if (v._4._1 === "Red") {
81− if (v._4._2.tag === "Node") {
82− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
83− if (v._4._4.tag === "Node") {
84− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
85− $runtime.fail();
86− }
87− $runtime.fail();
88− }
89− if (v._4._4.tag === "Node") {
90− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
91− $runtime.fail();
92− }
93− $runtime.fail();
94− }
95− $runtime.fail();
96− }
97− $runtime.fail();
98− }
99− if (v._4.tag === "Node") {
100− if (v._4._1 === "Red") {
101− if (v._4._2.tag === "Node") {
102− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
103− if (v._4._4.tag === "Node") {
104− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
105− $runtime.fail();
106− }
107− $runtime.fail();
108− }
109− if (v._4._4.tag === "Node") {
110− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
111− $runtime.fail();
112− }
113− $runtime.fail();
114− }
115− $runtime.fail();
116− }
117− $runtime.fail();
118− }
119− if (v._4.tag === "Node") {
120− if (v._4._1 === "Red") {
121− if (v._4._2.tag === "Node") {
122− if (v._4._2._1 === "Red") { return {i: 3, a: v._2, x: v._3, b: v._4._2._2, y: v._4._2._3, c: v._4._2._4, z: v._4._3, d: v._4._4}; }
123− if (v._4._4.tag === "Node") {
124− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
125− $runtime.fail();
126− }
127− $runtime.fail();
128− }
129− if (v._4._4.tag === "Node") {
130− if (v._4._4._1 === "Red") { return {i: 4, a: v._2, x: v._3, b: v._4._2, y: v._4._3, c: v._4._4._2, z: v._4._4._3, d: v._4._4._4}; }
131− $runtime.fail();
132− }
133− $runtime.fail();
134− }
135− $runtime.fail();
136− }
137− $runtime.fail();
138− }
139− $runtime.fail();
140− }
141− $runtime.fail();
142−};
143−export {$Color, $RedBlackTree, Black, Leaf, Node, Red, test1};
backend-es/test/snapshots-out/Snapshot.DefaultRulesSemigroup02.jsdeleted−7
@@ -1,7 +0,0 @@
1−import * as Data$dSemigroup from "../Data.Semigroup/index.js";
2−const append = ra => rb => ({bar: Data$dSemigroup.concatArray(ra.bar)(rb.bar), foo: ra.foo + rb.foo});
3−const test4 = {bar: ["hello", "World!"], foo: "hello, World!"};
4−const test3 = /* #__PURE__ */ append({foo: "hello", bar: ["hello"]});
5−const test2 = a => b => ({bar: Data$dSemigroup.concatArray(a.bar)(b.bar), foo: a.foo + b.foo});
6−const test1 = append;
7−export {append, test1, test2, test3, test4};
backend-es/test/snapshots-out/Snapshot.PrimOpNumber02.jsdeleted−13
@@ -1,13 +0,0 @@
1−const test11 = [-1.5, 1.5];
2−const numValues = op => [op(1.5)(1.0), op(1.5)(2.0), op(2.5)(1.0), op(1.5)(-2.0), op(-1.5)(2.0), op(-1.5)(-1.0)];
3−const test1 = [2.5, 3.5, 3.5, -0.5, 0.5, -2.5];
4−const test10 = [1.5, 0.75, 2.5, -0.75, -0.75, 1.5];
5−const test2 = [0.5, -0.5, 1.5, 3.5, -3.5, -0.5];
6−const test3 = [false, false, false, false, false, false];
7−const test4 = [true, true, true, true, true, true];
8−const test5 = [false, true, false, false, true, true];
9−const test6 = [true, false, true, true, false, false];
10−const test7 = [false, true, false, false, true, true];
11−const test8 = [true, false, true, true, false, false];
12−const test9 = [1.5, 3.0, 2.5, -3.0, -3.0, 1.5];
13−export {numValues, test1, test10, test11, test2, test3, test4, test5, test6, test7, test8, test9};
package-lock.jsonnew file+4043
@@ -0,0 +1,4043 @@
1+{
2+ "name": "purescript-backend-optimizer",
3+ "lockfileVersion": 3,
4+ "requires": true,
5+ "packages": {
6+ "": {
7+ "hasInstallScript": true,
8+ "devDependencies": {
9+ "esbuild": "^0.27.0",
10+ "purescript": "^0.15.15",
11+ "purs-tidy": "^0.11.1",
12+ "spago": "^0.93.45"
13+ }
14+ },
15+ "node_modules/@esbuild/aix-ppc64": {
16+ "version": "0.27.1",
17+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz",
18+ "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==",
19+ "cpu": [
20+ "ppc64"
21+ ],
22+ "dev": true,
23+ "license": "MIT",
24+ "optional": true,
25+ "os": [
26+ "aix"
27+ ],
28+ "engines": {
29+ "node": ">=18"
30+ }
31+ },
32+ "node_modules/@esbuild/android-arm": {
33+ "version": "0.27.1",
34+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz",
35+ "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==",
36+ "cpu": [
37+ "arm"
38+ ],
39+ "dev": true,
40+ "license": "MIT",
41+ "optional": true,
42+ "os": [
43+ "android"
44+ ],
45+ "engines": {
46+ "node": ">=18"
47+ }
48+ },
49+ "node_modules/@esbuild/android-arm64": {
50+ "version": "0.27.1",
51+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz",
52+ "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==",
53+ "cpu": [
54+ "arm64"
55+ ],
56+ "dev": true,
57+ "license": "MIT",
58+ "optional": true,
59+ "os": [
60+ "android"
61+ ],
62+ "engines": {
63+ "node": ">=18"
64+ }
65+ },
66+ "node_modules/@esbuild/android-x64": {
67+ "version": "0.27.1",
68+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz",
69+ "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==",
70+ "cpu": [
71+ "x64"
72+ ],
73+ "dev": true,
74+ "license": "MIT",
75+ "optional": true,
76+ "os": [
77+ "android"
78+ ],
79+ "engines": {
80+ "node": ">=18"
81+ }
82+ },
83+ "node_modules/@esbuild/darwin-arm64": {
84+ "version": "0.27.1",
85+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz",
86+ "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==",
87+ "cpu": [
88+ "arm64"
89+ ],
90+ "dev": true,
91+ "license": "MIT",
92+ "optional": true,
93+ "os": [
94+ "darwin"
95+ ],
96+ "engines": {
97+ "node": ">=18"
98+ }
99+ },
100+ "node_modules/@esbuild/darwin-x64": {
101+ "version": "0.27.1",
102+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz",
103+ "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==",
104+ "cpu": [
105+ "x64"
106+ ],
107+ "dev": true,
108+ "license": "MIT",
109+ "optional": true,
110+ "os": [
111+ "darwin"
112+ ],
113+ "engines": {
114+ "node": ">=18"
115+ }
116+ },
117+ "node_modules/@esbuild/freebsd-arm64": {
118+ "version": "0.27.1",
119+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz",
120+ "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==",
121+ "cpu": [
122+ "arm64"
123+ ],
124+ "dev": true,
125+ "license": "MIT",
126+ "optional": true,
127+ "os": [
128+ "freebsd"
129+ ],
130+ "engines": {
131+ "node": ">=18"
132+ }
133+ },
134+ "node_modules/@esbuild/freebsd-x64": {
135+ "version": "0.27.1",
136+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz",
137+ "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==",
138+ "cpu": [
139+ "x64"
140+ ],
141+ "dev": true,
142+ "license": "MIT",
143+ "optional": true,
144+ "os": [
145+ "freebsd"
146+ ],
147+ "engines": {
148+ "node": ">=18"
149+ }
150+ },
151+ "node_modules/@esbuild/linux-arm": {
152+ "version": "0.27.1",
153+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz",
154+ "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==",
155+ "cpu": [
156+ "arm"
157+ ],
158+ "dev": true,
159+ "license": "MIT",
160+ "optional": true,
161+ "os": [
162+ "linux"
163+ ],
164+ "engines": {
165+ "node": ">=18"
166+ }
167+ },
168+ "node_modules/@esbuild/linux-arm64": {
169+ "version": "0.27.1",
170+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz",
171+ "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==",
172+ "cpu": [
173+ "arm64"
174+ ],
175+ "dev": true,
176+ "license": "MIT",
177+ "optional": true,
178+ "os": [
179+ "linux"
180+ ],
181+ "engines": {
182+ "node": ">=18"
183+ }
184+ },
185+ "node_modules/@esbuild/linux-ia32": {
186+ "version": "0.27.1",
187+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz",
188+ "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==",
189+ "cpu": [
190+ "ia32"
191+ ],
192+ "dev": true,
193+ "license": "MIT",
194+ "optional": true,
195+ "os": [
196+ "linux"
197+ ],
198+ "engines": {
199+ "node": ">=18"
200+ }
201+ },
202+ "node_modules/@esbuild/linux-loong64": {
203+ "version": "0.27.1",
204+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz",
205+ "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==",
206+ "cpu": [
207+ "loong64"
208+ ],
209+ "dev": true,
210+ "license": "MIT",
211+ "optional": true,
212+ "os": [
213+ "linux"
214+ ],
215+ "engines": {
216+ "node": ">=18"
217+ }
218+ },
219+ "node_modules/@esbuild/linux-mips64el": {
220+ "version": "0.27.1",
221+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz",
222+ "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==",
223+ "cpu": [
224+ "mips64el"
225+ ],
226+ "dev": true,
227+ "license": "MIT",
228+ "optional": true,
229+ "os": [
230+ "linux"
231+ ],
232+ "engines": {
233+ "node": ">=18"
234+ }
235+ },
236+ "node_modules/@esbuild/linux-ppc64": {
237+ "version": "0.27.1",
238+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz",
239+ "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==",
240+ "cpu": [
241+ "ppc64"
242+ ],
243+ "dev": true,
244+ "license": "MIT",
245+ "optional": true,
246+ "os": [
247+ "linux"
248+ ],
249+ "engines": {
250+ "node": ">=18"
251+ }
252+ },
253+ "node_modules/@esbuild/linux-riscv64": {
254+ "version": "0.27.1",
255+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz",
256+ "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==",
257+ "cpu": [
258+ "riscv64"
259+ ],
260+ "dev": true,
261+ "license": "MIT",
262+ "optional": true,
263+ "os": [
264+ "linux"
265+ ],
266+ "engines": {
267+ "node": ">=18"
268+ }
269+ },
270+ "node_modules/@esbuild/linux-s390x": {
271+ "version": "0.27.1",
272+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz",
273+ "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==",
274+ "cpu": [
275+ "s390x"
276+ ],
277+ "dev": true,
278+ "license": "MIT",
279+ "optional": true,
280+ "os": [
281+ "linux"
282+ ],
283+ "engines": {
284+ "node": ">=18"
285+ }
286+ },
287+ "node_modules/@esbuild/linux-x64": {
288+ "version": "0.27.1",
289+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz",
290+ "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==",
291+ "cpu": [
292+ "x64"
293+ ],
294+ "dev": true,
295+ "license": "MIT",
296+ "optional": true,
297+ "os": [
298+ "linux"
299+ ],
300+ "engines": {
301+ "node": ">=18"
302+ }
303+ },
304+ "node_modules/@esbuild/netbsd-arm64": {
305+ "version": "0.27.1",
306+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz",
307+ "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==",
308+ "cpu": [
309+ "arm64"
310+ ],
311+ "dev": true,
312+ "license": "MIT",
313+ "optional": true,
314+ "os": [
315+ "netbsd"
316+ ],
317+ "engines": {
318+ "node": ">=18"
319+ }
320+ },
321+ "node_modules/@esbuild/netbsd-x64": {
322+ "version": "0.27.1",
323+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz",
324+ "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==",
325+ "cpu": [
326+ "x64"
327+ ],
328+ "dev": true,
329+ "license": "MIT",
330+ "optional": true,
331+ "os": [
332+ "netbsd"
333+ ],
334+ "engines": {
335+ "node": ">=18"
336+ }
337+ },
338+ "node_modules/@esbuild/openbsd-arm64": {
339+ "version": "0.27.1",
340+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz",
341+ "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==",
342+ "cpu": [
343+ "arm64"
344+ ],
345+ "dev": true,
346+ "license": "MIT",
347+ "optional": true,
348+ "os": [
349+ "openbsd"
350+ ],
351+ "engines": {
352+ "node": ">=18"
353+ }
354+ },
355+ "node_modules/@esbuild/openbsd-x64": {
356+ "version": "0.27.1",
357+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz",
358+ "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==",
359+ "cpu": [
360+ "x64"
361+ ],
362+ "dev": true,
363+ "license": "MIT",
364+ "optional": true,
365+ "os": [
366+ "openbsd"
367+ ],
368+ "engines": {
369+ "node": ">=18"
370+ }
371+ },
372+ "node_modules/@esbuild/openharmony-arm64": {
373+ "version": "0.27.1",
374+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz",
375+ "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==",
376+ "cpu": [
377+ "arm64"
378+ ],
379+ "dev": true,
380+ "license": "MIT",
381+ "optional": true,
382+ "os": [
383+ "openharmony"
384+ ],
385+ "engines": {
386+ "node": ">=18"
387+ }
388+ },
389+ "node_modules/@esbuild/sunos-x64": {
390+ "version": "0.27.1",
391+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz",
392+ "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==",
393+ "cpu": [
394+ "x64"
395+ ],
396+ "dev": true,
397+ "license": "MIT",
398+ "optional": true,
399+ "os": [
400+ "sunos"
401+ ],
402+ "engines": {
403+ "node": ">=18"
404+ }
405+ },
406+ "node_modules/@esbuild/win32-arm64": {
407+ "version": "0.27.1",
408+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz",
409+ "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==",
410+ "cpu": [
411+ "arm64"
412+ ],
413+ "dev": true,
414+ "license": "MIT",
415+ "optional": true,
416+ "os": [
417+ "win32"
418+ ],
419+ "engines": {
420+ "node": ">=18"
421+ }
422+ },
423+ "node_modules/@esbuild/win32-ia32": {
424+ "version": "0.27.1",
425+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz",
426+ "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==",
427+ "cpu": [
428+ "ia32"
429+ ],
430+ "dev": true,
431+ "license": "MIT",
432+ "optional": true,
433+ "os": [
434+ "win32"
435+ ],
436+ "engines": {
437+ "node": ">=18"
438+ }
439+ },
440+ "node_modules/@esbuild/win32-x64": {
441+ "version": "0.27.1",
442+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz",
443+ "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==",
444+ "cpu": [
445+ "x64"
446+ ],
447+ "dev": true,
448+ "license": "MIT",
449+ "optional": true,
450+ "os": [
451+ "win32"
452+ ],
453+ "engines": {
454+ "node": ">=18"
455+ }
456+ },
457+ "node_modules/@gar/promisify": {
458+ "version": "1.1.3",
459+ "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz",
460+ "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==",
461+ "dev": true,
462+ "license": "MIT"
463+ },
464+ "node_modules/@isaacs/balanced-match": {
465+ "version": "4.0.1",
466+ "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz",
467+ "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==",
468+ "dev": true,
469+ "license": "MIT",
470+ "engines": {
471+ "node": "20 || >=22"
472+ }
473+ },
474+ "node_modules/@isaacs/brace-expansion": {
475+ "version": "5.0.0",
476+ "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz",
477+ "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==",
478+ "dev": true,
479+ "license": "MIT",
480+ "dependencies": {
481+ "@isaacs/balanced-match": "^4.0.1"
482+ },
483+ "engines": {
484+ "node": "20 || >=22"
485+ }
486+ },
487+ "node_modules/@isaacs/cliui": {
488+ "version": "8.0.2",
489+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
490+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
491+ "dev": true,
492+ "license": "ISC",
493+ "dependencies": {
494+ "string-width": "^5.1.2",
495+ "string-width-cjs": "npm:string-width@^4.2.0",
496+ "strip-ansi": "^7.0.1",
497+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
498+ "wrap-ansi": "^8.1.0",
499+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
500+ },
501+ "engines": {
502+ "node": ">=12"
503+ }
504+ },
505+ "node_modules/@isaacs/cliui/node_modules/ansi-regex": {
506+ "version": "6.2.2",
507+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
508+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
509+ "dev": true,
510+ "license": "MIT",
511+ "engines": {
512+ "node": ">=12"
513+ },
514+ "funding": {
515+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
516+ }
517+ },
518+ "node_modules/@isaacs/cliui/node_modules/ansi-styles": {
519+ "version": "6.2.3",
520+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
521+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
522+ "dev": true,
523+ "license": "MIT",
524+ "engines": {
525+ "node": ">=12"
526+ },
527+ "funding": {
528+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
529+ }
530+ },
531+ "node_modules/@isaacs/cliui/node_modules/emoji-regex": {
532+ "version": "9.2.2",
533+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
534+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
535+ "dev": true,
536+ "license": "MIT"
537+ },
538+ "node_modules/@isaacs/cliui/node_modules/string-width": {
539+ "version": "5.1.2",
540+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
541+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
542+ "dev": true,
543+ "license": "MIT",
544+ "dependencies": {
545+ "eastasianwidth": "^0.2.0",
546+ "emoji-regex": "^9.2.2",
547+ "strip-ansi": "^7.0.1"
548+ },
549+ "engines": {
550+ "node": ">=12"
551+ },
552+ "funding": {
553+ "url": "https://github.com/sponsors/sindresorhus"
554+ }
555+ },
556+ "node_modules/@isaacs/cliui/node_modules/strip-ansi": {
557+ "version": "7.1.2",
558+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
559+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
560+ "dev": true,
561+ "license": "MIT",
562+ "dependencies": {
563+ "ansi-regex": "^6.0.1"
564+ },
565+ "engines": {
566+ "node": ">=12"
567+ },
568+ "funding": {
569+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
570+ }
571+ },
572+ "node_modules/@isaacs/cliui/node_modules/wrap-ansi": {
573+ "version": "8.1.0",
574+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
575+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
576+ "dev": true,
577+ "license": "MIT",
578+ "dependencies": {
579+ "ansi-styles": "^6.1.0",
580+ "string-width": "^5.0.1",
581+ "strip-ansi": "^7.0.1"
582+ },
583+ "engines": {
584+ "node": ">=12"
585+ },
586+ "funding": {
587+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
588+ }
589+ },
590+ "node_modules/@isaacs/fs-minipass": {
591+ "version": "4.0.1",
592+ "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
593+ "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
594+ "dev": true,
595+ "license": "ISC",
596+ "dependencies": {
597+ "minipass": "^7.0.4"
598+ },
599+ "engines": {
600+ "node": ">=18.0.0"
601+ }
602+ },
603+ "node_modules/@isaacs/fs-minipass/node_modules/minipass": {
604+ "version": "7.1.2",
605+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
606+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
607+ "dev": true,
608+ "license": "ISC",
609+ "engines": {
610+ "node": ">=16 || 14 >=14.17"
611+ }
612+ },
613+ "node_modules/@nodelib/fs.scandir": {
614+ "version": "4.0.1",
615+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-4.0.1.tgz",
616+ "integrity": "sha512-vAkI715yhnmiPupY+dq+xenu5Tdf2TBQ66jLvBIcCddtz+5Q8LbMKaf9CIJJreez8fQ8fgaY+RaywQx8RJIWpw==",
617+ "dev": true,
618+ "license": "MIT",
619+ "dependencies": {
620+ "@nodelib/fs.stat": "4.0.0",
621+ "run-parallel": "^1.2.0"
622+ },
623+ "engines": {
624+ "node": ">=18.18.0"
625+ }
626+ },
627+ "node_modules/@nodelib/fs.stat": {
628+ "version": "4.0.0",
629+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-4.0.0.tgz",
630+ "integrity": "sha512-ctr6bByzksKRCV0bavi8WoQevU6plSp2IkllIsEqaiKe2mwNNnaluhnRhcsgGZHrrHk57B3lf95MkLMO3STYcg==",
631+ "dev": true,
632+ "license": "MIT",
633+ "engines": {
634+ "node": ">=18.18.0"
635+ }
636+ },
637+ "node_modules/@nodelib/fs.walk": {
638+ "version": "3.0.1",
639+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-3.0.1.tgz",
640+ "integrity": "sha512-nIh/M6Kh3ZtOmlY00DaUYB4xeeV6F3/ts1l29iwl3/cfyY/OuCfUx+v08zgx8TKPTifXRcjjqVQ4KB2zOYSbyw==",
641+ "dev": true,
642+ "license": "MIT",
643+ "dependencies": {
644+ "@nodelib/fs.scandir": "4.0.1",
645+ "fastq": "^1.15.0"
646+ },
647+ "engines": {
648+ "node": ">=18.18.0"
649+ }
650+ },
651+ "node_modules/@npmcli/fs": {
652+ "version": "2.1.2",
653+ "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz",
654+ "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==",
655+ "dev": true,
656+ "license": "ISC",
657+ "dependencies": {
658+ "@gar/promisify": "^1.1.3",
659+ "semver": "^7.3.5"
660+ },
661+ "engines": {
662+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
663+ }
664+ },
665+ "node_modules/@npmcli/move-file": {
666+ "version": "2.0.1",
667+ "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz",
668+ "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==",
669+ "deprecated": "This functionality has been moved to @npmcli/fs",
670+ "dev": true,
671+ "license": "MIT",
672+ "dependencies": {
673+ "mkdirp": "^1.0.4",
674+ "rimraf": "^3.0.2"
675+ },
676+ "engines": {
677+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
678+ }
679+ },
680+ "node_modules/@npmcli/move-file/node_modules/mkdirp": {
681+ "version": "1.0.4",
682+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
683+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
684+ "dev": true,
685+ "license": "MIT",
686+ "bin": {
687+ "mkdirp": "bin/cmd.js"
688+ },
689+ "engines": {
690+ "node": ">=10"
691+ }
692+ },
693+ "node_modules/@npmcli/move-file/node_modules/rimraf": {
694+ "version": "3.0.2",
695+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
696+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
697+ "deprecated": "Rimraf versions prior to v4 are no longer supported",
698+ "dev": true,
699+ "license": "ISC",
700+ "dependencies": {
701+ "glob": "^7.1.3"
702+ },
703+ "bin": {
704+ "rimraf": "bin.js"
705+ },
706+ "funding": {
707+ "url": "https://github.com/sponsors/isaacs"
708+ }
709+ },
710+ "node_modules/@tootallnate/once": {
711+ "version": "2.0.0",
712+ "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz",
713+ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==",
714+ "dev": true,
715+ "license": "MIT",
716+ "engines": {
717+ "node": ">= 10"
718+ }
719+ },
720+ "node_modules/agent-base": {
721+ "version": "6.0.2",
722+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
723+ "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
724+ "dev": true,
725+ "license": "MIT",
726+ "dependencies": {
727+ "debug": "4"
728+ },
729+ "engines": {
730+ "node": ">= 6.0.0"
731+ }
732+ },
733+ "node_modules/agentkeepalive": {
734+ "version": "4.6.0",
735+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
736+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
737+ "dev": true,
738+ "license": "MIT",
739+ "dependencies": {
740+ "humanize-ms": "^1.2.1"
741+ },
742+ "engines": {
743+ "node": ">= 8.0.0"
744+ }
745+ },
746+ "node_modules/aggregate-error": {
747+ "version": "3.1.0",
748+ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
749+ "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
750+ "dev": true,
751+ "license": "MIT",
752+ "dependencies": {
753+ "clean-stack": "^2.0.0",
754+ "indent-string": "^4.0.0"
755+ },
756+ "engines": {
757+ "node": ">=8"
758+ }
759+ },
760+ "node_modules/ansi-escapes": {
761+ "version": "4.3.2",
762+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
763+ "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==",
764+ "dev": true,
765+ "license": "MIT",
766+ "dependencies": {
767+ "type-fest": "^0.21.3"
768+ },
769+ "engines": {
770+ "node": ">=8"
771+ },
772+ "funding": {
773+ "url": "https://github.com/sponsors/sindresorhus"
774+ }
775+ },
776+ "node_modules/ansi-regex": {
777+ "version": "5.0.1",
778+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
779+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
780+ "dev": true,
781+ "license": "MIT",
782+ "engines": {
783+ "node": ">=8"
784+ }
785+ },
786+ "node_modules/ansi-styles": {
787+ "version": "3.2.1",
788+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
789+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
790+ "dev": true,
791+ "license": "MIT",
792+ "dependencies": {
793+ "color-convert": "^1.9.0"
794+ },
795+ "engines": {
796+ "node": ">=4"
797+ }
798+ },
799+ "node_modules/aproba": {
800+ "version": "1.2.0",
801+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
802+ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
803+ "dev": true,
804+ "license": "ISC"
805+ },
806+ "node_modules/argparse": {
807+ "version": "2.0.1",
808+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
809+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
810+ "dev": true,
811+ "license": "Python-2.0"
812+ },
813+ "node_modules/asn1": {
814+ "version": "0.2.6",
815+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
816+ "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
817+ "dev": true,
818+ "license": "MIT",
819+ "dependencies": {
820+ "safer-buffer": "~2.1.0"
821+ }
822+ },
823+ "node_modules/astral-regex": {
824+ "version": "2.0.0",
825+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz",
826+ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==",
827+ "dev": true,
828+ "license": "MIT",
829+ "engines": {
830+ "node": ">=8"
831+ }
832+ },
833+ "node_modules/balanced-match": {
834+ "version": "1.0.2",
835+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
836+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
837+ "dev": true,
838+ "license": "MIT"
839+ },
840+ "node_modules/base64-js": {
841+ "version": "1.5.1",
842+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
843+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
844+ "dev": true,
845+ "funding": [
846+ {
847+ "type": "github",
848+ "url": "https://github.com/sponsors/feross"
849+ },
850+ {
851+ "type": "patreon",
852+ "url": "https://www.patreon.com/feross"
853+ },
854+ {
855+ "type": "consulting",
856+ "url": "https://feross.org/support"
857+ }
858+ ],
859+ "license": "MIT"
860+ },
861+ "node_modules/bcrypt-pbkdf": {
862+ "version": "1.0.2",
863+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
864+ "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
865+ "dev": true,
866+ "license": "BSD-3-Clause",
867+ "dependencies": {
868+ "tweetnacl": "^0.14.3"
869+ }
870+ },
871+ "node_modules/better-sqlite3": {
872+ "version": "12.5.0",
873+ "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.5.0.tgz",
874+ "integrity": "sha512-WwCZ/5Diz7rsF29o27o0Gcc1Du+l7Zsv7SYtVPG0X3G/uUI1LqdxrQI7c9Hs2FWpqXXERjW9hp6g3/tH7DlVKg==",
875+ "dev": true,
876+ "hasInstallScript": true,
877+ "license": "MIT",
878+ "dependencies": {
879+ "bindings": "^1.5.0",
880+ "prebuild-install": "^7.1.1"
881+ },
882+ "engines": {
883+ "node": "20.x || 22.x || 23.x || 24.x || 25.x"
884+ }
885+ },
886+ "node_modules/bindings": {
887+ "version": "1.5.0",
888+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
889+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
890+ "dev": true,
891+ "license": "MIT",
892+ "dependencies": {
893+ "file-uri-to-path": "1.0.0"
894+ }
895+ },
896+ "node_modules/bl": {
897+ "version": "4.1.0",
898+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
899+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
900+ "dev": true,
901+ "license": "MIT",
902+ "dependencies": {
903+ "buffer": "^5.5.0",
904+ "inherits": "^2.0.4",
905+ "readable-stream": "^3.4.0"
906+ }
907+ },
908+ "node_modules/bl/node_modules/readable-stream": {
909+ "version": "3.6.2",
910+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
911+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
912+ "dev": true,
913+ "license": "MIT",
914+ "dependencies": {
915+ "inherits": "^2.0.3",
916+ "string_decoder": "^1.1.1",
917+ "util-deprecate": "^1.0.1"
918+ },
919+ "engines": {
920+ "node": ">= 6"
921+ }
922+ },
923+ "node_modules/bluebird": {
924+ "version": "3.7.2",
925+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
926+ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
927+ "dev": true,
928+ "license": "MIT"
929+ },
930+ "node_modules/brace-expansion": {
931+ "version": "1.1.12",
932+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
933+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
934+ "dev": true,
935+ "license": "MIT",
936+ "dependencies": {
937+ "balanced-match": "^1.0.0",
938+ "concat-map": "0.0.1"
939+ }
940+ },
941+ "node_modules/braces": {
942+ "version": "3.0.3",
943+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
944+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
945+ "dev": true,
946+ "license": "MIT",
947+ "dependencies": {
948+ "fill-range": "^7.1.1"
949+ },
950+ "engines": {
951+ "node": ">=8"
952+ }
953+ },
954+ "node_modules/buffer": {
955+ "version": "5.7.1",
956+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
957+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
958+ "dev": true,
959+ "funding": [
960+ {
961+ "type": "github",
962+ "url": "https://github.com/sponsors/feross"
963+ },
964+ {
965+ "type": "patreon",
966+ "url": "https://www.patreon.com/feross"
967+ },
968+ {
969+ "type": "consulting",
970+ "url": "https://feross.org/support"
971+ }
972+ ],
973+ "license": "MIT",
974+ "dependencies": {
975+ "base64-js": "^1.3.1",
976+ "ieee754": "^1.1.13"
977+ }
978+ },
979+ "node_modules/buffer-from": {
980+ "version": "1.1.2",
981+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
982+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
983+ "dev": true,
984+ "license": "MIT"
985+ },
986+ "node_modules/buildcheck": {
987+ "version": "0.0.7",
988+ "resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.7.tgz",
989+ "integrity": "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==",
990+ "dev": true,
991+ "optional": true,
992+ "engines": {
993+ "node": ">=10.0.0"
994+ }
995+ },
996+ "node_modules/bundle-name": {
997+ "version": "4.1.0",
998+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
999+ "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
1000+ "dev": true,
1001+ "license": "MIT",
1002+ "dependencies": {
1003+ "run-applescript": "^7.0.0"
1004+ },
1005+ "engines": {
1006+ "node": ">=18"
1007+ },
1008+ "funding": {
1009+ "url": "https://github.com/sponsors/sindresorhus"
1010+ }
1011+ },
1012+ "node_modules/byline": {
1013+ "version": "5.0.0",
1014+ "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
1015+ "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==",
1016+ "dev": true,
1017+ "license": "MIT",
1018+ "engines": {
1019+ "node": ">=0.10.0"
1020+ }
1021+ },
1022+ "node_modules/cacache": {
1023+ "version": "11.3.3",
1024+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
1025+ "integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
1026+ "dev": true,
1027+ "license": "ISC",
1028+ "dependencies": {
1029+ "bluebird": "^3.5.5",
1030+ "chownr": "^1.1.1",
1031+ "figgy-pudding": "^3.5.1",
1032+ "glob": "^7.1.4",
1033+ "graceful-fs": "^4.1.15",
1034+ "lru-cache": "^5.1.1",
1035+ "mississippi": "^3.0.0",
1036+ "mkdirp": "^0.5.1",
1037+ "move-concurrently": "^1.0.1",
1038+ "promise-inflight": "^1.0.1",
1039+ "rimraf": "^2.6.3",
1040+ "ssri": "^6.0.1",
1041+ "unique-filename": "^1.1.1",
1042+ "y18n": "^4.0.0"
1043+ }
1044+ },
1045+ "node_modules/chalk": {
1046+ "version": "2.4.2",
1047+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
1048+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
1049+ "dev": true,
1050+ "license": "MIT",
1051+ "dependencies": {
1052+ "ansi-styles": "^3.2.1",
1053+ "escape-string-regexp": "^1.0.5",
1054+ "supports-color": "^5.3.0"
1055+ },
1056+ "engines": {
1057+ "node": ">=4"
1058+ }
1059+ },
1060+ "node_modules/chownr": {
1061+ "version": "1.1.4",
1062+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
1063+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
1064+ "dev": true,
1065+ "license": "ISC"
1066+ },
1067+ "node_modules/clean-stack": {
1068+ "version": "2.2.0",
1069+ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
1070+ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
1071+ "dev": true,
1072+ "license": "MIT",
1073+ "engines": {
1074+ "node": ">=6"
1075+ }
1076+ },
1077+ "node_modules/cli-cursor": {
1078+ "version": "3.1.0",
1079+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
1080+ "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
1081+ "dev": true,
1082+ "license": "MIT",
1083+ "dependencies": {
1084+ "restore-cursor": "^3.1.0"
1085+ },
1086+ "engines": {
1087+ "node": ">=8"
1088+ }
1089+ },
1090+ "node_modules/color-convert": {
1091+ "version": "1.9.3",
1092+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
1093+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
1094+ "dev": true,
1095+ "license": "MIT",
1096+ "dependencies": {
1097+ "color-name": "1.1.3"
1098+ }
1099+ },
1100+ "node_modules/color-name": {
1101+ "version": "1.1.3",
1102+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
1103+ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
1104+ "dev": true,
1105+ "license": "MIT"
1106+ },
1107+ "node_modules/concat-map": {
1108+ "version": "0.0.1",
1109+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
1110+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
1111+ "dev": true,
1112+ "license": "MIT"
1113+ },
1114+ "node_modules/concat-stream": {
1115+ "version": "1.6.2",
1116+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
1117+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
1118+ "dev": true,
1119+ "engines": [
1120+ "node >= 0.8"
1121+ ],
1122+ "license": "MIT",
1123+ "dependencies": {
1124+ "buffer-from": "^1.0.0",
1125+ "inherits": "^2.0.3",
1126+ "readable-stream": "^2.2.2",
1127+ "typedarray": "^0.0.6"
1128+ }
1129+ },
1130+ "node_modules/copy-concurrently": {
1131+ "version": "1.0.5",
1132+ "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
1133+ "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==",
1134+ "deprecated": "This package is no longer supported.",
1135+ "dev": true,
1136+ "license": "ISC",
1137+ "dependencies": {
1138+ "aproba": "^1.1.1",
1139+ "fs-write-stream-atomic": "^1.0.8",
1140+ "iferr": "^0.1.5",
1141+ "mkdirp": "^0.5.1",
1142+ "rimraf": "^2.5.4",
1143+ "run-queue": "^1.0.0"
1144+ }
1145+ },
1146+ "node_modules/core-util-is": {
1147+ "version": "1.0.3",
1148+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
1149+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
1150+ "dev": true,
1151+ "license": "MIT"
1152+ },
1153+ "node_modules/cpu-features": {
1154+ "version": "0.0.10",
1155+ "resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz",
1156+ "integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==",
1157+ "dev": true,
1158+ "hasInstallScript": true,
1159+ "optional": true,
1160+ "dependencies": {
1161+ "buildcheck": "~0.0.6",
1162+ "nan": "^2.19.0"
1163+ },
1164+ "engines": {
1165+ "node": ">=10.0.0"
1166+ }
1167+ },
1168+ "node_modules/cross-spawn": {
1169+ "version": "7.0.6",
1170+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
1171+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
1172+ "dev": true,
1173+ "license": "MIT",
1174+ "dependencies": {
1175+ "path-key": "^3.1.0",
1176+ "shebang-command": "^2.0.0",
1177+ "which": "^2.0.1"
1178+ },
1179+ "engines": {
1180+ "node": ">= 8"
1181+ }
1182+ },
1183+ "node_modules/cross-spawn/node_modules/which": {
1184+ "version": "2.0.2",
1185+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
1186+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
1187+ "dev": true,
1188+ "license": "ISC",
1189+ "dependencies": {
1190+ "isexe": "^2.0.0"
1191+ },
1192+ "bin": {
1193+ "node-which": "bin/node-which"
1194+ },
1195+ "engines": {
1196+ "node": ">= 8"
1197+ }
1198+ },
1199+ "node_modules/cyclist": {
1200+ "version": "1.0.2",
1201+ "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.2.tgz",
1202+ "integrity": "sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==",
1203+ "dev": true,
1204+ "license": "MIT"
1205+ },
1206+ "node_modules/debug": {
1207+ "version": "4.4.3",
1208+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
1209+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
1210+ "dev": true,
1211+ "license": "MIT",
1212+ "dependencies": {
1213+ "ms": "^2.1.3"
1214+ },
1215+ "engines": {
1216+ "node": ">=6.0"
1217+ },
1218+ "peerDependenciesMeta": {
1219+ "supports-color": {
1220+ "optional": true
1221+ }
1222+ }
1223+ },
1224+ "node_modules/decompress-response": {
1225+ "version": "6.0.0",
1226+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
1227+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
1228+ "dev": true,
1229+ "license": "MIT",
1230+ "dependencies": {
1231+ "mimic-response": "^3.1.0"
1232+ },
1233+ "engines": {
1234+ "node": ">=10"
1235+ },
1236+ "funding": {
1237+ "url": "https://github.com/sponsors/sindresorhus"
1238+ }
1239+ },
1240+ "node_modules/deep-extend": {
1241+ "version": "0.6.0",
1242+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
1243+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
1244+ "dev": true,
1245+ "license": "MIT",
1246+ "engines": {
1247+ "node": ">=4.0.0"
1248+ }
1249+ },
1250+ "node_modules/default-browser": {
1251+ "version": "5.4.0",
1252+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.4.0.tgz",
1253+ "integrity": "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==",
1254+ "dev": true,
1255+ "license": "MIT",
1256+ "dependencies": {
1257+ "bundle-name": "^4.1.0",
1258+ "default-browser-id": "^5.0.0"
1259+ },
1260+ "engines": {
1261+ "node": ">=18"
1262+ },
1263+ "funding": {
1264+ "url": "https://github.com/sponsors/sindresorhus"
1265+ }
1266+ },
1267+ "node_modules/default-browser-id": {
1268+ "version": "5.0.1",
1269+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
1270+ "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
1271+ "dev": true,
1272+ "license": "MIT",
1273+ "engines": {
1274+ "node": ">=18"
1275+ },
1276+ "funding": {
1277+ "url": "https://github.com/sponsors/sindresorhus"
1278+ }
1279+ },
1280+ "node_modules/define-lazy-prop": {
1281+ "version": "3.0.0",
1282+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
1283+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
1284+ "dev": true,
1285+ "license": "MIT",
1286+ "engines": {
1287+ "node": ">=12"
1288+ },
1289+ "funding": {
1290+ "url": "https://github.com/sponsors/sindresorhus"
1291+ }
1292+ },
1293+ "node_modules/detect-libc": {
1294+ "version": "2.1.2",
1295+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
1296+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
1297+ "dev": true,
1298+ "license": "Apache-2.0",
1299+ "engines": {
1300+ "node": ">=8"
1301+ }
1302+ },
1303+ "node_modules/duplexify": {
1304+ "version": "3.7.1",
1305+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
1306+ "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
1307+ "dev": true,
1308+ "license": "MIT",
1309+ "dependencies": {
1310+ "end-of-stream": "^1.0.0",
1311+ "inherits": "^2.0.1",
1312+ "readable-stream": "^2.0.0",
1313+ "stream-shift": "^1.0.0"
1314+ }
1315+ },
1316+ "node_modules/eastasianwidth": {
1317+ "version": "0.2.0",
1318+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
1319+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
1320+ "dev": true,
1321+ "license": "MIT"
1322+ },
1323+ "node_modules/emoji-regex": {
1324+ "version": "8.0.0",
1325+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
1326+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
1327+ "dev": true,
1328+ "license": "MIT"
1329+ },
1330+ "node_modules/encoding": {
1331+ "version": "0.1.13",
1332+ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
1333+ "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
1334+ "dev": true,
1335+ "license": "MIT",
1336+ "optional": true,
1337+ "dependencies": {
1338+ "iconv-lite": "^0.6.2"
1339+ }
1340+ },
1341+ "node_modules/end-of-stream": {
1342+ "version": "1.4.5",
1343+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
1344+ "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
1345+ "dev": true,
1346+ "license": "MIT",
1347+ "dependencies": {
1348+ "once": "^1.4.0"
1349+ }
1350+ },
1351+ "node_modules/entities": {
1352+ "version": "4.5.0",
1353+ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
1354+ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
1355+ "dev": true,
1356+ "license": "BSD-2-Clause",
1357+ "engines": {
1358+ "node": ">=0.12"
1359+ },
1360+ "funding": {
1361+ "url": "https://github.com/fb55/entities?sponsor=1"
1362+ }
1363+ },
1364+ "node_modules/env-paths": {
1365+ "version": "2.2.1",
1366+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
1367+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
1368+ "dev": true,
1369+ "license": "MIT",
1370+ "engines": {
1371+ "node": ">=6"
1372+ }
1373+ },
1374+ "node_modules/err-code": {
1375+ "version": "2.0.3",
1376+ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
1377+ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==",
1378+ "dev": true,
1379+ "license": "MIT"
1380+ },
1381+ "node_modules/esbuild": {
1382+ "version": "0.27.1",
1383+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz",
1384+ "integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==",
1385+ "dev": true,
1386+ "hasInstallScript": true,
1387+ "license": "MIT",
1388+ "bin": {
1389+ "esbuild": "bin/esbuild"
1390+ },
1391+ "engines": {
1392+ "node": ">=18"
1393+ },
1394+ "optionalDependencies": {
1395+ "@esbuild/aix-ppc64": "0.27.1",
1396+ "@esbuild/android-arm": "0.27.1",
1397+ "@esbuild/android-arm64": "0.27.1",
1398+ "@esbuild/android-x64": "0.27.1",
1399+ "@esbuild/darwin-arm64": "0.27.1",
1400+ "@esbuild/darwin-x64": "0.27.1",
1401+ "@esbuild/freebsd-arm64": "0.27.1",
1402+ "@esbuild/freebsd-x64": "0.27.1",
1403+ "@esbuild/linux-arm": "0.27.1",
1404+ "@esbuild/linux-arm64": "0.27.1",
1405+ "@esbuild/linux-ia32": "0.27.1",
1406+ "@esbuild/linux-loong64": "0.27.1",
1407+ "@esbuild/linux-mips64el": "0.27.1",
1408+ "@esbuild/linux-ppc64": "0.27.1",
1409+ "@esbuild/linux-riscv64": "0.27.1",
1410+ "@esbuild/linux-s390x": "0.27.1",
1411+ "@esbuild/linux-x64": "0.27.1",
1412+ "@esbuild/netbsd-arm64": "0.27.1",
1413+ "@esbuild/netbsd-x64": "0.27.1",
1414+ "@esbuild/openbsd-arm64": "0.27.1",
1415+ "@esbuild/openbsd-x64": "0.27.1",
1416+ "@esbuild/openharmony-arm64": "0.27.1",
1417+ "@esbuild/sunos-x64": "0.27.1",
1418+ "@esbuild/win32-arm64": "0.27.1",
1419+ "@esbuild/win32-ia32": "0.27.1",
1420+ "@esbuild/win32-x64": "0.27.1"
1421+ }
1422+ },
1423+ "node_modules/escape-string-regexp": {
1424+ "version": "1.0.5",
1425+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
1426+ "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
1427+ "dev": true,
1428+ "license": "MIT",
1429+ "engines": {
1430+ "node": ">=0.8.0"
1431+ }
1432+ },
1433+ "node_modules/execa": {
1434+ "version": "2.1.0",
1435+ "resolved": "https://registry.npmjs.org/execa/-/execa-2.1.0.tgz",
1436+ "integrity": "sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==",
1437+ "dev": true,
1438+ "license": "MIT",
1439+ "dependencies": {
1440+ "cross-spawn": "^7.0.0",
1441+ "get-stream": "^5.0.0",
1442+ "is-stream": "^2.0.0",
1443+ "merge-stream": "^2.0.0",
1444+ "npm-run-path": "^3.0.0",
1445+ "onetime": "^5.1.0",
1446+ "p-finally": "^2.0.0",
1447+ "signal-exit": "^3.0.2",
1448+ "strip-final-newline": "^2.0.0"
1449+ },
1450+ "engines": {
1451+ "node": "^8.12.0 || >=9.7.0"
1452+ }
1453+ },
1454+ "node_modules/expand-template": {
1455+ "version": "2.0.3",
1456+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
1457+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
1458+ "dev": true,
1459+ "license": "(MIT OR WTFPL)",
1460+ "engines": {
1461+ "node": ">=6"
1462+ }
1463+ },
1464+ "node_modules/fastq": {
1465+ "version": "1.19.1",
1466+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
1467+ "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
1468+ "dev": true,
1469+ "license": "ISC",
1470+ "dependencies": {
1471+ "reusify": "^1.0.4"
1472+ }
1473+ },
1474+ "node_modules/figgy-pudding": {
1475+ "version": "3.5.2",
1476+ "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz",
1477+ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==",
1478+ "deprecated": "This module is no longer supported.",
1479+ "dev": true,
1480+ "license": "ISC"
1481+ },
1482+ "node_modules/file-uri-to-path": {
1483+ "version": "1.0.0",
1484+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
1485+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
1486+ "dev": true,
1487+ "license": "MIT"
1488+ },
1489+ "node_modules/filesize": {
1490+ "version": "4.2.1",
1491+ "resolved": "https://registry.npmjs.org/filesize/-/filesize-4.2.1.tgz",
1492+ "integrity": "sha512-bP82Hi8VRZX/TUBKfE24iiUGsB/sfm2WUrwTQyAzQrhO3V9IhcBBNBXMyzLY5orACxRyYJ3d2HeRVX+eFv4lmA==",
1493+ "dev": true,
1494+ "license": "BSD-3-Clause",
1495+ "engines": {
1496+ "node": ">= 0.4.0"
1497+ }
1498+ },
1499+ "node_modules/fill-range": {
1500+ "version": "7.1.1",
1501+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
1502+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
1503+ "dev": true,
1504+ "license": "MIT",
1505+ "dependencies": {
1506+ "to-regex-range": "^5.0.1"
1507+ },
1508+ "engines": {
1509+ "node": ">=8"
1510+ }
1511+ },
1512+ "node_modules/flush-write-stream": {
1513+ "version": "1.1.1",
1514+ "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
1515+ "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==",
1516+ "dev": true,
1517+ "license": "MIT",
1518+ "dependencies": {
1519+ "inherits": "^2.0.3",
1520+ "readable-stream": "^2.3.6"
1521+ }
1522+ },
1523+ "node_modules/foreground-child": {
1524+ "version": "3.3.1",
1525+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
1526+ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
1527+ "dev": true,
1528+ "license": "ISC",
1529+ "dependencies": {
1530+ "cross-spawn": "^7.0.6",
1531+ "signal-exit": "^4.0.1"
1532+ },
1533+ "engines": {
1534+ "node": ">=14"
1535+ },
1536+ "funding": {
1537+ "url": "https://github.com/sponsors/isaacs"
1538+ }
1539+ },
1540+ "node_modules/foreground-child/node_modules/signal-exit": {
1541+ "version": "4.1.0",
1542+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
1543+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
1544+ "dev": true,
1545+ "license": "ISC",
1546+ "engines": {
1547+ "node": ">=14"
1548+ },
1549+ "funding": {
1550+ "url": "https://github.com/sponsors/isaacs"
1551+ }
1552+ },
1553+ "node_modules/from2": {
1554+ "version": "2.3.0",
1555+ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
1556+ "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==",
1557+ "dev": true,
1558+ "license": "MIT",
1559+ "dependencies": {
1560+ "inherits": "^2.0.1",
1561+ "readable-stream": "^2.0.0"
1562+ }
1563+ },
1564+ "node_modules/fs-constants": {
1565+ "version": "1.0.0",
1566+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
1567+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
1568+ "dev": true,
1569+ "license": "MIT"
1570+ },
1571+ "node_modules/fs-extra": {
1572+ "version": "11.3.2",
1573+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz",
1574+ "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==",
1575+ "dev": true,
1576+ "license": "MIT",
1577+ "dependencies": {
1578+ "graceful-fs": "^4.2.0",
1579+ "jsonfile": "^6.0.1",
1580+ "universalify": "^2.0.0"
1581+ },
1582+ "engines": {
1583+ "node": ">=14.14"
1584+ }
1585+ },
1586+ "node_modules/fs-minipass": {
1587+ "version": "2.1.0",
1588+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
1589+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
1590+ "dev": true,
1591+ "license": "ISC",
1592+ "dependencies": {
1593+ "minipass": "^3.0.0"
1594+ },
1595+ "engines": {
1596+ "node": ">= 8"
1597+ }
1598+ },
1599+ "node_modules/fs-write-stream-atomic": {
1600+ "version": "1.0.10",
1601+ "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz",
1602+ "integrity": "sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA==",
1603+ "deprecated": "This package is no longer supported.",
1604+ "dev": true,
1605+ "license": "ISC",
1606+ "dependencies": {
1607+ "graceful-fs": "^4.1.2",
1608+ "iferr": "^0.1.5",
1609+ "imurmurhash": "^0.1.4",
1610+ "readable-stream": "1 || 2"
1611+ }
1612+ },
1613+ "node_modules/fs.realpath": {
1614+ "version": "1.0.0",
1615+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
1616+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
1617+ "dev": true,
1618+ "license": "ISC"
1619+ },
1620+ "node_modules/fuse.js": {
1621+ "version": "7.1.0",
1622+ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.1.0.tgz",
1623+ "integrity": "sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==",
1624+ "dev": true,
1625+ "license": "Apache-2.0",
1626+ "engines": {
1627+ "node": ">=10"
1628+ }
1629+ },
1630+ "node_modules/get-stream": {
1631+ "version": "5.2.0",
1632+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
1633+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
1634+ "dev": true,
1635+ "license": "MIT",
1636+ "dependencies": {
1637+ "pump": "^3.0.0"
1638+ },
1639+ "engines": {
1640+ "node": ">=8"
1641+ },
1642+ "funding": {
1643+ "url": "https://github.com/sponsors/sindresorhus"
1644+ }
1645+ },
1646+ "node_modules/github-from-package": {
1647+ "version": "0.0.0",
1648+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
1649+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==",
1650+ "dev": true,
1651+ "license": "MIT"
1652+ },
1653+ "node_modules/glob": {
1654+ "version": "7.2.3",
1655+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
1656+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
1657+ "deprecated": "Glob versions prior to v9 are no longer supported",
1658+ "dev": true,
1659+ "license": "ISC",
1660+ "dependencies": {
1661+ "fs.realpath": "^1.0.0",
1662+ "inflight": "^1.0.4",
1663+ "inherits": "2",
1664+ "minimatch": "^3.1.1",
1665+ "once": "^1.3.0",
1666+ "path-is-absolute": "^1.0.0"
1667+ },
1668+ "engines": {
1669+ "node": "*"
1670+ },
1671+ "funding": {
1672+ "url": "https://github.com/sponsors/isaacs"
1673+ }
1674+ },
1675+ "node_modules/graceful-fs": {
1676+ "version": "4.2.11",
1677+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
1678+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
1679+ "dev": true,
1680+ "license": "ISC"
1681+ },
1682+ "node_modules/has-flag": {
1683+ "version": "3.0.0",
1684+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
1685+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
1686+ "dev": true,
1687+ "license": "MIT",
1688+ "engines": {
1689+ "node": ">=4"
1690+ }
1691+ },
1692+ "node_modules/http-cache-semantics": {
1693+ "version": "4.2.0",
1694+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",
1695+ "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==",
1696+ "dev": true,
1697+ "license": "BSD-2-Clause"
1698+ },
1699+ "node_modules/http-proxy-agent": {
1700+ "version": "5.0.0",
1701+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
1702+ "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==",
1703+ "dev": true,
1704+ "license": "MIT",
1705+ "dependencies": {
1706+ "@tootallnate/once": "2",
1707+ "agent-base": "6",
1708+ "debug": "4"
1709+ },
1710+ "engines": {
1711+ "node": ">= 6"
1712+ }
1713+ },
1714+ "node_modules/https-proxy-agent": {
1715+ "version": "5.0.1",
1716+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
1717+ "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
1718+ "dev": true,
1719+ "license": "MIT",
1720+ "dependencies": {
1721+ "agent-base": "6",
1722+ "debug": "4"
1723+ },
1724+ "engines": {
1725+ "node": ">= 6"
1726+ }
1727+ },
1728+ "node_modules/humanize-ms": {
1729+ "version": "1.2.1",
1730+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
1731+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
1732+ "dev": true,
1733+ "license": "MIT",
1734+ "dependencies": {
1735+ "ms": "^2.0.0"
1736+ }
1737+ },
1738+ "node_modules/iconv-lite": {
1739+ "version": "0.6.3",
1740+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
1741+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
1742+ "dev": true,
1743+ "license": "MIT",
1744+ "optional": true,
1745+ "dependencies": {
1746+ "safer-buffer": ">= 2.1.2 < 3.0.0"
1747+ },
1748+ "engines": {
1749+ "node": ">=0.10.0"
1750+ }
1751+ },
1752+ "node_modules/ieee754": {
1753+ "version": "1.2.1",
1754+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
1755+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
1756+ "dev": true,
1757+ "funding": [
1758+ {
1759+ "type": "github",
1760+ "url": "https://github.com/sponsors/feross"
1761+ },
1762+ {
1763+ "type": "patreon",
1764+ "url": "https://www.patreon.com/feross"
1765+ },
1766+ {
1767+ "type": "consulting",
1768+ "url": "https://feross.org/support"
1769+ }
1770+ ],
1771+ "license": "BSD-3-Clause"
1772+ },
1773+ "node_modules/iferr": {
1774+ "version": "0.1.5",
1775+ "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
1776+ "integrity": "sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA==",
1777+ "dev": true,
1778+ "license": "MIT"
1779+ },
1780+ "node_modules/imurmurhash": {
1781+ "version": "0.1.4",
1782+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
1783+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
1784+ "dev": true,
1785+ "license": "MIT",
1786+ "engines": {
1787+ "node": ">=0.8.19"
1788+ }
1789+ },
1790+ "node_modules/indent-string": {
1791+ "version": "4.0.0",
1792+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
1793+ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
1794+ "dev": true,
1795+ "license": "MIT",
1796+ "engines": {
1797+ "node": ">=8"
1798+ }
1799+ },
1800+ "node_modules/infer-owner": {
1801+ "version": "1.0.4",
1802+ "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
1803+ "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==",
1804+ "dev": true,
1805+ "license": "ISC"
1806+ },
1807+ "node_modules/inflight": {
1808+ "version": "1.0.6",
1809+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
1810+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
1811+ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
1812+ "dev": true,
1813+ "license": "ISC",
1814+ "dependencies": {
1815+ "once": "^1.3.0",
1816+ "wrappy": "1"
1817+ }
1818+ },
1819+ "node_modules/inherits": {
1820+ "version": "2.0.4",
1821+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
1822+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
1823+ "dev": true,
1824+ "license": "ISC"
1825+ },
1826+ "node_modules/ini": {
1827+ "version": "1.3.8",
1828+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
1829+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==",
1830+ "dev": true,
1831+ "license": "ISC"
1832+ },
1833+ "node_modules/ip-address": {
1834+ "version": "10.1.0",
1835+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz",
1836+ "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==",
1837+ "dev": true,
1838+ "license": "MIT",
1839+ "engines": {
1840+ "node": ">= 12"
1841+ }
1842+ },
1843+ "node_modules/is-docker": {
1844+ "version": "3.0.0",
1845+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
1846+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
1847+ "dev": true,
1848+ "license": "MIT",
1849+ "bin": {
1850+ "is-docker": "cli.js"
1851+ },
1852+ "engines": {
1853+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
1854+ },
1855+ "funding": {
1856+ "url": "https://github.com/sponsors/sindresorhus"
1857+ }
1858+ },
1859+ "node_modules/is-fullwidth-code-point": {
1860+ "version": "3.0.0",
1861+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
1862+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
1863+ "dev": true,
1864+ "license": "MIT",
1865+ "engines": {
1866+ "node": ">=8"
1867+ }
1868+ },
1869+ "node_modules/is-inside-container": {
1870+ "version": "1.0.0",
1871+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
1872+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
1873+ "dev": true,
1874+ "license": "MIT",
1875+ "dependencies": {
1876+ "is-docker": "^3.0.0"
1877+ },
1878+ "bin": {
1879+ "is-inside-container": "cli.js"
1880+ },
1881+ "engines": {
1882+ "node": ">=14.16"
1883+ },
1884+ "funding": {
1885+ "url": "https://github.com/sponsors/sindresorhus"
1886+ }
1887+ },
1888+ "node_modules/is-lambda": {
1889+ "version": "1.0.1",
1890+ "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz",
1891+ "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==",
1892+ "dev": true,
1893+ "license": "MIT"
1894+ },
1895+ "node_modules/is-number": {
1896+ "version": "7.0.0",
1897+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
1898+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
1899+ "dev": true,
1900+ "license": "MIT",
1901+ "engines": {
1902+ "node": ">=0.12.0"
1903+ }
1904+ },
1905+ "node_modules/is-plain-obj": {
1906+ "version": "2.1.0",
1907+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
1908+ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
1909+ "dev": true,
1910+ "license": "MIT",
1911+ "engines": {
1912+ "node": ">=8"
1913+ }
1914+ },
1915+ "node_modules/is-stream": {
1916+ "version": "2.0.1",
1917+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
1918+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
1919+ "dev": true,
1920+ "license": "MIT",
1921+ "engines": {
1922+ "node": ">=8"
1923+ },
1924+ "funding": {
1925+ "url": "https://github.com/sponsors/sindresorhus"
1926+ }
1927+ },
1928+ "node_modules/is-wsl": {
1929+ "version": "3.1.0",
1930+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz",
1931+ "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==",
1932+ "dev": true,
1933+ "license": "MIT",
1934+ "dependencies": {
1935+ "is-inside-container": "^1.0.0"
1936+ },
1937+ "engines": {
1938+ "node": ">=16"
1939+ },
1940+ "funding": {
1941+ "url": "https://github.com/sponsors/sindresorhus"
1942+ }
1943+ },
1944+ "node_modules/isarray": {
1945+ "version": "1.0.0",
1946+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
1947+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
1948+ "dev": true,
1949+ "license": "MIT"
1950+ },
1951+ "node_modules/isexe": {
1952+ "version": "2.0.0",
1953+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
1954+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
1955+ "dev": true,
1956+ "license": "ISC"
1957+ },
1958+ "node_modules/jackspeak": {
1959+ "version": "4.1.1",
1960+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz",
1961+ "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==",
1962+ "dev": true,
1963+ "license": "BlueOak-1.0.0",
1964+ "dependencies": {
1965+ "@isaacs/cliui": "^8.0.2"
1966+ },
1967+ "engines": {
1968+ "node": "20 || >=22"
1969+ },
1970+ "funding": {
1971+ "url": "https://github.com/sponsors/isaacs"
1972+ }
1973+ },
1974+ "node_modules/jsonfile": {
1975+ "version": "6.2.0",
1976+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
1977+ "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
1978+ "dev": true,
1979+ "license": "MIT",
1980+ "dependencies": {
1981+ "universalify": "^2.0.0"
1982+ },
1983+ "optionalDependencies": {
1984+ "graceful-fs": "^4.1.6"
1985+ }
1986+ },
1987+ "node_modules/linkify-it": {
1988+ "version": "5.0.0",
1989+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
1990+ "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
1991+ "dev": true,
1992+ "license": "MIT",
1993+ "dependencies": {
1994+ "uc.micro": "^2.0.0"
1995+ }
1996+ },
1997+ "node_modules/log-symbols": {
1998+ "version": "3.0.0",
1999+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
2000+ "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==",
2001+ "dev": true,
2002+ "license": "MIT",
2003+ "dependencies": {
2004+ "chalk": "^2.4.2"
2005+ },
2006+ "engines": {
2007+ "node": ">=8"
2008+ }
2009+ },
2010+ "node_modules/log-update": {
2011+ "version": "4.0.0",
2012+ "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz",
2013+ "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==",
2014+ "dev": true,
2015+ "license": "MIT",
2016+ "dependencies": {
2017+ "ansi-escapes": "^4.3.0",
2018+ "cli-cursor": "^3.1.0",
2019+ "slice-ansi": "^4.0.0",
2020+ "wrap-ansi": "^6.2.0"
2021+ },
2022+ "engines": {
2023+ "node": ">=10"
2024+ },
2025+ "funding": {
2026+ "url": "https://github.com/sponsors/sindresorhus"
2027+ }
2028+ },
2029+ "node_modules/lru-cache": {
2030+ "version": "5.1.1",
2031+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
2032+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
2033+ "dev": true,
2034+ "license": "ISC",
2035+ "dependencies": {
2036+ "yallist": "^3.0.2"
2037+ }
2038+ },
2039+ "node_modules/make-fetch-happen": {
2040+ "version": "10.2.1",
2041+ "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz",
2042+ "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==",
2043+ "dev": true,
2044+ "license": "ISC",
2045+ "dependencies": {
2046+ "agentkeepalive": "^4.2.1",
2047+ "cacache": "^16.1.0",
2048+ "http-cache-semantics": "^4.1.0",
2049+ "http-proxy-agent": "^5.0.0",
2050+ "https-proxy-agent": "^5.0.0",
2051+ "is-lambda": "^1.0.1",
2052+ "lru-cache": "^7.7.1",
2053+ "minipass": "^3.1.6",
2054+ "minipass-collect": "^1.0.2",
2055+ "minipass-fetch": "^2.0.3",
2056+ "minipass-flush": "^1.0.5",
2057+ "minipass-pipeline": "^1.2.4",
2058+ "negotiator": "^0.6.3",
2059+ "promise-retry": "^2.0.1",
2060+ "socks-proxy-agent": "^7.0.0",
2061+ "ssri": "^9.0.0"
2062+ },
2063+ "engines": {
2064+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2065+ }
2066+ },
2067+ "node_modules/make-fetch-happen/node_modules/brace-expansion": {
2068+ "version": "2.0.2",
2069+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
2070+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
2071+ "dev": true,
2072+ "license": "MIT",
2073+ "dependencies": {
2074+ "balanced-match": "^1.0.0"
2075+ }
2076+ },
2077+ "node_modules/make-fetch-happen/node_modules/cacache": {
2078+ "version": "16.1.3",
2079+ "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz",
2080+ "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==",
2081+ "dev": true,
2082+ "license": "ISC",
2083+ "dependencies": {
2084+ "@npmcli/fs": "^2.1.0",
2085+ "@npmcli/move-file": "^2.0.0",
2086+ "chownr": "^2.0.0",
2087+ "fs-minipass": "^2.1.0",
2088+ "glob": "^8.0.1",
2089+ "infer-owner": "^1.0.4",
2090+ "lru-cache": "^7.7.1",
2091+ "minipass": "^3.1.6",
2092+ "minipass-collect": "^1.0.2",
2093+ "minipass-flush": "^1.0.5",
2094+ "minipass-pipeline": "^1.2.4",
2095+ "mkdirp": "^1.0.4",
2096+ "p-map": "^4.0.0",
2097+ "promise-inflight": "^1.0.1",
2098+ "rimraf": "^3.0.2",
2099+ "ssri": "^9.0.0",
2100+ "tar": "^6.1.11",
2101+ "unique-filename": "^2.0.0"
2102+ },
2103+ "engines": {
2104+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2105+ }
2106+ },
2107+ "node_modules/make-fetch-happen/node_modules/chownr": {
2108+ "version": "2.0.0",
2109+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
2110+ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
2111+ "dev": true,
2112+ "license": "ISC",
2113+ "engines": {
2114+ "node": ">=10"
2115+ }
2116+ },
2117+ "node_modules/make-fetch-happen/node_modules/glob": {
2118+ "version": "8.1.0",
2119+ "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
2120+ "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
2121+ "deprecated": "Glob versions prior to v9 are no longer supported",
2122+ "dev": true,
2123+ "license": "ISC",
2124+ "dependencies": {
2125+ "fs.realpath": "^1.0.0",
2126+ "inflight": "^1.0.4",
2127+ "inherits": "2",
2128+ "minimatch": "^5.0.1",
2129+ "once": "^1.3.0"
2130+ },
2131+ "engines": {
2132+ "node": ">=12"
2133+ },
2134+ "funding": {
2135+ "url": "https://github.com/sponsors/isaacs"
2136+ }
2137+ },
2138+ "node_modules/make-fetch-happen/node_modules/lru-cache": {
2139+ "version": "7.18.3",
2140+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
2141+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
2142+ "dev": true,
2143+ "license": "ISC",
2144+ "engines": {
2145+ "node": ">=12"
2146+ }
2147+ },
2148+ "node_modules/make-fetch-happen/node_modules/minimatch": {
2149+ "version": "5.1.6",
2150+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
2151+ "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
2152+ "dev": true,
2153+ "license": "ISC",
2154+ "dependencies": {
2155+ "brace-expansion": "^2.0.1"
2156+ },
2157+ "engines": {
2158+ "node": ">=10"
2159+ }
2160+ },
2161+ "node_modules/make-fetch-happen/node_modules/mkdirp": {
2162+ "version": "1.0.4",
2163+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
2164+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
2165+ "dev": true,
2166+ "license": "MIT",
2167+ "bin": {
2168+ "mkdirp": "bin/cmd.js"
2169+ },
2170+ "engines": {
2171+ "node": ">=10"
2172+ }
2173+ },
2174+ "node_modules/make-fetch-happen/node_modules/rimraf": {
2175+ "version": "3.0.2",
2176+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
2177+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
2178+ "deprecated": "Rimraf versions prior to v4 are no longer supported",
2179+ "dev": true,
2180+ "license": "ISC",
2181+ "dependencies": {
2182+ "glob": "^7.1.3"
2183+ },
2184+ "bin": {
2185+ "rimraf": "bin.js"
2186+ },
2187+ "funding": {
2188+ "url": "https://github.com/sponsors/isaacs"
2189+ }
2190+ },
2191+ "node_modules/make-fetch-happen/node_modules/rimraf/node_modules/brace-expansion": {
2192+ "version": "1.1.12",
2193+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
2194+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
2195+ "dev": true,
2196+ "license": "MIT",
2197+ "dependencies": {
2198+ "balanced-match": "^1.0.0",
2199+ "concat-map": "0.0.1"
2200+ }
2201+ },
2202+ "node_modules/make-fetch-happen/node_modules/rimraf/node_modules/glob": {
2203+ "version": "7.2.3",
2204+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
2205+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
2206+ "deprecated": "Glob versions prior to v9 are no longer supported",
2207+ "dev": true,
2208+ "license": "ISC",
2209+ "dependencies": {
2210+ "fs.realpath": "^1.0.0",
2211+ "inflight": "^1.0.4",
2212+ "inherits": "2",
2213+ "minimatch": "^3.1.1",
2214+ "once": "^1.3.0",
2215+ "path-is-absolute": "^1.0.0"
2216+ },
2217+ "engines": {
2218+ "node": "*"
2219+ },
2220+ "funding": {
2221+ "url": "https://github.com/sponsors/isaacs"
2222+ }
2223+ },
2224+ "node_modules/make-fetch-happen/node_modules/rimraf/node_modules/minimatch": {
2225+ "version": "3.1.2",
2226+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
2227+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
2228+ "dev": true,
2229+ "license": "ISC",
2230+ "dependencies": {
2231+ "brace-expansion": "^1.1.7"
2232+ },
2233+ "engines": {
2234+ "node": "*"
2235+ }
2236+ },
2237+ "node_modules/make-fetch-happen/node_modules/ssri": {
2238+ "version": "9.0.1",
2239+ "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz",
2240+ "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==",
2241+ "dev": true,
2242+ "license": "ISC",
2243+ "dependencies": {
2244+ "minipass": "^3.1.1"
2245+ },
2246+ "engines": {
2247+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2248+ }
2249+ },
2250+ "node_modules/make-fetch-happen/node_modules/unique-filename": {
2251+ "version": "2.0.1",
2252+ "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz",
2253+ "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==",
2254+ "dev": true,
2255+ "license": "ISC",
2256+ "dependencies": {
2257+ "unique-slug": "^3.0.0"
2258+ },
2259+ "engines": {
2260+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2261+ }
2262+ },
2263+ "node_modules/make-fetch-happen/node_modules/unique-slug": {
2264+ "version": "3.0.0",
2265+ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz",
2266+ "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==",
2267+ "dev": true,
2268+ "license": "ISC",
2269+ "dependencies": {
2270+ "imurmurhash": "^0.1.4"
2271+ },
2272+ "engines": {
2273+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2274+ }
2275+ },
2276+ "node_modules/markdown-it": {
2277+ "version": "14.1.0",
2278+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz",
2279+ "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==",
2280+ "dev": true,
2281+ "license": "MIT",
2282+ "dependencies": {
2283+ "argparse": "^2.0.1",
2284+ "entities": "^4.4.0",
2285+ "linkify-it": "^5.0.0",
2286+ "mdurl": "^2.0.0",
2287+ "punycode.js": "^2.3.1",
2288+ "uc.micro": "^2.1.0"
2289+ },
2290+ "bin": {
2291+ "markdown-it": "bin/markdown-it.mjs"
2292+ }
2293+ },
2294+ "node_modules/mdurl": {
2295+ "version": "2.0.0",
2296+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
2297+ "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==",
2298+ "dev": true,
2299+ "license": "MIT"
2300+ },
2301+ "node_modules/merge-stream": {
2302+ "version": "2.0.0",
2303+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
2304+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
2305+ "dev": true,
2306+ "license": "MIT"
2307+ },
2308+ "node_modules/micromatch": {
2309+ "version": "4.0.8",
2310+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
2311+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
2312+ "dev": true,
2313+ "license": "MIT",
2314+ "dependencies": {
2315+ "braces": "^3.0.3",
2316+ "picomatch": "^2.3.1"
2317+ },
2318+ "engines": {
2319+ "node": ">=8.6"
2320+ }
2321+ },
2322+ "node_modules/micromatch/node_modules/picomatch": {
2323+ "version": "2.3.1",
2324+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
2325+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
2326+ "dev": true,
2327+ "license": "MIT",
2328+ "engines": {
2329+ "node": ">=8.6"
2330+ },
2331+ "funding": {
2332+ "url": "https://github.com/sponsors/jonschlinkert"
2333+ }
2334+ },
2335+ "node_modules/mimic-fn": {
2336+ "version": "2.1.0",
2337+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
2338+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
2339+ "dev": true,
2340+ "license": "MIT",
2341+ "engines": {
2342+ "node": ">=6"
2343+ }
2344+ },
2345+ "node_modules/mimic-response": {
2346+ "version": "3.1.0",
2347+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
2348+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
2349+ "dev": true,
2350+ "license": "MIT",
2351+ "engines": {
2352+ "node": ">=10"
2353+ },
2354+ "funding": {
2355+ "url": "https://github.com/sponsors/sindresorhus"
2356+ }
2357+ },
2358+ "node_modules/minimatch": {
2359+ "version": "3.1.2",
2360+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
2361+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
2362+ "dev": true,
2363+ "license": "ISC",
2364+ "dependencies": {
2365+ "brace-expansion": "^1.1.7"
2366+ },
2367+ "engines": {
2368+ "node": "*"
2369+ }
2370+ },
2371+ "node_modules/minimist": {
2372+ "version": "1.2.8",
2373+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
2374+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
2375+ "dev": true,
2376+ "license": "MIT",
2377+ "funding": {
2378+ "url": "https://github.com/sponsors/ljharb"
2379+ }
2380+ },
2381+ "node_modules/minipass": {
2382+ "version": "3.3.6",
2383+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
2384+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
2385+ "dev": true,
2386+ "license": "ISC",
2387+ "dependencies": {
2388+ "yallist": "^4.0.0"
2389+ },
2390+ "engines": {
2391+ "node": ">=8"
2392+ }
2393+ },
2394+ "node_modules/minipass-collect": {
2395+ "version": "1.0.2",
2396+ "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz",
2397+ "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==",
2398+ "dev": true,
2399+ "license": "ISC",
2400+ "dependencies": {
2401+ "minipass": "^3.0.0"
2402+ },
2403+ "engines": {
2404+ "node": ">= 8"
2405+ }
2406+ },
2407+ "node_modules/minipass-fetch": {
2408+ "version": "2.1.2",
2409+ "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz",
2410+ "integrity": "sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==",
2411+ "dev": true,
2412+ "license": "MIT",
2413+ "dependencies": {
2414+ "minipass": "^3.1.6",
2415+ "minipass-sized": "^1.0.3",
2416+ "minizlib": "^2.1.2"
2417+ },
2418+ "engines": {
2419+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
2420+ },
2421+ "optionalDependencies": {
2422+ "encoding": "^0.1.13"
2423+ }
2424+ },
2425+ "node_modules/minipass-flush": {
2426+ "version": "1.0.5",
2427+ "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz",
2428+ "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==",
2429+ "dev": true,
2430+ "license": "ISC",
2431+ "dependencies": {
2432+ "minipass": "^3.0.0"
2433+ },
2434+ "engines": {
2435+ "node": ">= 8"
2436+ }
2437+ },
2438+ "node_modules/minipass-pipeline": {
2439+ "version": "1.2.4",
2440+ "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz",
2441+ "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==",
2442+ "dev": true,
2443+ "license": "ISC",
2444+ "dependencies": {
2445+ "minipass": "^3.0.0"
2446+ },
2447+ "engines": {
2448+ "node": ">=8"
2449+ }
2450+ },
2451+ "node_modules/minipass-sized": {
2452+ "version": "1.0.3",
2453+ "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz",
2454+ "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==",
2455+ "dev": true,
2456+ "license": "ISC",
2457+ "dependencies": {
2458+ "minipass": "^3.0.0"
2459+ },
2460+ "engines": {
2461+ "node": ">=8"
2462+ }
2463+ },
2464+ "node_modules/minipass/node_modules/yallist": {
2465+ "version": "4.0.0",
2466+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
2467+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
2468+ "dev": true,
2469+ "license": "ISC"
2470+ },
2471+ "node_modules/minizlib": {
2472+ "version": "2.1.2",
2473+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
2474+ "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
2475+ "dev": true,
2476+ "license": "MIT",
2477+ "dependencies": {
2478+ "minipass": "^3.0.0",
2479+ "yallist": "^4.0.0"
2480+ },
2481+ "engines": {
2482+ "node": ">= 8"
2483+ }
2484+ },
2485+ "node_modules/minizlib/node_modules/yallist": {
2486+ "version": "4.0.0",
2487+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
2488+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
2489+ "dev": true,
2490+ "license": "ISC"
2491+ },
2492+ "node_modules/mississippi": {
2493+ "version": "3.0.0",
2494+ "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
2495+ "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
2496+ "dev": true,
2497+ "license": "BSD-2-Clause",
2498+ "dependencies": {
2499+ "concat-stream": "^1.5.0",
2500+ "duplexify": "^3.4.2",
2501+ "end-of-stream": "^1.1.0",
2502+ "flush-write-stream": "^1.0.0",
2503+ "from2": "^2.1.0",
2504+ "parallel-transform": "^1.1.0",
2505+ "pump": "^3.0.0",
2506+ "pumpify": "^1.3.3",
2507+ "stream-each": "^1.1.0",
2508+ "through2": "^2.0.0"
2509+ },
2510+ "engines": {
2511+ "node": ">=4.0.0"
2512+ }
2513+ },
2514+ "node_modules/mkdirp": {
2515+ "version": "0.5.6",
2516+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
2517+ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
2518+ "dev": true,
2519+ "license": "MIT",
2520+ "dependencies": {
2521+ "minimist": "^1.2.6"
2522+ },
2523+ "bin": {
2524+ "mkdirp": "bin/cmd.js"
2525+ }
2526+ },
2527+ "node_modules/mkdirp-classic": {
2528+ "version": "0.5.3",
2529+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
2530+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
2531+ "dev": true,
2532+ "license": "MIT"
2533+ },
2534+ "node_modules/move-concurrently": {
2535+ "version": "1.0.1",
2536+ "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
2537+ "integrity": "sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==",
2538+ "deprecated": "This package is no longer supported.",
2539+ "dev": true,
2540+ "license": "ISC",
2541+ "dependencies": {
2542+ "aproba": "^1.1.1",
2543+ "copy-concurrently": "^1.0.0",
2544+ "fs-write-stream-atomic": "^1.0.8",
2545+ "mkdirp": "^0.5.1",
2546+ "rimraf": "^2.5.4",
2547+ "run-queue": "^1.0.3"
2548+ }
2549+ },
2550+ "node_modules/ms": {
2551+ "version": "2.1.3",
2552+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
2553+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
2554+ "dev": true,
2555+ "license": "MIT"
2556+ },
2557+ "node_modules/nan": {
2558+ "version": "2.24.0",
2559+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.24.0.tgz",
2560+ "integrity": "sha512-Vpf9qnVW1RaDkoNKFUvfxqAbtI8ncb8OJlqZ9wwpXzWPEsvsB1nvdUi6oYrHIkQ1Y/tMDnr1h4nczS0VB9Xykg==",
2561+ "dev": true,
2562+ "license": "MIT",
2563+ "optional": true
2564+ },
2565+ "node_modules/napi-build-utils": {
2566+ "version": "2.0.0",
2567+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz",
2568+ "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==",
2569+ "dev": true,
2570+ "license": "MIT"
2571+ },
2572+ "node_modules/negotiator": {
2573+ "version": "0.6.4",
2574+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz",
2575+ "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==",
2576+ "dev": true,
2577+ "license": "MIT",
2578+ "engines": {
2579+ "node": ">= 0.6"
2580+ }
2581+ },
2582+ "node_modules/node-abi": {
2583+ "version": "3.85.0",
2584+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.85.0.tgz",
2585+ "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==",
2586+ "dev": true,
2587+ "license": "MIT",
2588+ "dependencies": {
2589+ "semver": "^7.3.5"
2590+ },
2591+ "engines": {
2592+ "node": ">=10"
2593+ }
2594+ },
2595+ "node_modules/npm-run-path": {
2596+ "version": "3.1.0",
2597+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",
2598+ "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",
2599+ "dev": true,
2600+ "license": "MIT",
2601+ "dependencies": {
2602+ "path-key": "^3.0.0"
2603+ },
2604+ "engines": {
2605+ "node": ">=8"
2606+ }
2607+ },
2608+ "node_modules/once": {
2609+ "version": "1.4.0",
2610+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
2611+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
2612+ "dev": true,
2613+ "license": "ISC",
2614+ "dependencies": {
2615+ "wrappy": "1"
2616+ }
2617+ },
2618+ "node_modules/onetime": {
2619+ "version": "5.1.2",
2620+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
2621+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
2622+ "dev": true,
2623+ "license": "MIT",
2624+ "dependencies": {
2625+ "mimic-fn": "^2.1.0"
2626+ },
2627+ "engines": {
2628+ "node": ">=6"
2629+ },
2630+ "funding": {
2631+ "url": "https://github.com/sponsors/sindresorhus"
2632+ }
2633+ },
2634+ "node_modules/open": {
2635+ "version": "10.2.0",
2636+ "resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz",
2637+ "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==",
2638+ "dev": true,
2639+ "license": "MIT",
2640+ "dependencies": {
2641+ "default-browser": "^5.2.1",
2642+ "define-lazy-prop": "^3.0.0",
2643+ "is-inside-container": "^1.0.0",
2644+ "wsl-utils": "^0.1.0"
2645+ },
2646+ "engines": {
2647+ "node": ">=18"
2648+ },
2649+ "funding": {
2650+ "url": "https://github.com/sponsors/sindresorhus"
2651+ }
2652+ },
2653+ "node_modules/p-finally": {
2654+ "version": "2.0.1",
2655+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz",
2656+ "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==",
2657+ "dev": true,
2658+ "license": "MIT",
2659+ "engines": {
2660+ "node": ">=8"
2661+ }
2662+ },
2663+ "node_modules/p-map": {
2664+ "version": "4.0.0",
2665+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
2666+ "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
2667+ "dev": true,
2668+ "license": "MIT",
2669+ "dependencies": {
2670+ "aggregate-error": "^3.0.0"
2671+ },
2672+ "engines": {
2673+ "node": ">=10"
2674+ },
2675+ "funding": {
2676+ "url": "https://github.com/sponsors/sindresorhus"
2677+ }
2678+ },
2679+ "node_modules/package-json-from-dist": {
2680+ "version": "1.0.1",
2681+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
2682+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
2683+ "dev": true,
2684+ "license": "BlueOak-1.0.0"
2685+ },
2686+ "node_modules/parallel-transform": {
2687+ "version": "1.2.0",
2688+ "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz",
2689+ "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==",
2690+ "dev": true,
2691+ "license": "MIT",
2692+ "dependencies": {
2693+ "cyclist": "^1.0.1",
2694+ "inherits": "^2.0.3",
2695+ "readable-stream": "^2.1.5"
2696+ }
2697+ },
2698+ "node_modules/path-is-absolute": {
2699+ "version": "1.0.1",
2700+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
2701+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
2702+ "dev": true,
2703+ "license": "MIT",
2704+ "engines": {
2705+ "node": ">=0.10.0"
2706+ }
2707+ },
2708+ "node_modules/path-key": {
2709+ "version": "3.1.1",
2710+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
2711+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
2712+ "dev": true,
2713+ "license": "MIT",
2714+ "engines": {
2715+ "node": ">=8"
2716+ }
2717+ },
2718+ "node_modules/path-scurry": {
2719+ "version": "2.0.1",
2720+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz",
2721+ "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==",
2722+ "dev": true,
2723+ "license": "BlueOak-1.0.0",
2724+ "dependencies": {
2725+ "lru-cache": "^11.0.0",
2726+ "minipass": "^7.1.2"
2727+ },
2728+ "engines": {
2729+ "node": "20 || >=22"
2730+ },
2731+ "funding": {
2732+ "url": "https://github.com/sponsors/isaacs"
2733+ }
2734+ },
2735+ "node_modules/path-scurry/node_modules/lru-cache": {
2736+ "version": "11.2.4",
2737+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.4.tgz",
2738+ "integrity": "sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==",
2739+ "dev": true,
2740+ "license": "BlueOak-1.0.0",
2741+ "engines": {
2742+ "node": "20 || >=22"
2743+ }
2744+ },
2745+ "node_modules/path-scurry/node_modules/minipass": {
2746+ "version": "7.1.2",
2747+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
2748+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
2749+ "dev": true,
2750+ "license": "ISC",
2751+ "engines": {
2752+ "node": ">=16 || 14 >=14.17"
2753+ }
2754+ },
2755+ "node_modules/picomatch": {
2756+ "version": "4.0.3",
2757+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
2758+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
2759+ "dev": true,
2760+ "license": "MIT",
2761+ "engines": {
2762+ "node": ">=12"
2763+ },
2764+ "funding": {
2765+ "url": "https://github.com/sponsors/jonschlinkert"
2766+ }
2767+ },
2768+ "node_modules/prebuild-install": {
2769+ "version": "7.1.3",
2770+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",
2771+ "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==",
2772+ "dev": true,
2773+ "license": "MIT",
2774+ "dependencies": {
2775+ "detect-libc": "^2.0.0",
2776+ "expand-template": "^2.0.3",
2777+ "github-from-package": "0.0.0",
2778+ "minimist": "^1.2.3",
2779+ "mkdirp-classic": "^0.5.3",
2780+ "napi-build-utils": "^2.0.0",
2781+ "node-abi": "^3.3.0",
2782+ "pump": "^3.0.0",
2783+ "rc": "^1.2.7",
2784+ "simple-get": "^4.0.0",
2785+ "tar-fs": "^2.0.0",
2786+ "tunnel-agent": "^0.6.0"
2787+ },
2788+ "bin": {
2789+ "prebuild-install": "bin.js"
2790+ },
2791+ "engines": {
2792+ "node": ">=10"
2793+ }
2794+ },
2795+ "node_modules/process-nextick-args": {
2796+ "version": "2.0.1",
2797+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
2798+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
2799+ "dev": true,
2800+ "license": "MIT"
2801+ },
2802+ "node_modules/promise-inflight": {
2803+ "version": "1.0.1",
2804+ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
2805+ "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==",
2806+ "dev": true,
2807+ "license": "ISC"
2808+ },
2809+ "node_modules/promise-retry": {
2810+ "version": "2.0.1",
2811+ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
2812+ "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",
2813+ "dev": true,
2814+ "license": "MIT",
2815+ "dependencies": {
2816+ "err-code": "^2.0.2",
2817+ "retry": "^0.12.0"
2818+ },
2819+ "engines": {
2820+ "node": ">=10"
2821+ }
2822+ },
2823+ "node_modules/pump": {
2824+ "version": "3.0.3",
2825+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
2826+ "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
2827+ "dev": true,
2828+ "license": "MIT",
2829+ "dependencies": {
2830+ "end-of-stream": "^1.1.0",
2831+ "once": "^1.3.1"
2832+ }
2833+ },
2834+ "node_modules/pumpify": {
2835+ "version": "1.5.1",
2836+ "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
2837+ "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
2838+ "dev": true,
2839+ "license": "MIT",
2840+ "dependencies": {
2841+ "duplexify": "^3.6.0",
2842+ "inherits": "^2.0.3",
2843+ "pump": "^2.0.0"
2844+ }
2845+ },
2846+ "node_modules/pumpify/node_modules/pump": {
2847+ "version": "2.0.1",
2848+ "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
2849+ "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
2850+ "dev": true,
2851+ "license": "MIT",
2852+ "dependencies": {
2853+ "end-of-stream": "^1.1.0",
2854+ "once": "^1.3.1"
2855+ }
2856+ },
2857+ "node_modules/punycode": {
2858+ "version": "2.3.1",
2859+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
2860+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
2861+ "dev": true,
2862+ "license": "MIT",
2863+ "engines": {
2864+ "node": ">=6"
2865+ }
2866+ },
2867+ "node_modules/punycode.js": {
2868+ "version": "2.3.1",
2869+ "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz",
2870+ "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==",
2871+ "dev": true,
2872+ "license": "MIT",
2873+ "engines": {
2874+ "node": ">=6"
2875+ }
2876+ },
2877+ "node_modules/purescript": {
2878+ "version": "0.15.15",
2879+ "resolved": "https://registry.npmjs.org/purescript/-/purescript-0.15.15.tgz",
2880+ "integrity": "sha512-4gwLNJa4KRiV+Wl+lyMY4MUFM6cSnIqvz7MvSTdLdvXJN2P9CrABnNbSspaokkNRFd9soWHBFDlYsAtRchqHtg==",
2881+ "dev": true,
2882+ "hasInstallScript": true,
2883+ "license": "ISC",
2884+ "dependencies": {
2885+ "purescript-installer": "^0.3.5"
2886+ },
2887+ "bin": {
2888+ "purs": "purs.bin"
2889+ }
2890+ },
2891+ "node_modules/purescript-installer": {
2892+ "version": "0.3.5",
2893+ "resolved": "https://registry.npmjs.org/purescript-installer/-/purescript-installer-0.3.5.tgz",
2894+ "integrity": "sha512-w04BBvW4BSQlspLsZ9Bs5vtUBZqvC4bC+FizC5GUp2/rpmYvXJ0CTf79Q3MKo2A8p1ZjqbhCI+SqdTQ30UZUIQ==",
2895+ "dev": true,
2896+ "license": "ISC",
2897+ "dependencies": {
2898+ "byline": "^5.0.0",
2899+ "cacache": "^11.3.2",
2900+ "chalk": "^2.4.2",
2901+ "env-paths": "^2.2.0",
2902+ "execa": "^2.0.3",
2903+ "filesize": "^4.1.2",
2904+ "is-plain-obj": "^2.0.0",
2905+ "log-symbols": "^3.0.0",
2906+ "log-update": "^4.0.0",
2907+ "make-fetch-happen": "^10.0.0",
2908+ "minimist": "^1.2.0",
2909+ "ms": "^2.1.2",
2910+ "once": "^1.4.0",
2911+ "rimraf": "^2.6.3",
2912+ "semver": "^7.3.7",
2913+ "tar": "^6.1.11",
2914+ "which": "^1.3.1",
2915+ "zen-observable": "^0.8.14"
2916+ },
2917+ "bin": {
2918+ "install-purescript": "index.js"
2919+ },
2920+ "engines": {
2921+ "node": ">=12"
2922+ }
2923+ },
2924+ "node_modules/purs-tidy": {
2925+ "version": "0.11.1",
2926+ "resolved": "https://registry.npmjs.org/purs-tidy/-/purs-tidy-0.11.1.tgz",
2927+ "integrity": "sha512-5EAktcnu0mHuftnrpk1Iy7NiqKhxvE74HQRZB43i24Wabs/XclFvHSSE+amxmTr4QM/mcGx2B7ZyRprijnWqDg==",
2928+ "dev": true,
2929+ "license": "MIT",
2930+ "bin": {
2931+ "purs-tidy": "bin/index.js"
2932+ }
2933+ },
2934+ "node_modules/queue-microtask": {
2935+ "version": "1.2.3",
2936+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
2937+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
2938+ "dev": true,
2939+ "funding": [
2940+ {
2941+ "type": "github",
2942+ "url": "https://github.com/sponsors/feross"
2943+ },
2944+ {
2945+ "type": "patreon",
2946+ "url": "https://www.patreon.com/feross"
2947+ },
2948+ {
2949+ "type": "consulting",
2950+ "url": "https://feross.org/support"
2951+ }
2952+ ],
2953+ "license": "MIT"
2954+ },
2955+ "node_modules/rc": {
2956+ "version": "1.2.8",
2957+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
2958+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
2959+ "dev": true,
2960+ "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
2961+ "dependencies": {
2962+ "deep-extend": "^0.6.0",
2963+ "ini": "~1.3.0",
2964+ "minimist": "^1.2.0",
2965+ "strip-json-comments": "~2.0.1"
2966+ },
2967+ "bin": {
2968+ "rc": "cli.js"
2969+ }
2970+ },
2971+ "node_modules/readable-stream": {
2972+ "version": "2.3.8",
2973+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
2974+ "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
2975+ "dev": true,
2976+ "license": "MIT",
2977+ "dependencies": {
2978+ "core-util-is": "~1.0.0",
2979+ "inherits": "~2.0.3",
2980+ "isarray": "~1.0.0",
2981+ "process-nextick-args": "~2.0.0",
2982+ "safe-buffer": "~5.1.1",
2983+ "string_decoder": "~1.1.1",
2984+ "util-deprecate": "~1.0.1"
2985+ }
2986+ },
2987+ "node_modules/readline-sync": {
2988+ "version": "1.4.10",
2989+ "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz",
2990+ "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==",
2991+ "dev": true,
2992+ "license": "MIT",
2993+ "engines": {
2994+ "node": ">= 0.8.0"
2995+ }
2996+ },
2997+ "node_modules/restore-cursor": {
2998+ "version": "3.1.0",
2999+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
3000+ "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
3001+ "dev": true,
3002+ "license": "MIT",
3003+ "dependencies": {
3004+ "onetime": "^5.1.0",
3005+ "signal-exit": "^3.0.2"
3006+ },
3007+ "engines": {
3008+ "node": ">=8"
3009+ }
3010+ },
3011+ "node_modules/retry": {
3012+ "version": "0.12.0",
3013+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
3014+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
3015+ "dev": true,
3016+ "license": "MIT",
3017+ "engines": {
3018+ "node": ">= 4"
3019+ }
3020+ },
3021+ "node_modules/reusify": {
3022+ "version": "1.1.0",
3023+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
3024+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
3025+ "dev": true,
3026+ "license": "MIT",
3027+ "engines": {
3028+ "iojs": ">=1.0.0",
3029+ "node": ">=0.10.0"
3030+ }
3031+ },
3032+ "node_modules/rimraf": {
3033+ "version": "2.7.1",
3034+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
3035+ "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
3036+ "deprecated": "Rimraf versions prior to v4 are no longer supported",
3037+ "dev": true,
3038+ "license": "ISC",
3039+ "dependencies": {
3040+ "glob": "^7.1.3"
3041+ },
3042+ "bin": {
3043+ "rimraf": "bin.js"
3044+ }
3045+ },
3046+ "node_modules/run-applescript": {
3047+ "version": "7.1.0",
3048+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
3049+ "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
3050+ "dev": true,
3051+ "license": "MIT",
3052+ "engines": {
3053+ "node": ">=18"
3054+ },
3055+ "funding": {
3056+ "url": "https://github.com/sponsors/sindresorhus"
3057+ }
3058+ },
3059+ "node_modules/run-parallel": {
3060+ "version": "1.2.0",
3061+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
3062+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
3063+ "dev": true,
3064+ "funding": [
3065+ {
3066+ "type": "github",
3067+ "url": "https://github.com/sponsors/feross"
3068+ },
3069+ {
3070+ "type": "patreon",
3071+ "url": "https://www.patreon.com/feross"
3072+ },
3073+ {
3074+ "type": "consulting",
3075+ "url": "https://feross.org/support"
3076+ }
3077+ ],
3078+ "license": "MIT",
3079+ "dependencies": {
3080+ "queue-microtask": "^1.2.2"
3081+ }
3082+ },
3083+ "node_modules/run-queue": {
3084+ "version": "1.0.3",
3085+ "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz",
3086+ "integrity": "sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg==",
3087+ "dev": true,
3088+ "license": "ISC",
3089+ "dependencies": {
3090+ "aproba": "^1.1.1"
3091+ }
3092+ },
3093+ "node_modules/safe-buffer": {
3094+ "version": "5.1.2",
3095+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
3096+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
3097+ "dev": true,
3098+ "license": "MIT"
3099+ },
3100+ "node_modules/safer-buffer": {
3101+ "version": "2.1.2",
3102+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
3103+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
3104+ "dev": true,
3105+ "license": "MIT"
3106+ },
3107+ "node_modules/semver": {
3108+ "version": "7.7.3",
3109+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
3110+ "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
3111+ "dev": true,
3112+ "license": "ISC",
3113+ "bin": {
3114+ "semver": "bin/semver.js"
3115+ },
3116+ "engines": {
3117+ "node": ">=10"
3118+ }
3119+ },
3120+ "node_modules/shebang-command": {
3121+ "version": "2.0.0",
3122+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
3123+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
3124+ "dev": true,
3125+ "license": "MIT",
3126+ "dependencies": {
3127+ "shebang-regex": "^3.0.0"
3128+ },
3129+ "engines": {
3130+ "node": ">=8"
3131+ }
3132+ },
3133+ "node_modules/shebang-regex": {
3134+ "version": "3.0.0",
3135+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
3136+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
3137+ "dev": true,
3138+ "license": "MIT",
3139+ "engines": {
3140+ "node": ">=8"
3141+ }
3142+ },
3143+ "node_modules/signal-exit": {
3144+ "version": "3.0.7",
3145+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
3146+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
3147+ "dev": true,
3148+ "license": "ISC"
3149+ },
3150+ "node_modules/simple-concat": {
3151+ "version": "1.0.1",
3152+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
3153+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
3154+ "dev": true,
3155+ "funding": [
3156+ {
3157+ "type": "github",
3158+ "url": "https://github.com/sponsors/feross"
3159+ },
3160+ {
3161+ "type": "patreon",
3162+ "url": "https://www.patreon.com/feross"
3163+ },
3164+ {
3165+ "type": "consulting",
3166+ "url": "https://feross.org/support"
3167+ }
3168+ ],
3169+ "license": "MIT"
3170+ },
3171+ "node_modules/simple-get": {
3172+ "version": "4.0.1",
3173+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
3174+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
3175+ "dev": true,
3176+ "funding": [
3177+ {
3178+ "type": "github",
3179+ "url": "https://github.com/sponsors/feross"
3180+ },
3181+ {
3182+ "type": "patreon",
3183+ "url": "https://www.patreon.com/feross"
3184+ },
3185+ {
3186+ "type": "consulting",
3187+ "url": "https://feross.org/support"
3188+ }
3189+ ],
3190+ "license": "MIT",
3191+ "dependencies": {
3192+ "decompress-response": "^6.0.0",
3193+ "once": "^1.3.1",
3194+ "simple-concat": "^1.0.0"
3195+ }
3196+ },
3197+ "node_modules/slice-ansi": {
3198+ "version": "4.0.0",
3199+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz",
3200+ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==",
3201+ "dev": true,
3202+ "license": "MIT",
3203+ "dependencies": {
3204+ "ansi-styles": "^4.0.0",
3205+ "astral-regex": "^2.0.0",
3206+ "is-fullwidth-code-point": "^3.0.0"
3207+ },
3208+ "engines": {
3209+ "node": ">=10"
3210+ },
3211+ "funding": {
3212+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"
3213+ }
3214+ },
3215+ "node_modules/slice-ansi/node_modules/ansi-styles": {
3216+ "version": "4.3.0",
3217+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
3218+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
3219+ "dev": true,
3220+ "license": "MIT",
3221+ "dependencies": {
3222+ "color-convert": "^2.0.1"
3223+ },
3224+ "engines": {
3225+ "node": ">=8"
3226+ },
3227+ "funding": {
3228+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
3229+ }
3230+ },
3231+ "node_modules/slice-ansi/node_modules/color-convert": {
3232+ "version": "2.0.1",
3233+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
3234+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
3235+ "dev": true,
3236+ "license": "MIT",
3237+ "dependencies": {
3238+ "color-name": "~1.1.4"
3239+ },
3240+ "engines": {
3241+ "node": ">=7.0.0"
3242+ }
3243+ },
3244+ "node_modules/slice-ansi/node_modules/color-name": {
3245+ "version": "1.1.4",
3246+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
3247+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
3248+ "dev": true,
3249+ "license": "MIT"
3250+ },
3251+ "node_modules/smart-buffer": {
3252+ "version": "4.2.0",
3253+ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
3254+ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
3255+ "dev": true,
3256+ "license": "MIT",
3257+ "engines": {
3258+ "node": ">= 6.0.0",
3259+ "npm": ">= 3.0.0"
3260+ }
3261+ },
3262+ "node_modules/socks": {
3263+ "version": "2.8.7",
3264+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",
3265+ "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",
3266+ "dev": true,
3267+ "license": "MIT",
3268+ "dependencies": {
3269+ "ip-address": "^10.0.1",
3270+ "smart-buffer": "^4.2.0"
3271+ },
3272+ "engines": {
3273+ "node": ">= 10.0.0",
3274+ "npm": ">= 3.0.0"
3275+ }
3276+ },
3277+ "node_modules/socks-proxy-agent": {
3278+ "version": "7.0.0",
3279+ "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz",
3280+ "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==",
3281+ "dev": true,
3282+ "license": "MIT",
3283+ "dependencies": {
3284+ "agent-base": "^6.0.2",
3285+ "debug": "^4.3.3",
3286+ "socks": "^2.6.2"
3287+ },
3288+ "engines": {
3289+ "node": ">= 10"
3290+ }
3291+ },
3292+ "node_modules/spago": {
3293+ "version": "0.93.45",
3294+ "resolved": "https://registry.npmjs.org/spago/-/spago-0.93.45.tgz",
3295+ "integrity": "sha512-t9h4etkmwZVlZ0eQeLQbNbcJlNSjZC9+xTmjcUykQ6+Hq5g4tMH5GKEoObtDiU+me+tujFzQA/W+DyCa2L98wQ==",
3296+ "dev": true,
3297+ "license": "BSD-3-Clause",
3298+ "dependencies": {
3299+ "@nodelib/fs.walk": "^3.0.1",
3300+ "better-sqlite3": "^12.5.0",
3301+ "env-paths": "^3.0.0",
3302+ "fs-extra": "^11.3.0",
3303+ "fuse.js": "^7.1.0",
3304+ "glob": "^11.0.1",
3305+ "markdown-it": "^14.1.0",
3306+ "micromatch": "^4.0.8",
3307+ "open": "^10.1.0",
3308+ "picomatch": "^4.0.2",
3309+ "punycode": "^2.3.1",
3310+ "readline-sync": "^1.4.10",
3311+ "semver": "^7.7.1",
3312+ "spdx-expression-parse": "^4.0.0",
3313+ "ssh2": "^1.16.0",
3314+ "supports-color": "^10.0.0",
3315+ "tar": "^7.4.3",
3316+ "tmp": "^0.2.3",
3317+ "xhr2": "^0.2.1",
3318+ "yaml": "^2.7.0"
3319+ },
3320+ "bin": {
3321+ "spago": "bin/bundle.js"
3322+ }
3323+ },
3324+ "node_modules/spago/node_modules/chownr": {
3325+ "version": "3.0.0",
3326+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
3327+ "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
3328+ "dev": true,
3329+ "license": "BlueOak-1.0.0",
3330+ "engines": {
3331+ "node": ">=18"
3332+ }
3333+ },
3334+ "node_modules/spago/node_modules/env-paths": {
3335+ "version": "3.0.0",
3336+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz",
3337+ "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==",
3338+ "dev": true,
3339+ "license": "MIT",
3340+ "engines": {
3341+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
3342+ },
3343+ "funding": {
3344+ "url": "https://github.com/sponsors/sindresorhus"
3345+ }
3346+ },
3347+ "node_modules/spago/node_modules/glob": {
3348+ "version": "11.1.0",
3349+ "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz",
3350+ "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==",
3351+ "dev": true,
3352+ "license": "BlueOak-1.0.0",
3353+ "dependencies": {
3354+ "foreground-child": "^3.3.1",
3355+ "jackspeak": "^4.1.1",
3356+ "minimatch": "^10.1.1",
3357+ "minipass": "^7.1.2",
3358+ "package-json-from-dist": "^1.0.0",
3359+ "path-scurry": "^2.0.0"
3360+ },
3361+ "bin": {
3362+ "glob": "dist/esm/bin.mjs"
3363+ },
3364+ "engines": {
3365+ "node": "20 || >=22"
3366+ },
3367+ "funding": {
3368+ "url": "https://github.com/sponsors/isaacs"
3369+ }
3370+ },
3371+ "node_modules/spago/node_modules/minimatch": {
3372+ "version": "10.1.1",
3373+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz",
3374+ "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==",
3375+ "dev": true,
3376+ "license": "BlueOak-1.0.0",
3377+ "dependencies": {
3378+ "@isaacs/brace-expansion": "^5.0.0"
3379+ },
3380+ "engines": {
3381+ "node": "20 || >=22"
3382+ },
3383+ "funding": {
3384+ "url": "https://github.com/sponsors/isaacs"
3385+ }
3386+ },
3387+ "node_modules/spago/node_modules/minipass": {
3388+ "version": "7.1.2",
3389+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
3390+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
3391+ "dev": true,
3392+ "license": "ISC",
3393+ "engines": {
3394+ "node": ">=16 || 14 >=14.17"
3395+ }
3396+ },
3397+ "node_modules/spago/node_modules/minizlib": {
3398+ "version": "3.1.0",
3399+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",
3400+ "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==",
3401+ "dev": true,
3402+ "license": "MIT",
3403+ "dependencies": {
3404+ "minipass": "^7.1.2"
3405+ },
3406+ "engines": {
3407+ "node": ">= 18"
3408+ }
3409+ },
3410+ "node_modules/spago/node_modules/supports-color": {
3411+ "version": "10.2.2",
3412+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
3413+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
3414+ "dev": true,
3415+ "license": "MIT",
3416+ "engines": {
3417+ "node": ">=18"
3418+ },
3419+ "funding": {
3420+ "url": "https://github.com/chalk/supports-color?sponsor=1"
3421+ }
3422+ },
3423+ "node_modules/spago/node_modules/tar": {
3424+ "version": "7.5.2",
3425+ "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.2.tgz",
3426+ "integrity": "sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==",
3427+ "dev": true,
3428+ "license": "BlueOak-1.0.0",
3429+ "dependencies": {
3430+ "@isaacs/fs-minipass": "^4.0.0",
3431+ "chownr": "^3.0.0",
3432+ "minipass": "^7.1.2",
3433+ "minizlib": "^3.1.0",
3434+ "yallist": "^5.0.0"
3435+ },
3436+ "engines": {
3437+ "node": ">=18"
3438+ }
3439+ },
3440+ "node_modules/spago/node_modules/yallist": {
3441+ "version": "5.0.0",
3442+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
3443+ "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
3444+ "dev": true,
3445+ "license": "BlueOak-1.0.0",
3446+ "engines": {
3447+ "node": ">=18"
3448+ }
3449+ },
3450+ "node_modules/spdx-exceptions": {
3451+ "version": "2.5.0",
3452+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz",
3453+ "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==",
3454+ "dev": true,
3455+ "license": "CC-BY-3.0"
3456+ },
3457+ "node_modules/spdx-expression-parse": {
3458+ "version": "4.0.0",
3459+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz",
3460+ "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==",
3461+ "dev": true,
3462+ "license": "MIT",
3463+ "dependencies": {
3464+ "spdx-exceptions": "^2.1.0",
3465+ "spdx-license-ids": "^3.0.0"
3466+ }
3467+ },
3468+ "node_modules/spdx-license-ids": {
3469+ "version": "3.0.22",
3470+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz",
3471+ "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==",
3472+ "dev": true,
3473+ "license": "CC0-1.0"
3474+ },
3475+ "node_modules/ssh2": {
3476+ "version": "1.17.0",
3477+ "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.17.0.tgz",
3478+ "integrity": "sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==",
3479+ "dev": true,
3480+ "hasInstallScript": true,
3481+ "dependencies": {
3482+ "asn1": "^0.2.6",
3483+ "bcrypt-pbkdf": "^1.0.2"
3484+ },
3485+ "engines": {
3486+ "node": ">=10.16.0"
3487+ },
3488+ "optionalDependencies": {
3489+ "cpu-features": "~0.0.10",
3490+ "nan": "^2.23.0"
3491+ }
3492+ },
3493+ "node_modules/ssri": {
3494+ "version": "6.0.2",
3495+ "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
3496+ "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
3497+ "dev": true,
3498+ "license": "ISC",
3499+ "dependencies": {
3500+ "figgy-pudding": "^3.5.1"
3501+ }
3502+ },
3503+ "node_modules/stream-each": {
3504+ "version": "1.2.3",
3505+ "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
3506+ "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==",
3507+ "dev": true,
3508+ "license": "MIT",
3509+ "dependencies": {
3510+ "end-of-stream": "^1.1.0",
3511+ "stream-shift": "^1.0.0"
3512+ }
3513+ },
3514+ "node_modules/stream-shift": {
3515+ "version": "1.0.3",
3516+ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz",
3517+ "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==",
3518+ "dev": true,
3519+ "license": "MIT"
3520+ },
3521+ "node_modules/string_decoder": {
3522+ "version": "1.1.1",
3523+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
3524+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
3525+ "dev": true,
3526+ "license": "MIT",
3527+ "dependencies": {
3528+ "safe-buffer": "~5.1.0"
3529+ }
3530+ },
3531+ "node_modules/string-width": {
3532+ "version": "4.2.3",
3533+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
3534+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
3535+ "dev": true,
3536+ "license": "MIT",
3537+ "dependencies": {
3538+ "emoji-regex": "^8.0.0",
3539+ "is-fullwidth-code-point": "^3.0.0",
3540+ "strip-ansi": "^6.0.1"
3541+ },
3542+ "engines": {
3543+ "node": ">=8"
3544+ }
3545+ },
3546+ "node_modules/string-width-cjs": {
3547+ "name": "string-width",
3548+ "version": "4.2.3",
3549+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
3550+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
3551+ "dev": true,
3552+ "license": "MIT",
3553+ "dependencies": {
3554+ "emoji-regex": "^8.0.0",
3555+ "is-fullwidth-code-point": "^3.0.0",
3556+ "strip-ansi": "^6.0.1"
3557+ },
3558+ "engines": {
3559+ "node": ">=8"
3560+ }
3561+ },
3562+ "node_modules/strip-ansi": {
3563+ "version": "6.0.1",
3564+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
3565+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
3566+ "dev": true,
3567+ "license": "MIT",
3568+ "dependencies": {
3569+ "ansi-regex": "^5.0.1"
3570+ },
3571+ "engines": {
3572+ "node": ">=8"
3573+ }
3574+ },
3575+ "node_modules/strip-ansi-cjs": {
3576+ "name": "strip-ansi",
3577+ "version": "6.0.1",
3578+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
3579+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
3580+ "dev": true,
3581+ "license": "MIT",
3582+ "dependencies": {
3583+ "ansi-regex": "^5.0.1"
3584+ },
3585+ "engines": {
3586+ "node": ">=8"
3587+ }
3588+ },
3589+ "node_modules/strip-final-newline": {
3590+ "version": "2.0.0",
3591+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
3592+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
3593+ "dev": true,
3594+ "license": "MIT",
3595+ "engines": {
3596+ "node": ">=6"
3597+ }
3598+ },
3599+ "node_modules/strip-json-comments": {
3600+ "version": "2.0.1",
3601+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
3602+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
3603+ "dev": true,
3604+ "license": "MIT",
3605+ "engines": {
3606+ "node": ">=0.10.0"
3607+ }
3608+ },
3609+ "node_modules/supports-color": {
3610+ "version": "5.5.0",
3611+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
3612+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
3613+ "dev": true,
3614+ "license": "MIT",
3615+ "dependencies": {
3616+ "has-flag": "^3.0.0"
3617+ },
3618+ "engines": {
3619+ "node": ">=4"
3620+ }
3621+ },
3622+ "node_modules/tar": {
3623+ "version": "6.2.1",
3624+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
3625+ "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
3626+ "dev": true,
3627+ "license": "ISC",
3628+ "dependencies": {
3629+ "chownr": "^2.0.0",
3630+ "fs-minipass": "^2.0.0",
3631+ "minipass": "^5.0.0",
3632+ "minizlib": "^2.1.1",
3633+ "mkdirp": "^1.0.3",
3634+ "yallist": "^4.0.0"
3635+ },
3636+ "engines": {
3637+ "node": ">=10"
3638+ }
3639+ },
3640+ "node_modules/tar-fs": {
3641+ "version": "2.1.4",
3642+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz",
3643+ "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==",
3644+ "dev": true,
3645+ "license": "MIT",
3646+ "dependencies": {
3647+ "chownr": "^1.1.1",
3648+ "mkdirp-classic": "^0.5.2",
3649+ "pump": "^3.0.0",
3650+ "tar-stream": "^2.1.4"
3651+ }
3652+ },
3653+ "node_modules/tar-stream": {
3654+ "version": "2.2.0",
3655+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
3656+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
3657+ "dev": true,
3658+ "license": "MIT",
3659+ "dependencies": {
3660+ "bl": "^4.0.3",
3661+ "end-of-stream": "^1.4.1",
3662+ "fs-constants": "^1.0.0",
3663+ "inherits": "^2.0.3",
3664+ "readable-stream": "^3.1.1"
3665+ },
3666+ "engines": {
3667+ "node": ">=6"
3668+ }
3669+ },
3670+ "node_modules/tar-stream/node_modules/readable-stream": {
3671+ "version": "3.6.2",
3672+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
3673+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
3674+ "dev": true,
3675+ "license": "MIT",
3676+ "dependencies": {
3677+ "inherits": "^2.0.3",
3678+ "string_decoder": "^1.1.1",
3679+ "util-deprecate": "^1.0.1"
3680+ },
3681+ "engines": {
3682+ "node": ">= 6"
3683+ }
3684+ },
3685+ "node_modules/tar/node_modules/chownr": {
3686+ "version": "2.0.0",
3687+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
3688+ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
3689+ "dev": true,
3690+ "license": "ISC",
3691+ "engines": {
3692+ "node": ">=10"
3693+ }
3694+ },
3695+ "node_modules/tar/node_modules/minipass": {
3696+ "version": "5.0.0",
3697+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
3698+ "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
3699+ "dev": true,
3700+ "license": "ISC",
3701+ "engines": {
3702+ "node": ">=8"
3703+ }
3704+ },
3705+ "node_modules/tar/node_modules/mkdirp": {
3706+ "version": "1.0.4",
3707+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
3708+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
3709+ "dev": true,
3710+ "license": "MIT",
3711+ "bin": {
3712+ "mkdirp": "bin/cmd.js"
3713+ },
3714+ "engines": {
3715+ "node": ">=10"
3716+ }
3717+ },
3718+ "node_modules/tar/node_modules/yallist": {
3719+ "version": "4.0.0",
3720+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
3721+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
3722+ "dev": true,
3723+ "license": "ISC"
3724+ },
3725+ "node_modules/through2": {
3726+ "version": "2.0.5",
3727+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
3728+ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
3729+ "dev": true,
3730+ "license": "MIT",
3731+ "dependencies": {
3732+ "readable-stream": "~2.3.6",
3733+ "xtend": "~4.0.1"
3734+ }
3735+ },
3736+ "node_modules/tmp": {
3737+ "version": "0.2.5",
3738+ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz",
3739+ "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==",
3740+ "dev": true,
3741+ "license": "MIT",
3742+ "engines": {
3743+ "node": ">=14.14"
3744+ }
3745+ },
3746+ "node_modules/to-regex-range": {
3747+ "version": "5.0.1",
3748+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
3749+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
3750+ "dev": true,
3751+ "license": "MIT",
3752+ "dependencies": {
3753+ "is-number": "^7.0.0"
3754+ },
3755+ "engines": {
3756+ "node": ">=8.0"
3757+ }
3758+ },
3759+ "node_modules/tunnel-agent": {
3760+ "version": "0.6.0",
3761+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
3762+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
3763+ "dev": true,
3764+ "license": "Apache-2.0",
3765+ "dependencies": {
3766+ "safe-buffer": "^5.0.1"
3767+ },
3768+ "engines": {
3769+ "node": "*"
3770+ }
3771+ },
3772+ "node_modules/tweetnacl": {
3773+ "version": "0.14.5",
3774+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
3775+ "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
3776+ "dev": true,
3777+ "license": "Unlicense"
3778+ },
3779+ "node_modules/type-fest": {
3780+ "version": "0.21.3",
3781+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz",
3782+ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==",
3783+ "dev": true,
3784+ "license": "(MIT OR CC0-1.0)",
3785+ "engines": {
3786+ "node": ">=10"
3787+ },
3788+ "funding": {
3789+ "url": "https://github.com/sponsors/sindresorhus"
3790+ }
3791+ },
3792+ "node_modules/typedarray": {
3793+ "version": "0.0.6",
3794+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
3795+ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
3796+ "dev": true,
3797+ "license": "MIT"
3798+ },
3799+ "node_modules/uc.micro": {
3800+ "version": "2.1.0",
3801+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
3802+ "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
3803+ "dev": true,
3804+ "license": "MIT"
3805+ },
3806+ "node_modules/unique-filename": {
3807+ "version": "1.1.1",
3808+ "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",
3809+ "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==",
3810+ "dev": true,
3811+ "license": "ISC",
3812+ "dependencies": {
3813+ "unique-slug": "^2.0.0"
3814+ }
3815+ },
3816+ "node_modules/unique-slug": {
3817+ "version": "2.0.2",
3818+ "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz",
3819+ "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==",
3820+ "dev": true,
3821+ "license": "ISC",
3822+ "dependencies": {
3823+ "imurmurhash": "^0.1.4"
3824+ }
3825+ },
3826+ "node_modules/universalify": {
3827+ "version": "2.0.1",
3828+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
3829+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
3830+ "dev": true,
3831+ "license": "MIT",
3832+ "engines": {
3833+ "node": ">= 10.0.0"
3834+ }
3835+ },
3836+ "node_modules/util-deprecate": {
3837+ "version": "1.0.2",
3838+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
3839+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
3840+ "dev": true,
3841+ "license": "MIT"
3842+ },
3843+ "node_modules/which": {
3844+ "version": "1.3.1",
3845+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
3846+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
3847+ "dev": true,
3848+ "license": "ISC",
3849+ "dependencies": {
3850+ "isexe": "^2.0.0"
3851+ },
3852+ "bin": {
3853+ "which": "bin/which"
3854+ }
3855+ },
3856+ "node_modules/wrap-ansi": {
3857+ "version": "6.2.0",
3858+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
3859+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
3860+ "dev": true,
3861+ "license": "MIT",
3862+ "dependencies": {
3863+ "ansi-styles": "^4.0.0",
3864+ "string-width": "^4.1.0",
3865+ "strip-ansi": "^6.0.0"
3866+ },
3867+ "engines": {
3868+ "node": ">=8"
3869+ }
3870+ },
3871+ "node_modules/wrap-ansi-cjs": {
3872+ "name": "wrap-ansi",
3873+ "version": "7.0.0",
3874+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
3875+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
3876+ "dev": true,
3877+ "license": "MIT",
3878+ "dependencies": {
3879+ "ansi-styles": "^4.0.0",
3880+ "string-width": "^4.1.0",
3881+ "strip-ansi": "^6.0.0"
3882+ },
3883+ "engines": {
3884+ "node": ">=10"
3885+ },
3886+ "funding": {
3887+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
3888+ }
3889+ },
3890+ "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
3891+ "version": "4.3.0",
3892+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
3893+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
3894+ "dev": true,
3895+ "license": "MIT",
3896+ "dependencies": {
3897+ "color-convert": "^2.0.1"
3898+ },
3899+ "engines": {
3900+ "node": ">=8"
3901+ },
3902+ "funding": {
3903+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
3904+ }
3905+ },
3906+ "node_modules/wrap-ansi-cjs/node_modules/color-convert": {
3907+ "version": "2.0.1",
3908+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
3909+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
3910+ "dev": true,
3911+ "license": "MIT",
3912+ "dependencies": {
3913+ "color-name": "~1.1.4"
3914+ },
3915+ "engines": {
3916+ "node": ">=7.0.0"
3917+ }
3918+ },
3919+ "node_modules/wrap-ansi-cjs/node_modules/color-name": {
3920+ "version": "1.1.4",
3921+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
3922+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
3923+ "dev": true,
3924+ "license": "MIT"
3925+ },
3926+ "node_modules/wrap-ansi/node_modules/ansi-styles": {
3927+ "version": "4.3.0",
3928+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
3929+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
3930+ "dev": true,
3931+ "license": "MIT",
3932+ "dependencies": {
3933+ "color-convert": "^2.0.1"
3934+ },
3935+ "engines": {
3936+ "node": ">=8"
3937+ },
3938+ "funding": {
3939+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
3940+ }
3941+ },
3942+ "node_modules/wrap-ansi/node_modules/color-convert": {
3943+ "version": "2.0.1",
3944+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
3945+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
3946+ "dev": true,
3947+ "license": "MIT",
3948+ "dependencies": {
3949+ "color-name": "~1.1.4"
3950+ },
3951+ "engines": {
3952+ "node": ">=7.0.0"
3953+ }
3954+ },
3955+ "node_modules/wrap-ansi/node_modules/color-name": {
3956+ "version": "1.1.4",
3957+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
3958+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
3959+ "dev": true,
3960+ "license": "MIT"
3961+ },
3962+ "node_modules/wrappy": {
3963+ "version": "1.0.2",
3964+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
3965+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
3966+ "dev": true,
3967+ "license": "ISC"
3968+ },
3969+ "node_modules/wsl-utils": {
3970+ "version": "0.1.0",
3971+ "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz",
3972+ "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==",
3973+ "dev": true,
3974+ "license": "MIT",
3975+ "dependencies": {
3976+ "is-wsl": "^3.1.0"
3977+ },
3978+ "engines": {
3979+ "node": ">=18"
3980+ },
3981+ "funding": {
3982+ "url": "https://github.com/sponsors/sindresorhus"
3983+ }
3984+ },
3985+ "node_modules/xhr2": {
3986+ "version": "0.2.1",
3987+ "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.2.1.tgz",
3988+ "integrity": "sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==",
3989+ "dev": true,
3990+ "license": "MIT",
3991+ "engines": {
3992+ "node": ">= 6"
3993+ }
3994+ },
3995+ "node_modules/xtend": {
3996+ "version": "4.0.2",
3997+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
3998+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
3999+ "dev": true,
4000+ "license": "MIT",
4001+ "engines": {
4002+ "node": ">=0.4"
4003+ }
4004+ },
4005+ "node_modules/y18n": {
4006+ "version": "4.0.3",
4007+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
4008+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
4009+ "dev": true,
4010+ "license": "ISC"
4011+ },
4012+ "node_modules/yallist": {
4013+ "version": "3.1.1",
4014+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
4015+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
4016+ "dev": true,
4017+ "license": "ISC"
4018+ },
4019+ "node_modules/yaml": {
4020+ "version": "2.8.2",
4021+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
4022+ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
4023+ "dev": true,
4024+ "license": "ISC",
4025+ "bin": {
4026+ "yaml": "bin.mjs"
4027+ },
4028+ "engines": {
4029+ "node": ">= 14.6"
4030+ },
4031+ "funding": {
4032+ "url": "https://github.com/sponsors/eemeli"
4033+ }
4034+ },
4035+ "node_modules/zen-observable": {
4036+ "version": "0.8.15",
4037+ "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz",
4038+ "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==",
4039+ "dev": true,
4040+ "license": "MIT"
4041+ }
4042+ }
4043+}
package.json+9
@@ -2,7 +2,16 @@
22 "private": true,
33 "type": "module",
44 "scripts": {
5+ "install": "spago install",
6+ "build": "spago build",
7+ "test": "spago test -p backend-es",
58 "format": "purs-tidy format-in-place src backend-es/src backend-es/test/*.purs",
69 "format:check": "purs-tidy check src backend-es/src backend-es/test/*.purs"
10+ },
11+ "devDependencies": {
12+ "esbuild": "^0.27.0",
13+ "purescript": "^0.15.15",
14+ "purs-tidy": "^0.11.1",
15+ "spago": "^0.93.45"
716 }
817}
packages.dhall+6−3
@@ -1,6 +1,7 @@
11let upstream =
2− https://github.com/purescript/package-sets/releases/download/psc-0.15.4-20221018/packages.dhall
3− sha256:b1db2e4a17260ace8d17858602f8c56f460982d6e404818d7f6cb9f053324bb1
2+ https://github.com/purescript/package-sets/releases/download/psc-0.15.15-20241231/packages.dhall
3+ sha256:61533129f1e3369392665ecd389caecf1da74bec897e7ff355e5d920c92dda61
4+
45in upstream
56 with dodo-printer =
67 { dependencies =
@@ -15,7 +16,7 @@ in upstream
1516 , "effect"
1617 , "lists"
1718 , "maybe"
18− , "node-fs-aff"
19+ , "node-fs"
1920 , "node-path"
2021 , "node-process"
2122 , "ordered-collections"
@@ -24,3 +25,5 @@ in upstream
2425 , repo = "https://github.com/natefaubion/purescript-node-glob-basic.git"
2526 , version = "v1.2.2"
2627 }
28+ with arrays.version = "v7.2.1"
29+ with ordered-collections.version = "v3.1.0"
spago.dhall+7−2
@@ -7,12 +7,12 @@ You can edit this file as you like.
77 [ "aff"
88 , "ansi"
99 , "argonaut"
10− , "argonaut-codecs"
1110 , "argparse-basic"
1211 , "arrays"
1312 , "bifunctors"
1413 , "console"
1514 , "control"
15+ , "datetime"
1616 , "debug"
1717 , "dodo-printer"
1818 , "effect"
@@ -29,19 +29,24 @@ You can edit this file as you like.
2929 , "newtype"
3030 , "node-buffer"
3131 , "node-child-process"
32+ , "node-event-emitter"
3233 , "node-fs"
33− , "node-fs-aff"
3434 , "node-glob-basic"
3535 , "node-path"
3636 , "node-process"
3737 , "node-streams"
38+ , "now"
39+ , "nullable"
40+ , "numbers"
3841 , "ordered-collections"
42+ , "orders"
3943 , "parallel"
4044 , "partial"
4145 , "posix-types"
4246 , "prelude"
4347 , "refs"
4448 , "safe-coerce"
49+ , "st"
4550 , "strings"
4651 , "transformers"
4752 , "tuples"
spago.locknew file+1431
@@ -0,0 +1,1431 @@
1+{
2+ "workspace": {
3+ "packages": {
4+ "backend-es": {
5+ "path": "backend-es",
6+ "core": {
7+ "dependencies": [
8+ {
9+ "aff": ">=8.0.0 <9.0.0"
10+ },
11+ {
12+ "argonaut": ">=9.0.0 <10.0.0"
13+ },
14+ {
15+ "argparse-basic": ">=2.0.0 <3.0.0"
16+ },
17+ {
18+ "arrays": ">=7.3.0 <8.0.0"
19+ },
20+ {
21+ "backend-optimizer": "*"
22+ },
23+ {
24+ "bifunctors": ">=6.1.0 <7.0.0"
25+ },
26+ {
27+ "console": ">=6.1.0 <7.0.0"
28+ },
29+ {
30+ "control": ">=6.0.0 <7.0.0"
31+ },
32+ {
33+ "datetime": ">=6.1.0 <7.0.0"
34+ },
35+ {
36+ "dodo-printer": ">=2.2.3 <3.0.0"
37+ },
38+ {
39+ "effect": ">=4.0.0 <5.0.0"
40+ },
41+ {
42+ "either": ">=6.1.0 <7.0.0"
43+ },
44+ {
45+ "enums": ">=6.0.1 <7.0.0"
46+ },
47+ {
48+ "filterable": ">=5.0.0 <6.0.0"
49+ },
50+ {
51+ "foldable-traversable": ">=6.0.0 <7.0.0"
52+ },
53+ {
54+ "language-cst-parser": ">=0.14.1 <0.15.0"
55+ },
56+ {
57+ "lazy": ">=6.0.0 <7.0.0"
58+ },
59+ {
60+ "lists": ">=7.0.0 <8.0.0"
61+ },
62+ {
63+ "maybe": ">=6.0.0 <7.0.0"
64+ },
65+ {
66+ "newtype": ">=5.0.0 <6.0.0"
67+ },
68+ {
69+ "node-buffer": ">=9.0.0 <10.0.0"
70+ },
71+ {
72+ "node-child-process": ">=11.1.0 <12.0.0"
73+ },
74+ {
75+ "node-event-emitter": ">=3.0.0 <4.0.0"
76+ },
77+ {
78+ "node-fs": ">=9.2.0 <10.0.0"
79+ },
80+ {
81+ "node-glob-basic": ">=2.0.0 <3.0.0"
82+ },
83+ {
84+ "node-path": ">=5.0.1 <6.0.0"
85+ },
86+ {
87+ "node-process": ">=11.2.0 <12.0.0"
88+ },
89+ {
90+ "node-streams": ">=9.0.1 <10.0.0"
91+ },
92+ {
93+ "now": ">=6.0.0 <7.0.0"
94+ },
95+ {
96+ "nullable": ">=6.0.0 <7.0.0"
97+ },
98+ {
99+ "numbers": ">=9.0.1 <10.0.0"
100+ },
101+ {
102+ "ordered-collections": ">=3.2.0 <4.0.0"
103+ },
104+ {
105+ "orders": ">=6.0.0 <7.0.0"
106+ },
107+ {
108+ "parallel": ">=7.0.0 <8.0.0"
109+ },
110+ {
111+ "partial": ">=4.0.0 <5.0.0"
112+ },
113+ {
114+ "posix-types": ">=6.0.0 <7.0.0"
115+ },
116+ {
117+ "prelude": ">=6.0.2 <7.0.0"
118+ },
119+ {
120+ "refs": ">=6.0.0 <7.0.0"
121+ },
122+ {
123+ "strings": ">=6.0.1 <7.0.0"
124+ },
125+ {
126+ "transformers": ">=6.1.0 <7.0.0"
127+ },
128+ {
129+ "tuples": ">=7.0.0 <8.0.0"
130+ }
131+ ],
132+ "build_plan": [
133+ "aff",
134+ "ansi",
135+ "argonaut",
136+ "argonaut-codecs",
137+ "argonaut-core",
138+ "argonaut-traversals",
139+ "argparse-basic",
140+ "arraybuffer-types",
141+ "arrays",
142+ "backend-optimizer",
143+ "bifunctors",
144+ "catenable-lists",
145+ "console",
146+ "const",
147+ "contravariant",
148+ "control",
149+ "datetime",
150+ "debug",
151+ "distributive",
152+ "dodo-printer",
153+ "effect",
154+ "either",
155+ "enums",
156+ "exceptions",
157+ "exists",
158+ "filterable",
159+ "foldable-traversable",
160+ "foreign",
161+ "foreign-object",
162+ "free",
163+ "functions",
164+ "functors",
165+ "gen",
166+ "identity",
167+ "integers",
168+ "invariant",
169+ "js-date",
170+ "language-cst-parser",
171+ "lazy",
172+ "lists",
173+ "maybe",
174+ "newtype",
175+ "node-buffer",
176+ "node-child-process",
177+ "node-event-emitter",
178+ "node-fs",
179+ "node-glob-basic",
180+ "node-os",
181+ "node-path",
182+ "node-process",
183+ "node-streams",
184+ "nonempty",
185+ "now",
186+ "nullable",
187+ "numbers",
188+ "ordered-collections",
189+ "orders",
190+ "parallel",
191+ "partial",
192+ "posix-types",
193+ "prelude",
194+ "profunctor",
195+ "profunctor-lenses",
196+ "record",
197+ "refs",
198+ "safe-coerce",
199+ "st",
200+ "strings",
201+ "tailrec",
202+ "transformers",
203+ "tuples",
204+ "type-equality",
205+ "typelevel-prelude",
206+ "unfoldable",
207+ "unsafe-coerce"
208+ ]
209+ },
210+ "test": {
211+ "dependencies": [
212+ "ansi"
213+ ],
214+ "build_plan": [
215+ "ansi",
216+ "arrays",
217+ "bifunctors",
218+ "const",
219+ "contravariant",
220+ "control",
221+ "distributive",
222+ "effect",
223+ "either",
224+ "enums",
225+ "exists",
226+ "foldable-traversable",
227+ "functions",
228+ "functors",
229+ "gen",
230+ "identity",
231+ "integers",
232+ "invariant",
233+ "lazy",
234+ "lists",
235+ "maybe",
236+ "newtype",
237+ "nonempty",
238+ "numbers",
239+ "orders",
240+ "partial",
241+ "prelude",
242+ "profunctor",
243+ "refs",
244+ "safe-coerce",
245+ "st",
246+ "strings",
247+ "tailrec",
248+ "tuples",
249+ "type-equality",
250+ "unfoldable",
251+ "unsafe-coerce"
252+ ]
253+ }
254+ },
255+ "backend-optimizer": {
256+ "path": "./",
257+ "core": {
258+ "dependencies": [
259+ {
260+ "argonaut": ">=9.0.0 <10.0.0"
261+ },
262+ {
263+ "arrays": ">=7.3.0 <8.0.0"
264+ },
265+ {
266+ "control": ">=6.0.0 <7.0.0"
267+ },
268+ {
269+ "debug": ">=6.0.2 <7.0.0"
270+ },
271+ {
272+ "dodo-printer": ">=2.2.3 <3.0.0"
273+ },
274+ {
275+ "either": ">=6.1.0 <7.0.0"
276+ },
277+ {
278+ "enums": ">=6.0.1 <7.0.0"
279+ },
280+ {
281+ "foldable-traversable": ">=6.0.0 <7.0.0"
282+ },
283+ {
284+ "foreign-object": ">=4.1.0 <5.0.0"
285+ },
286+ {
287+ "integers": ">=6.0.0 <7.0.0"
288+ },
289+ {
290+ "language-cst-parser": ">=0.14.1 <0.15.0"
291+ },
292+ {
293+ "lazy": ">=6.0.0 <7.0.0"
294+ },
295+ {
296+ "lists": ">=7.0.0 <8.0.0"
297+ },
298+ {
299+ "maybe": ">=6.0.0 <7.0.0"
300+ },
301+ {
302+ "newtype": ">=5.0.0 <6.0.0"
303+ },
304+ {
305+ "ordered-collections": ">=3.2.0 <4.0.0"
306+ },
307+ {
308+ "partial": ">=4.0.0 <5.0.0"
309+ },
310+ {
311+ "prelude": ">=6.0.2 <7.0.0"
312+ },
313+ {
314+ "safe-coerce": ">=2.0.0 <3.0.0"
315+ },
316+ {
317+ "st": ">=6.2.0 <7.0.0"
318+ },
319+ {
320+ "strings": ">=6.0.1 <7.0.0"
321+ },
322+ {
323+ "transformers": ">=6.1.0 <7.0.0"
324+ },
325+ {
326+ "tuples": ">=7.0.0 <8.0.0"
327+ },
328+ {
329+ "unsafe-coerce": ">=6.0.0 <7.0.0"
330+ }
331+ ],
332+ "build_plan": [
333+ "ansi",
334+ "argonaut",
335+ "argonaut-codecs",
336+ "argonaut-core",
337+ "argonaut-traversals",
338+ "arrays",
339+ "bifunctors",
340+ "catenable-lists",
341+ "const",
342+ "contravariant",
343+ "control",
344+ "debug",
345+ "distributive",
346+ "dodo-printer",
347+ "effect",
348+ "either",
349+ "enums",
350+ "exceptions",
351+ "exists",
352+ "foldable-traversable",
353+ "foreign-object",
354+ "free",
355+ "functions",
356+ "functors",
357+ "gen",
358+ "identity",
359+ "integers",
360+ "invariant",
361+ "language-cst-parser",
362+ "lazy",
363+ "lists",
364+ "maybe",
365+ "newtype",
366+ "nonempty",
367+ "numbers",
368+ "ordered-collections",
369+ "orders",
370+ "partial",
371+ "prelude",
372+ "profunctor",
373+ "profunctor-lenses",
374+ "record",
375+ "refs",
376+ "safe-coerce",
377+ "st",
378+ "strings",
379+ "tailrec",
380+ "transformers",
381+ "tuples",
382+ "type-equality",
383+ "typelevel-prelude",
384+ "unfoldable",
385+ "unsafe-coerce"
386+ ]
387+ },
388+ "test": {
389+ "dependencies": [],
390+ "build_plan": []
391+ }
392+ }
393+ },
394+ "extra_packages": {}
395+ },
396+ "packages": {
397+ "aff": {
398+ "type": "registry",
399+ "version": "8.0.0",
400+ "integrity": "sha256-5MmdI4+0RHBtSBy+YlU3/Cq4R5W2ih3OaRedJIrVHdk=",
401+ "dependencies": [
402+ "bifunctors",
403+ "control",
404+ "datetime",
405+ "effect",
406+ "either",
407+ "exceptions",
408+ "foldable-traversable",
409+ "functions",
410+ "maybe",
411+ "newtype",
412+ "parallel",
413+ "prelude",
414+ "refs",
415+ "tailrec",
416+ "transformers",
417+ "unsafe-coerce"
418+ ]
419+ },
420+ "ansi": {
421+ "type": "registry",
422+ "version": "7.0.0",
423+ "integrity": "sha256-ZMB6HD+q9CXvn9fRCmJ8dvuDrOVHcjombL3oNOerVnE=",
424+ "dependencies": [
425+ "foldable-traversable",
426+ "lists",
427+ "strings"
428+ ]
429+ },
430+ "argonaut": {
431+ "type": "registry",
432+ "version": "9.0.0",
433+ "integrity": "sha256-9sHzkzcFkaMUa9+3FjIybJDYnHtY4Jp4zHOJ84qPTXo=",
434+ "dependencies": [
435+ "argonaut-codecs",
436+ "argonaut-core",
437+ "argonaut-traversals"
438+ ]
439+ },
440+ "argonaut-codecs": {
441+ "type": "registry",
442+ "version": "9.1.0",
443+ "integrity": "sha256-N6efXByUeg848ompEqJfVvZuZPfdRYDGlTDFn0G0Oh8=",
444+ "dependencies": [
445+ "argonaut-core",
446+ "arrays",
447+ "effect",
448+ "foreign-object",
449+ "identity",
450+ "integers",
451+ "maybe",
452+ "nonempty",
453+ "ordered-collections",
454+ "prelude",
455+ "record"
456+ ]
457+ },
458+ "argonaut-core": {
459+ "type": "registry",
460+ "version": "7.0.0",
461+ "integrity": "sha256-RC82GfAjItydxrO24cdX373KHVZiLqybu19b5X8u7B4=",
462+ "dependencies": [
463+ "arrays",
464+ "control",
465+ "either",
466+ "foreign-object",
467+ "functions",
468+ "gen",
469+ "maybe",
470+ "nonempty",
471+ "prelude",
472+ "strings",
473+ "tailrec"
474+ ]
475+ },
476+ "argonaut-traversals": {
477+ "type": "registry",
478+ "version": "10.0.0",
479+ "integrity": "sha256-9nSfqR70rjiNWVVsCoK+jrm9dmyZTx89IKNYO6uNUIk=",
480+ "dependencies": [
481+ "argonaut-codecs",
482+ "argonaut-core",
483+ "profunctor-lenses"
484+ ]
485+ },
486+ "argparse-basic": {
487+ "type": "registry",
488+ "version": "2.0.0",
489+ "integrity": "sha256-3Pp8MDfRL2oeBdfxXIUVJBdhGniaahw2UOG4QmHPm58=",
490+ "dependencies": [
491+ "arrays",
492+ "bifunctors",
493+ "control",
494+ "either",
495+ "foldable-traversable",
496+ "integers",
497+ "lists",
498+ "maybe",
499+ "newtype",
500+ "numbers",
501+ "prelude",
502+ "record",
503+ "strings",
504+ "tuples",
505+ "unfoldable"
506+ ]
507+ },
508+ "arraybuffer-types": {
509+ "type": "registry",
510+ "version": "3.0.2",
511+ "integrity": "sha256-mQKokysYVkooS4uXbO+yovmV/s8b138Ws3zQvOwIHRA=",
512+ "dependencies": []
513+ },
514+ "arrays": {
515+ "type": "registry",
516+ "version": "7.3.0",
517+ "integrity": "sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc=",
518+ "dependencies": [
519+ "bifunctors",
520+ "control",
521+ "foldable-traversable",
522+ "functions",
523+ "maybe",
524+ "nonempty",
525+ "partial",
526+ "prelude",
527+ "safe-coerce",
528+ "st",
529+ "tailrec",
530+ "tuples",
531+ "unfoldable",
532+ "unsafe-coerce"
533+ ]
534+ },
535+ "bifunctors": {
536+ "type": "registry",
537+ "version": "6.1.0",
538+ "integrity": "sha256-6enQzl1vqnFTQZ1WX9BnoOOVdPGO9WZvVXldHckVQvY=",
539+ "dependencies": [
540+ "const",
541+ "either",
542+ "newtype",
543+ "prelude",
544+ "tuples"
545+ ]
546+ },
547+ "catenable-lists": {
548+ "type": "registry",
549+ "version": "7.0.0",
550+ "integrity": "sha256-76vYENhwF4BWTBsjeLuErCH2jqVT4M3R1HX+4RwSftA=",
551+ "dependencies": [
552+ "control",
553+ "foldable-traversable",
554+ "lists",
555+ "maybe",
556+ "prelude",
557+ "tuples",
558+ "unfoldable"
559+ ]
560+ },
561+ "console": {
562+ "type": "registry",
563+ "version": "6.1.0",
564+ "integrity": "sha256-CxmAzjgyuGDmt9FZW51VhV6rBPwR6o0YeKUzA9rSzcM=",
565+ "dependencies": [
566+ "effect",
567+ "prelude"
568+ ]
569+ },
570+ "const": {
571+ "type": "registry",
572+ "version": "6.0.0",
573+ "integrity": "sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc=",
574+ "dependencies": [
575+ "invariant",
576+ "newtype",
577+ "prelude"
578+ ]
579+ },
580+ "contravariant": {
581+ "type": "registry",
582+ "version": "6.0.0",
583+ "integrity": "sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c=",
584+ "dependencies": [
585+ "const",
586+ "either",
587+ "newtype",
588+ "prelude",
589+ "tuples"
590+ ]
591+ },
592+ "control": {
593+ "type": "registry",
594+ "version": "6.0.0",
595+ "integrity": "sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk=",
596+ "dependencies": [
597+ "newtype",
598+ "prelude"
599+ ]
600+ },
601+ "datetime": {
602+ "type": "registry",
603+ "version": "6.1.0",
604+ "integrity": "sha256-g/5X5BBegQWLpI9IWD+sY6mcaYpzzlW5lz5NBzaMtyI=",
605+ "dependencies": [
606+ "bifunctors",
607+ "control",
608+ "either",
609+ "enums",
610+ "foldable-traversable",
611+ "functions",
612+ "gen",
613+ "integers",
614+ "lists",
615+ "maybe",
616+ "newtype",
617+ "numbers",
618+ "ordered-collections",
619+ "partial",
620+ "prelude",
621+ "tuples"
622+ ]
623+ },
624+ "debug": {
625+ "type": "registry",
626+ "version": "6.0.2",
627+ "integrity": "sha256-vmkYFuXYuELBzeauvgHG6E6Kf/Hp1dAnxwE9ByHfwSg=",
628+ "dependencies": [
629+ "functions",
630+ "prelude"
631+ ]
632+ },
633+ "distributive": {
634+ "type": "registry",
635+ "version": "6.0.0",
636+ "integrity": "sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ=",
637+ "dependencies": [
638+ "identity",
639+ "newtype",
640+ "prelude",
641+ "tuples",
642+ "type-equality"
643+ ]
644+ },
645+ "dodo-printer": {
646+ "type": "registry",
647+ "version": "2.2.3",
648+ "integrity": "sha256-+XQtWgt+ybwvQb+QbJ60wm4/hxGRAQoSmeR+Se+ZT7I=",
649+ "dependencies": [
650+ "ansi",
651+ "either",
652+ "foldable-traversable",
653+ "integers",
654+ "lists",
655+ "maybe",
656+ "newtype",
657+ "partial",
658+ "prelude",
659+ "safe-coerce",
660+ "strings",
661+ "tuples"
662+ ]
663+ },
664+ "effect": {
665+ "type": "registry",
666+ "version": "4.0.0",
667+ "integrity": "sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M=",
668+ "dependencies": [
669+ "prelude"
670+ ]
671+ },
672+ "either": {
673+ "type": "registry",
674+ "version": "6.1.0",
675+ "integrity": "sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY=",
676+ "dependencies": [
677+ "control",
678+ "invariant",
679+ "maybe",
680+ "prelude"
681+ ]
682+ },
683+ "enums": {
684+ "type": "registry",
685+ "version": "6.0.1",
686+ "integrity": "sha256-HWaD73JFLorc4A6trKIRUeDMdzE+GpkJaEOM1nTNkC8=",
687+ "dependencies": [
688+ "control",
689+ "either",
690+ "gen",
691+ "maybe",
692+ "newtype",
693+ "nonempty",
694+ "partial",
695+ "prelude",
696+ "tuples",
697+ "unfoldable"
698+ ]
699+ },
700+ "exceptions": {
701+ "type": "registry",
702+ "version": "6.1.0",
703+ "integrity": "sha256-K0T89IHtF3vBY7eSAO7eDOqSb2J9kZGAcDN5+IKsF8E=",
704+ "dependencies": [
705+ "effect",
706+ "either",
707+ "maybe",
708+ "prelude"
709+ ]
710+ },
711+ "exists": {
712+ "type": "registry",
713+ "version": "6.0.0",
714+ "integrity": "sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8=",
715+ "dependencies": [
716+ "unsafe-coerce"
717+ ]
718+ },
719+ "filterable": {
720+ "type": "registry",
721+ "version": "5.0.0",
722+ "integrity": "sha256-cCojJHRnTmpY1j1kegI4CFwghdQ2Fm/8dzM8IlC+lng=",
723+ "dependencies": [
724+ "arrays",
725+ "either",
726+ "foldable-traversable",
727+ "identity",
728+ "lists",
729+ "ordered-collections"
730+ ]
731+ },
732+ "foldable-traversable": {
733+ "type": "registry",
734+ "version": "6.0.0",
735+ "integrity": "sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM=",
736+ "dependencies": [
737+ "bifunctors",
738+ "const",
739+ "control",
740+ "either",
741+ "functors",
742+ "identity",
743+ "maybe",
744+ "newtype",
745+ "orders",
746+ "prelude",
747+ "tuples"
748+ ]
749+ },
750+ "foreign": {
751+ "type": "registry",
752+ "version": "7.0.0",
753+ "integrity": "sha256-1ORiqoS3HW+qfwSZAppHPWy4/6AQysxZ2t29jcdUMNA=",
754+ "dependencies": [
755+ "either",
756+ "functions",
757+ "identity",
758+ "integers",
759+ "lists",
760+ "maybe",
761+ "prelude",
762+ "strings",
763+ "transformers"
764+ ]
765+ },
766+ "foreign-object": {
767+ "type": "registry",
768+ "version": "4.1.0",
769+ "integrity": "sha256-q24okj6mT+yGHYQ+ei/pYPj5ih6sTbu7eDv/WU56JVo=",
770+ "dependencies": [
771+ "arrays",
772+ "foldable-traversable",
773+ "functions",
774+ "gen",
775+ "lists",
776+ "maybe",
777+ "prelude",
778+ "st",
779+ "tailrec",
780+ "tuples",
781+ "typelevel-prelude",
782+ "unfoldable"
783+ ]
784+ },
785+ "free": {
786+ "type": "registry",
787+ "version": "7.1.0",
788+ "integrity": "sha256-JAumgEsGSzJCNLD8AaFvuX7CpqS5yruCngi6yI7+V5k=",
789+ "dependencies": [
790+ "catenable-lists",
791+ "control",
792+ "distributive",
793+ "either",
794+ "exists",
795+ "foldable-traversable",
796+ "invariant",
797+ "lazy",
798+ "maybe",
799+ "prelude",
800+ "tailrec",
801+ "transformers",
802+ "tuples",
803+ "unsafe-coerce"
804+ ]
805+ },
806+ "functions": {
807+ "type": "registry",
808+ "version": "6.0.0",
809+ "integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=",
810+ "dependencies": [
811+ "prelude"
812+ ]
813+ },
814+ "functors": {
815+ "type": "registry",
816+ "version": "5.0.0",
817+ "integrity": "sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU=",
818+ "dependencies": [
819+ "bifunctors",
820+ "const",
821+ "contravariant",
822+ "control",
823+ "distributive",
824+ "either",
825+ "invariant",
826+ "maybe",
827+ "newtype",
828+ "prelude",
829+ "profunctor",
830+ "tuples",
831+ "unsafe-coerce"
832+ ]
833+ },
834+ "gen": {
835+ "type": "registry",
836+ "version": "4.0.0",
837+ "integrity": "sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI=",
838+ "dependencies": [
839+ "either",
840+ "foldable-traversable",
841+ "identity",
842+ "maybe",
843+ "newtype",
844+ "nonempty",
845+ "prelude",
846+ "tailrec",
847+ "tuples",
848+ "unfoldable"
849+ ]
850+ },
851+ "identity": {
852+ "type": "registry",
853+ "version": "6.0.0",
854+ "integrity": "sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY=",
855+ "dependencies": [
856+ "control",
857+ "invariant",
858+ "newtype",
859+ "prelude"
860+ ]
861+ },
862+ "integers": {
863+ "type": "registry",
864+ "version": "6.0.0",
865+ "integrity": "sha256-sf+sK26R1hzwl3NhXR7WAu9zCDjQnfoXwcyGoseX158=",
866+ "dependencies": [
867+ "maybe",
868+ "numbers",
869+ "prelude"
870+ ]
871+ },
872+ "invariant": {
873+ "type": "registry",
874+ "version": "6.0.0",
875+ "integrity": "sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo=",
876+ "dependencies": [
877+ "control",
878+ "prelude"
879+ ]
880+ },
881+ "js-date": {
882+ "type": "registry",
883+ "version": "8.0.0",
884+ "integrity": "sha256-6TVF4DWg5JL+jRAsoMssYw8rgOVALMUHT1CuNZt8NRo=",
885+ "dependencies": [
886+ "datetime",
887+ "effect",
888+ "exceptions",
889+ "foreign",
890+ "integers",
891+ "now"
892+ ]
893+ },
894+ "language-cst-parser": {
895+ "type": "registry",
896+ "version": "0.14.1",
897+ "integrity": "sha256-LJzh1ZTaKjcrHx95ZfO2La3w6Xb/IZQT3m2Nuj4n1dM=",
898+ "dependencies": [
899+ "arrays",
900+ "const",
901+ "control",
902+ "effect",
903+ "either",
904+ "enums",
905+ "foldable-traversable",
906+ "free",
907+ "functions",
908+ "functors",
909+ "identity",
910+ "integers",
911+ "lazy",
912+ "lists",
913+ "maybe",
914+ "newtype",
915+ "numbers",
916+ "ordered-collections",
917+ "partial",
918+ "prelude",
919+ "st",
920+ "strings",
921+ "transformers",
922+ "tuples",
923+ "typelevel-prelude",
924+ "unfoldable",
925+ "unsafe-coerce"
926+ ]
927+ },
928+ "lazy": {
929+ "type": "registry",
930+ "version": "6.0.0",
931+ "integrity": "sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU=",
932+ "dependencies": [
933+ "control",
934+ "foldable-traversable",
935+ "invariant",
936+ "prelude"
937+ ]
938+ },
939+ "lists": {
940+ "type": "registry",
941+ "version": "7.0.0",
942+ "integrity": "sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI=",
943+ "dependencies": [
944+ "bifunctors",
945+ "control",
946+ "foldable-traversable",
947+ "lazy",
948+ "maybe",
949+ "newtype",
950+ "nonempty",
951+ "partial",
952+ "prelude",
953+ "tailrec",
954+ "tuples",
955+ "unfoldable"
956+ ]
957+ },
958+ "maybe": {
959+ "type": "registry",
960+ "version": "6.0.0",
961+ "integrity": "sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q=",
962+ "dependencies": [
963+ "control",
964+ "invariant",
965+ "newtype",
966+ "prelude"
967+ ]
968+ },
969+ "newtype": {
970+ "type": "registry",
971+ "version": "5.0.0",
972+ "integrity": "sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw=",
973+ "dependencies": [
974+ "prelude",
975+ "safe-coerce"
976+ ]
977+ },
978+ "node-buffer": {
979+ "type": "registry",
980+ "version": "9.0.0",
981+ "integrity": "sha256-PWE2DJ5ruBLCmeA/fUiuySEFmUJ/VuRfyrnCuVZBlu4=",
982+ "dependencies": [
983+ "arraybuffer-types",
984+ "effect",
985+ "maybe",
986+ "nullable",
987+ "st",
988+ "unsafe-coerce"
989+ ]
990+ },
991+ "node-child-process": {
992+ "type": "registry",
993+ "version": "11.1.0",
994+ "integrity": "sha256-vioMNgk8p+CGwlb6T3I3TIir27el85Yg4satLE/I89w=",
995+ "dependencies": [
996+ "exceptions",
997+ "foreign",
998+ "foreign-object",
999+ "functions",
1000+ "node-event-emitter",
1001+ "node-fs",
1002+ "node-os",
1003+ "node-streams",
1004+ "nullable",
1005+ "posix-types",
1006+ "unsafe-coerce"
1007+ ]
1008+ },
1009+ "node-event-emitter": {
1010+ "type": "registry",
1011+ "version": "3.0.0",
1012+ "integrity": "sha256-Qw0MjsT4xRH2j2i4K8JmRjcMKnH5z1Cw39t00q4LE4w=",
1013+ "dependencies": [
1014+ "effect",
1015+ "either",
1016+ "functions",
1017+ "maybe",
1018+ "nullable",
1019+ "prelude",
1020+ "unsafe-coerce"
1021+ ]
1022+ },
1023+ "node-fs": {
1024+ "type": "registry",
1025+ "version": "9.2.0",
1026+ "integrity": "sha256-Sg0vkXycEzkEerX6hLccz21Ygd9w1+QSk1thotRZPGI=",
1027+ "dependencies": [
1028+ "datetime",
1029+ "effect",
1030+ "either",
1031+ "enums",
1032+ "exceptions",
1033+ "functions",
1034+ "integers",
1035+ "js-date",
1036+ "maybe",
1037+ "node-buffer",
1038+ "node-path",
1039+ "node-streams",
1040+ "nullable",
1041+ "partial",
1042+ "prelude",
1043+ "strings",
1044+ "unsafe-coerce"
1045+ ]
1046+ },
1047+ "node-glob-basic": {
1048+ "type": "registry",
1049+ "version": "2.0.0",
1050+ "integrity": "sha256-COPsHFpqwFGOBbo3DZ4yQLp5UTNshLcINIV2P3h8g6o=",
1051+ "dependencies": [
1052+ "aff",
1053+ "effect",
1054+ "either",
1055+ "foldable-traversable",
1056+ "lists",
1057+ "maybe",
1058+ "node-fs",
1059+ "node-path",
1060+ "node-process",
1061+ "ordered-collections",
1062+ "parallel",
1063+ "prelude",
1064+ "refs",
1065+ "strings",
1066+ "tuples"
1067+ ]
1068+ },
1069+ "node-os": {
1070+ "type": "registry",
1071+ "version": "5.1.0",
1072+ "integrity": "sha256-K3gcu9AXanN1+qtk1900+Fi+CuO0s3/H/RMNRNgIzso=",
1073+ "dependencies": [
1074+ "arrays",
1075+ "bifunctors",
1076+ "console",
1077+ "control",
1078+ "datetime",
1079+ "effect",
1080+ "either",
1081+ "exceptions",
1082+ "foldable-traversable",
1083+ "foreign",
1084+ "foreign-object",
1085+ "functions",
1086+ "maybe",
1087+ "node-buffer",
1088+ "nullable",
1089+ "partial",
1090+ "posix-types",
1091+ "prelude",
1092+ "unsafe-coerce"
1093+ ]
1094+ },
1095+ "node-path": {
1096+ "type": "registry",
1097+ "version": "5.0.1",
1098+ "integrity": "sha256-ePOElFamHkffhwJcS0Ozq4A14rflnkasFU6X2B8/yXs=",
1099+ "dependencies": [
1100+ "effect"
1101+ ]
1102+ },
1103+ "node-process": {
1104+ "type": "registry",
1105+ "version": "11.2.0",
1106+ "integrity": "sha256-+2MQDYChjGbVbapCyJtuWYwD41jk+BntF/kcOTKBMVs=",
1107+ "dependencies": [
1108+ "effect",
1109+ "foreign",
1110+ "foreign-object",
1111+ "maybe",
1112+ "node-event-emitter",
1113+ "node-streams",
1114+ "posix-types",
1115+ "prelude",
1116+ "unsafe-coerce"
1117+ ]
1118+ },
1119+ "node-streams": {
1120+ "type": "registry",
1121+ "version": "9.0.1",
1122+ "integrity": "sha256-7RJ6RqjOlhW+QlDFQNUHlkCG/CuYTTLT8yary5jhhsU=",
1123+ "dependencies": [
1124+ "aff",
1125+ "arrays",
1126+ "effect",
1127+ "either",
1128+ "exceptions",
1129+ "maybe",
1130+ "node-buffer",
1131+ "node-event-emitter",
1132+ "nullable",
1133+ "prelude",
1134+ "refs",
1135+ "st",
1136+ "tailrec",
1137+ "unsafe-coerce"
1138+ ]
1139+ },
1140+ "nonempty": {
1141+ "type": "registry",
1142+ "version": "7.0.0",
1143+ "integrity": "sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs=",
1144+ "dependencies": [
1145+ "control",
1146+ "foldable-traversable",
1147+ "maybe",
1148+ "prelude",
1149+ "tuples",
1150+ "unfoldable"
1151+ ]
1152+ },
1153+ "now": {
1154+ "type": "registry",
1155+ "version": "6.0.0",
1156+ "integrity": "sha256-xZ7x37ZMREfs6GCDw/h+FaKHV/3sPWmtqBZRGTxybQY=",
1157+ "dependencies": [
1158+ "datetime",
1159+ "effect"
1160+ ]
1161+ },
1162+ "nullable": {
1163+ "type": "registry",
1164+ "version": "6.0.0",
1165+ "integrity": "sha256-yiGBVl3AD+Guy4kNWWeN+zl1gCiJK+oeIFtZtPCw4+o=",
1166+ "dependencies": [
1167+ "effect",
1168+ "functions",
1169+ "maybe"
1170+ ]
1171+ },
1172+ "numbers": {
1173+ "type": "registry",
1174+ "version": "9.0.1",
1175+ "integrity": "sha256-/9M6aeMDBdB4cwYDeJvLFprAHZ49EbtKQLIJsneXLIk=",
1176+ "dependencies": [
1177+ "functions",
1178+ "maybe"
1179+ ]
1180+ },
1181+ "ordered-collections": {
1182+ "type": "registry",
1183+ "version": "3.2.0",
1184+ "integrity": "sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM=",
1185+ "dependencies": [
1186+ "arrays",
1187+ "foldable-traversable",
1188+ "gen",
1189+ "lists",
1190+ "maybe",
1191+ "partial",
1192+ "prelude",
1193+ "st",
1194+ "tailrec",
1195+ "tuples",
1196+ "unfoldable"
1197+ ]
1198+ },
1199+ "orders": {
1200+ "type": "registry",
1201+ "version": "6.0.0",
1202+ "integrity": "sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink=",
1203+ "dependencies": [
1204+ "newtype",
1205+ "prelude"
1206+ ]
1207+ },
1208+ "parallel": {
1209+ "type": "registry",
1210+ "version": "7.0.0",
1211+ "integrity": "sha256-gUC9i4Txnx9K9RcMLsjujbwZz6BB1bnE2MLvw4GIw5o=",
1212+ "dependencies": [
1213+ "control",
1214+ "effect",
1215+ "either",
1216+ "foldable-traversable",
1217+ "functors",
1218+ "maybe",
1219+ "newtype",
1220+ "prelude",
1221+ "profunctor",
1222+ "refs",
1223+ "transformers"
1224+ ]
1225+ },
1226+ "partial": {
1227+ "type": "registry",
1228+ "version": "4.0.0",
1229+ "integrity": "sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4=",
1230+ "dependencies": []
1231+ },
1232+ "posix-types": {
1233+ "type": "registry",
1234+ "version": "6.0.0",
1235+ "integrity": "sha256-ZfFz8RR1lee/o/Prccyeut3Q+9tYd08mlR72sIh6GzA=",
1236+ "dependencies": [
1237+ "maybe",
1238+ "prelude"
1239+ ]
1240+ },
1241+ "prelude": {
1242+ "type": "registry",
1243+ "version": "6.0.2",
1244+ "integrity": "sha256-kiAPZxihtAel8uRiTNdccf4qylp/9J3jNkEHNAD0MsE=",
1245+ "dependencies": []
1246+ },
1247+ "profunctor": {
1248+ "type": "registry",
1249+ "version": "6.0.1",
1250+ "integrity": "sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk=",
1251+ "dependencies": [
1252+ "control",
1253+ "distributive",
1254+ "either",
1255+ "exists",
1256+ "invariant",
1257+ "newtype",
1258+ "prelude",
1259+ "tuples"
1260+ ]
1261+ },
1262+ "profunctor-lenses": {
1263+ "type": "registry",
1264+ "version": "8.0.0",
1265+ "integrity": "sha256-K7f29rHRHgVSb2Y/PaSKtfYPriP6n87BJNO7EhsZHas=",
1266+ "dependencies": [
1267+ "arrays",
1268+ "bifunctors",
1269+ "const",
1270+ "control",
1271+ "distributive",
1272+ "either",
1273+ "foldable-traversable",
1274+ "foreign-object",
1275+ "functors",
1276+ "identity",
1277+ "lists",
1278+ "maybe",
1279+ "newtype",
1280+ "ordered-collections",
1281+ "partial",
1282+ "prelude",
1283+ "profunctor",
1284+ "record",
1285+ "transformers",
1286+ "tuples"
1287+ ]
1288+ },
1289+ "record": {
1290+ "type": "registry",
1291+ "version": "4.0.0",
1292+ "integrity": "sha256-Za5U85bTRJEfGK5Sk4hM41oXy84YQI0I8TL3WUn1Qzg=",
1293+ "dependencies": [
1294+ "functions",
1295+ "prelude",
1296+ "unsafe-coerce"
1297+ ]
1298+ },
1299+ "refs": {
1300+ "type": "registry",
1301+ "version": "6.0.0",
1302+ "integrity": "sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s=",
1303+ "dependencies": [
1304+ "effect",
1305+ "prelude"
1306+ ]
1307+ },
1308+ "safe-coerce": {
1309+ "type": "registry",
1310+ "version": "2.0.0",
1311+ "integrity": "sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU=",
1312+ "dependencies": [
1313+ "unsafe-coerce"
1314+ ]
1315+ },
1316+ "st": {
1317+ "type": "registry",
1318+ "version": "6.2.0",
1319+ "integrity": "sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY=",
1320+ "dependencies": [
1321+ "partial",
1322+ "prelude",
1323+ "tailrec",
1324+ "unsafe-coerce"
1325+ ]
1326+ },
1327+ "strings": {
1328+ "type": "registry",
1329+ "version": "6.0.1",
1330+ "integrity": "sha256-WssD3DbX4OPzxSdjvRMX0yvc9+pS7n5gyPv5I2Trb7k=",
1331+ "dependencies": [
1332+ "arrays",
1333+ "control",
1334+ "either",
1335+ "enums",
1336+ "foldable-traversable",
1337+ "gen",
1338+ "integers",
1339+ "maybe",
1340+ "newtype",
1341+ "nonempty",
1342+ "partial",
1343+ "prelude",
1344+ "tailrec",
1345+ "tuples",
1346+ "unfoldable",
1347+ "unsafe-coerce"
1348+ ]
1349+ },
1350+ "tailrec": {
1351+ "type": "registry",
1352+ "version": "6.1.0",
1353+ "integrity": "sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk=",
1354+ "dependencies": [
1355+ "bifunctors",
1356+ "effect",
1357+ "either",
1358+ "identity",
1359+ "maybe",
1360+ "partial",
1361+ "prelude",
1362+ "refs"
1363+ ]
1364+ },
1365+ "transformers": {
1366+ "type": "registry",
1367+ "version": "6.1.0",
1368+ "integrity": "sha256-3Bm+Z6tsC/paG888XkywDngJ2JMos+JfOhRlkVfb7gI=",
1369+ "dependencies": [
1370+ "control",
1371+ "distributive",
1372+ "effect",
1373+ "either",
1374+ "exceptions",
1375+ "foldable-traversable",
1376+ "identity",
1377+ "lazy",
1378+ "maybe",
1379+ "newtype",
1380+ "prelude",
1381+ "st",
1382+ "tailrec",
1383+ "tuples",
1384+ "unfoldable"
1385+ ]
1386+ },
1387+ "tuples": {
1388+ "type": "registry",
1389+ "version": "7.0.0",
1390+ "integrity": "sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M=",
1391+ "dependencies": [
1392+ "control",
1393+ "invariant",
1394+ "prelude"
1395+ ]
1396+ },
1397+ "type-equality": {
1398+ "type": "registry",
1399+ "version": "4.0.1",
1400+ "integrity": "sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw=",
1401+ "dependencies": []
1402+ },
1403+ "typelevel-prelude": {
1404+ "type": "registry",
1405+ "version": "7.0.0",
1406+ "integrity": "sha256-uFF2ph+vHcQpfPuPf2a3ukJDFmLhApmkpTMviHIWgJM=",
1407+ "dependencies": [
1408+ "prelude",
1409+ "type-equality"
1410+ ]
1411+ },
1412+ "unfoldable": {
1413+ "type": "registry",
1414+ "version": "6.0.0",
1415+ "integrity": "sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg=",
1416+ "dependencies": [
1417+ "foldable-traversable",
1418+ "maybe",
1419+ "partial",
1420+ "prelude",
1421+ "tuples"
1422+ ]
1423+ },
1424+ "unsafe-coerce": {
1425+ "type": "registry",
1426+ "version": "6.0.0",
1427+ "integrity": "sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0=",
1428+ "dependencies": []
1429+ }
1430+ }
1431+}
spago.yamlnew file+31
@@ -0,0 +1,31 @@
1+package:
2+ name: backend-optimizer
3+ dependencies:
4+ - argonaut: ">=9.0.0 <10.0.0"
5+ - arrays: ">=7.3.0 <8.0.0"
6+ - control: ">=6.0.0 <7.0.0"
7+ - debug: ">=6.0.2 <7.0.0"
8+ - dodo-printer: ">=2.2.3 <3.0.0"
9+ - either: ">=6.1.0 <7.0.0"
10+ - enums: ">=6.0.1 <7.0.0"
11+ - foldable-traversable: ">=6.0.0 <7.0.0"
12+ - foreign-object: ">=4.1.0 <5.0.0"
13+ - integers: ">=6.0.0 <7.0.0"
14+ - language-cst-parser: ">=0.14.1 <0.15.0"
15+ - lazy: ">=6.0.0 <7.0.0"
16+ - lists: ">=7.0.0 <8.0.0"
17+ - maybe: ">=6.0.0 <7.0.0"
18+ - newtype: ">=5.0.0 <6.0.0"
19+ - ordered-collections: ">=3.2.0 <4.0.0"
20+ - partial: ">=4.0.0 <5.0.0"
21+ - prelude: ">=6.0.2 <7.0.0"
22+ - safe-coerce: ">=2.0.0 <3.0.0"
23+ - st: ">=6.2.0 <7.0.0"
24+ - strings: ">=6.0.1 <7.0.0"
25+ - transformers: ">=6.1.0 <7.0.0"
26+ - tuples: ">=7.0.0 <8.0.0"
27+ - unsafe-coerce: ">=6.0.0 <7.0.0"
28+workspace:
29+ buildOpts:
30+ censorLibraryWarnings:
31+ all
src/PureScript/Backend/Optimizer/Analysis.purs+41−20
@@ -14,7 +14,7 @@ import Data.String.CodeUnits as SCU
1414import Data.Traversable (foldMap, foldr)
1515import Data.Tuple (Tuple(..), snd)
1616import PureScript.Backend.Optimizer.CoreFn (Ident, Literal(..), Qualified)
17−import PureScript.Backend.Optimizer.Syntax (class HasSyntax, BackendAccessor, BackendOperator(..), BackendOperator1(..), BackendSyntax(..), Level, Pair(..), sndPair, syntaxOf)
17+import PureScript.Backend.Optimizer.Syntax (class HasSyntax, BackendAccessor(..), BackendOperator(..), BackendOperator1(..), BackendSyntax(..), Level, Pair(..), sndPair, syntaxOf)
1818
1919data Capture = CaptureNone | CaptureBranch | CaptureClosure
2020
@@ -93,6 +93,7 @@ newtype BackendAnalysis = BackendAnalysis
9393 , rewrite :: Boolean
9494 , deps :: Set (Qualified Ident)
9595 , result :: ResultTerm
96+ , externs :: Boolean
9697 }
9798
9899derive instance Newtype BackendAnalysis _
@@ -106,6 +107,7 @@ instance Semigroup BackendAnalysis where
106107 , rewrite: a.rewrite || b.rewrite
107108 , deps: Set.union a.deps b.deps
108109 , result: a.result <> b.result
110+ , externs: a.externs || b.externs
109111 }
110112
111113instance Monoid BackendAnalysis where
@@ -117,6 +119,7 @@ instance Monoid BackendAnalysis where
117119 , rewrite: false
118120 , deps: Set.empty
119121 , result: KnownNeutral
122+ , externs: false
120123 }
121124
122125bound :: Level -> BackendAnalysis -> BackendAnalysis
@@ -168,10 +171,8 @@ updated level (BackendAnalysis s) = do
168171 { usages = Map.update (Just <<< over Usage (\us -> us { update = us.update + 1 })) level s.usages
169172 }
170173
171−usedDep :: Qualified Ident -> BackendAnalysis
172−usedDep dep = do
173− let BackendAnalysis s = mempty
174− BackendAnalysis s { deps = Set.singleton dep }
174+usedDep :: Qualified Ident -> BackendAnalysis -> BackendAnalysis
175+usedDep dep (BackendAnalysis s) = BackendAnalysis s { deps = Set.insert dep s.deps }
175176
176177bump :: BackendAnalysis -> BackendAnalysis
177178bump (BackendAnalysis s) = BackendAnalysis s { size = s.size + 1 }
@@ -190,19 +191,28 @@ callArity lvl arity (BackendAnalysis s) = BackendAnalysis s
190191withResult :: ResultTerm -> BackendAnalysis -> BackendAnalysis
191192withResult r (BackendAnalysis s) = BackendAnalysis s { result = r }
192193
194+externs :: BackendAnalysis -> BackendAnalysis
195+externs (BackendAnalysis s) = BackendAnalysis s { externs = true }
196+
193197class HasAnalysis a where
194198 analysisOf :: a -> BackendAnalysis
195199
196200resultOf :: forall a. HasAnalysis a => a -> ResultTerm
197201resultOf = analysisOf >>> unwrap >>> _.result
198202
199−analyze :: forall a. HasAnalysis a => HasSyntax a => (Tuple (Qualified Ident) (Maybe BackendAccessor) -> BackendAnalysis) -> BackendSyntax a -> BackendAnalysis
203+analyze :: forall a. HasAnalysis a => HasSyntax a => (Qualified Ident -> Maybe String -> Maybe BackendAnalysis) -> BackendSyntax a -> BackendAnalysis
200204analyze externAnalysis expr = case expr of
201− Var qi -> do
202− let BackendAnalysis { args } = externAnalysis (Tuple qi Nothing)
203− withArgs args
204− $ bump
205− $ usedDep qi
205+ Var qi ->
206+ case externAnalysis qi Nothing of
207+ Just (BackendAnalysis { args }) ->
208+ withArgs args analysis
209+ Nothing ->
210+ analysis
211+ where
212+ analysis =
213+ bump
214+ $ externs
215+ $ usedDep qi mempty
206216 Local _ lvl ->
207217 bump
208218 $ used lvl
@@ -304,7 +314,8 @@ analyze externAnalysis expr = case expr of
304314 CtorSaturated qi _ _ _ cs ->
305315 withResult KnownNeutral
306316 $ bump
307− $ foldMap (foldMap analysisOf) cs <> usedDep qi
317+ $ usedDep qi
318+ $ foldMap (foldMap analysisOf) cs
308319 CtorDef _ _ _ _ ->
309320 complex NonTrivial $ analyzeDefault expr
310321 Branch bs def -> do
@@ -320,8 +331,11 @@ analyze externAnalysis expr = case expr of
320331 $ analyzeDefault expr
321332 PrimOp op ->
322333 case op of
323− Op1 (OpIsTag _) b | Just (Local _ lvl) <- syntaxOf b ->
324− cased lvl analysis
334+ Op1 (OpIsTag qi) b
335+ | Just (Local _ lvl) <- syntaxOf b ->
336+ cased lvl $ usedDep qi $ analysis
337+ | otherwise ->
338+ usedDep qi analysis
325339 _ ->
326340 analysis
327341 where
@@ -342,15 +356,22 @@ analyze externAnalysis expr = case expr of
342356 analysis
343357 Just (Local _ lvl) ->
344358 accessed lvl $ complex Deref analysis
345− Just (Var qi) -> do
346− let BackendAnalysis { args } = externAnalysis (Tuple qi (Just acc))
347− withArgs args $ complex Trivial analysis
359+ Just (Var qi) ->
360+ case acc of
361+ GetProp prop
362+ | Just (BackendAnalysis { args }) <- externAnalysis qi (Just prop) ->
363+ withArgs args $ complex Trivial analysis
364+ _ ->
365+ complex Trivial analysis
348366 _ ->
349367 complex Deref analysis
350368 where
351369 analysis =
352− withResult Unknown
353− $ analyzeDefault expr
370+ case acc of
371+ GetCtorField qi _ _ _ _ _ -> do
372+ withResult Unknown $ usedDep qi $ analyzeDefault expr
373+ _ ->
374+ withResult Unknown $ analyzeDefault expr
354375 Lit lit ->
355376 case lit of
356377 LitArray as | Array.length as > 0 ->
@@ -369,7 +390,7 @@ analyze externAnalysis expr = case expr of
369390 withResult KnownNeutral
370391 $ analyzeDefault expr
371392
372−analyzeEffectBlock :: forall a. HasAnalysis a => HasSyntax a => (Tuple (Qualified Ident) (Maybe BackendAccessor) -> BackendAnalysis) -> BackendSyntax a -> BackendAnalysis
393+analyzeEffectBlock :: forall a. HasAnalysis a => HasSyntax a => (Qualified Ident -> Maybe String -> Maybe BackendAnalysis) -> BackendSyntax a -> BackendAnalysis
373394analyzeEffectBlock externAnalysis expr = case expr of
374395 Let _ lvl a b ->
375396 withResult (resultOf b)
src/PureScript/Backend/Optimizer/Builder.purs+16−8
@@ -11,12 +11,15 @@ import Data.List (List, foldM)
1111import Data.List as List
1212import Data.Map (Map)
1313import Data.Map as Map
14−import Data.Tuple (Tuple)
14+import Data.Maybe (Maybe)
15+import Data.Set (Set)
16+import Data.Tuple (Tuple(..))
1517import PureScript.Backend.Optimizer.Analysis (BackendAnalysis)
16−import PureScript.Backend.Optimizer.Convert (BackendModule, toBackendModule)
18+import PureScript.Backend.Optimizer.Convert (BackendModule, OptimizationSteps, toBackendModule)
1719import PureScript.Backend.Optimizer.CoreFn (Ann, Ident, Module(..), Qualified)
18−import PureScript.Backend.Optimizer.Semantics (ExternImpl, InlineDirectiveMap)
20+import PureScript.Backend.Optimizer.Semantics (BackendExpr, Ctx, ExternImpl, InlineDirectiveMap)
1921import PureScript.Backend.Optimizer.Semantics.Foreign (ForeignEval)
22+import PureScript.Backend.Optimizer.Syntax (BackendSyntax)
2023
2124type BuildEnv =
2225 { implementations :: Map (Qualified Ident) (Tuple BackendAnalysis ExternImpl)
@@ -25,10 +28,12 @@ type BuildEnv =
2528 }
2629
2730type BuildOptions m =
28− { directives :: InlineDirectiveMap
31+ { analyzeCustom :: Ctx -> BackendSyntax BackendExpr -> Maybe BackendAnalysis
32+ , directives :: InlineDirectiveMap
2933 , foreignSemantics :: Map (Qualified Ident) ForeignEval
3034 , onPrepareModule :: BuildEnv -> Module Ann -> m (Module Ann)
31− , onCodegenModule :: BuildEnv -> Module Ann -> BackendModule -> m Unit
35+ , onCodegenModule :: BuildEnv -> Module Ann -> BackendModule -> OptimizationSteps -> m Unit
36+ , traceIdents :: Set (Qualified Ident)
3237 }
3338
3439-- | Builds modules given a _sorted_ list of modules.
@@ -42,8 +47,9 @@ buildModules options coreFnModules =
4247 let buildEnv = { implementations, moduleCount, moduleIndex }
4348 coreFnModule'@(Module { name }) <- options.onPrepareModule buildEnv coreFnModule
4449 let
45− backendMod = toBackendModule coreFnModule'
46− { currentModule: name
50+ Tuple optimizationSteps backendMod = toBackendModule coreFnModule'
51+ { analyzeCustom: options.analyzeCustom
52+ , currentModule: name
4753 , currentLevel: 0
4854 , toLevel: Map.empty
4955 , implementations
@@ -52,10 +58,12 @@ buildModules options coreFnModules =
5258 , dataTypes: Map.empty
5359 , foreignSemantics: options.foreignSemantics
5460 , rewriteLimit: 10_000
61+ , traceIdents: options.traceIdents
62+ , optimizationSteps: []
5563 }
5664 newImplementations =
5765 foldrWithIndex Map.insert implementations backendMod.implementations
58− options.onCodegenModule (buildEnv { implementations = newImplementations }) coreFnModule' backendMod
66+ options.onCodegenModule (buildEnv { implementations = newImplementations }) coreFnModule' backendMod optimizationSteps
5967 pure
6068 { directives: foldrWithIndex Map.insert directives backendMod.directives
6169 , implementations: newImplementations
src/PureScript/Backend/Optimizer/Convert.purs+56−34
@@ -70,10 +70,10 @@ import Data.Traversable (class Foldable, Accum, foldr, for, mapAccumL, mapAccumR
7070import Data.TraversableWithIndex (forWithIndex)
7171import Data.Tuple (Tuple(..), fst, snd)
7272import Partial.Unsafe (unsafeCrashWith, unsafePartial)
73−import PureScript.Backend.Optimizer.Analysis (BackendAnalysis)
73+import PureScript.Backend.Optimizer.Analysis (BackendAnalysis, analyze, analyzeEffectBlock)
7474import PureScript.Backend.Optimizer.CoreFn (Ann(..), Bind(..), Binder(..), Binding(..), CaseAlternative(..), CaseGuard(..), Comment, ConstructorType(..), Expr(..), Guard(..), Ident(..), Literal(..), Meta(..), Module(..), ModuleName(..), ProperName, Qualified(..), ReExport, findProp, propKey, propValue, qualifiedModuleName, unQualified)
7575import PureScript.Backend.Optimizer.Directives (DirectiveHeaderResult, parseDirectiveHeader)
76−import PureScript.Backend.Optimizer.Semantics (BackendExpr(..), BackendSemantics, Ctx, DataTypeMeta, Env(..), EvalRef(..), ExternImpl(..), ExternSpine, InlineAccessor(..), InlineDirective(..), InlineDirectiveMap, NeutralExpr(..), build, evalExternFromImpl, freeze, optimize)
76+import PureScript.Backend.Optimizer.Semantics (BackendExpr(..), BackendSemantics, Ctx(..), DataTypeMeta, Env(..), EvalRef(..), ExternImpl(..), ExternSpine, InlineAccessor(..), InlineDirective(..), InlineDirectiveMap, NeutralExpr(..), build, evalExternFromImpl, evalExternRefFromImpl, freeze, optimize)
7777import PureScript.Backend.Optimizer.Semantics.Foreign (ForeignEval)
7878import PureScript.Backend.Optimizer.Syntax (BackendAccessor(..), BackendOperator(..), BackendOperator1(..), BackendOperator2(..), BackendOperatorOrd(..), BackendSyntax(..), Level(..), Pair(..))
7979import PureScript.Backend.Optimizer.Utils (foldl1Array)
@@ -100,20 +100,23 @@ type BackendModule =
100100 }
101101
102102type ConvertEnv =
103− { currentLevel :: Int
103+ { analyzeCustom :: Ctx -> BackendSyntax BackendExpr -> Maybe BackendAnalysis
104+ , currentLevel :: Int
104105 , currentModule :: ModuleName
105106 , dataTypes :: Map ProperName DataTypeMeta
106107 , toLevel :: Map Ident Level
107108 , implementations :: BackendImplementations
108109 , moduleImplementations :: BackendImplementations
110+ , optimizationSteps :: OptimizationSteps
109111 , directives :: InlineDirectiveMap
110112 , foreignSemantics :: Map (Qualified Ident) ForeignEval
111113 , rewriteLimit :: Int
114+ , traceIdents :: Set (Qualified Ident)
112115 }
113116
114117type ConvertM = Function ConvertEnv
115118
116−toBackendModule :: Module Ann -> ConvertM BackendModule
119+toBackendModule :: Module Ann -> ConvertM (Tuple OptimizationSteps BackendModule)
117120toBackendModule (Module mod) env = do
118121 let
119122 directives :: DirectiveHeaderResult
@@ -196,17 +199,18 @@ toBackendModule (Module mod) env = do
196199 mn <- qualifiedModuleName qi
197200 mn <$ guard (mn /= mod.name && mn /= ModuleName "Prim")
198201
199− { name: mod.name
200− , comments: mod.comments
201− , imports: usedImports
202− , dataTypes: Map.filter (Array.any (isBindingUsed usedBindings.accum) <<< Map.toUnfoldable <<< _.constructors) dataTypes
203− , bindings: usedBindings.value
204− , exports: localExports
205− , reExports: Set.fromFoldable mod.reExports
206− , implementations: moduleBindings.accum.moduleImplementations
207− , directives: directives.exports
208− , foreign: Set.fromFoldable mod.foreign
209− }
202+ Tuple moduleBindings.accum.optimizationSteps $
203+ { name: mod.name
204+ , comments: mod.comments
205+ , imports: usedImports
206+ , dataTypes: Map.filter (Array.any (isBindingUsed usedBindings.accum) <<< Map.toUnfoldable <<< _.constructors) dataTypes
207+ , bindings: usedBindings.value
208+ , exports: localExports
209+ , reExports: Set.fromFoldable mod.reExports
210+ , implementations: moduleBindings.accum.moduleImplementations
211+ , directives: directives.exports
212+ , foreign: Set.fromFoldable mod.foreign
213+ }
210214
211215type WithDeps = Tuple (Set (Qualified Ident))
212216
@@ -232,14 +236,24 @@ toBackendTopLevelBindingGroup env = case _ of
232236 overValue f a =
233237 a { value = f a.value }
234238
239+-- | For the NonEmptyArray,
240+-- | - `head` = the original expression
241+-- | - `last` = the final optimized expression
242+-- | - everything in-between the two are the steps that were taken from `head` to `last`
243+type OptimizationSteps = Array (Tuple (Qualified Ident) (NonEmptyArray BackendExpr))
244+
235245toTopLevelBackendBinding :: Array (Qualified Ident) -> ConvertEnv -> Binding Ann -> Accum ConvertEnv (Tuple Ident (WithDeps NeutralExpr))
236246toTopLevelBackendBinding group env (Binding _ ident cfn) = do
237− let evalEnv = Env { currentModule: env.currentModule, evalExtern: makeExternEval env, locals: [], directives: env.directives }
247+ let evalEnv = Env { currentModule: env.currentModule, evalExternRef: makeExternEvalRef env, evalExternSpine: makeExternEvalSpine env, locals: [], directives: env.directives }
248+ let qualifiedIdent = Qualified (Just env.currentModule) ident
238249 let backendExpr = toBackendExpr cfn env
239− let Tuple impl expr' = toExternImpl env group (optimize (getCtx env) evalEnv (Qualified (Just env.currentModule) ident) env.rewriteLimit backendExpr)
250+ let enableTracing = Set.member qualifiedIdent env.traceIdents
251+ let Tuple mbSteps optimizedExpr = optimize enableTracing (getCtx env) evalEnv qualifiedIdent env.rewriteLimit backendExpr
252+ let Tuple impl expr' = toExternImpl env group optimizedExpr
240253 { accum: env
241− { implementations = Map.insert (Qualified (Just env.currentModule) ident) impl env.implementations
242− , moduleImplementations = Map.insert (Qualified (Just env.currentModule) ident) impl env.moduleImplementations
254+ { implementations = Map.insert qualifiedIdent impl env.implementations
255+ , moduleImplementations = Map.insert qualifiedIdent impl env.moduleImplementations
256+ , optimizationSteps = maybe env.optimizationSteps (Array.snoc env.optimizationSteps <<< Tuple qualifiedIdent) $ NonEmptyArray.fromArray mbSteps
243257 , directives =
244258 case inferTransitiveDirective env.directives (snd impl) backendExpr cfn of
245259 Just dirs ->
@@ -323,8 +337,8 @@ toExternImpl env group expr = case expr of
323337topEnv :: Env -> Env
324338topEnv (Env env) = Env env { locals = [] }
325339
326−makeExternEval :: ConvertEnv -> Env -> Qualified Ident -> Array ExternSpine -> Maybe BackendSemantics
327−makeExternEval conv env qual spine = do
340+makeExternEvalSpine :: ConvertEnv -> Env -> Qualified Ident -> Array ExternSpine -> Maybe BackendSemantics
341+makeExternEvalSpine conv env qual spine = do
328342 let
329343 result = do
330344 fn <- Map.lookup qual conv.foreignSemantics
@@ -336,33 +350,41 @@ makeExternEval conv env qual spine = do
336350 _ ->
337351 result
338352
353+makeExternEvalRef :: ConvertEnv -> Env -> Qualified Ident -> Maybe BackendSemantics
354+makeExternEvalRef conv env qual =
355+ evalExternRefFromImpl env qual <$> Map.lookup qual conv.implementations
356+
339357buildM :: BackendSyntax BackendExpr -> ConvertM BackendExpr
340358buildM a env = build (getCtx env) a
341359
342360getCtx :: ConvertEnv -> Ctx
343−getCtx env =
361+getCtx env = Ctx
344362 { currentLevel: env.currentLevel
345363 , lookupExtern
364+ , analyze: \ctx@(Ctx { effect }) expr ->
365+ case env.analyzeCustom ctx expr of
366+ Just s -> s
367+ Nothing ->
368+ if effect then
369+ analyzeEffectBlock lookupExtern expr
370+ else
371+ analyze lookupExtern expr
346372 , effect: false
347373 }
348374 where
349− lookupExtern (Tuple qual acc) = do
375+ lookupExtern qual acc = do
350376 Tuple s impl <- Map.lookup qual env.implementations
351377 case impl of
352− ExternExpr _ a ->
378+ ExternExpr _ _ ->
353379 case acc of
354− Nothing ->
355− Just (Tuple s a)
356− _ ->
357− Nothing
380+ Nothing -> Just s
381+ _ -> Nothing
358382 ExternDict _ a ->
359383 case acc of
360− Just (GetProp prop) ->
361− findProp prop a
362− -- Nothing ->
363− -- Just $ Tuple s $ NeutralExpr $ Lit $ LitRecord (map snd <$> a)
364− _ ->
365− Nothing
384+ Just prop ->
385+ fst <$> findProp prop a
386+ Nothing ->
387+ Just s
366388 ExternCtor _ _ _ _ _ ->
367389 Nothing
368390
src/PureScript/Backend/Optimizer/CoreFn.purs+3−1
@@ -142,6 +142,7 @@ derive instance functorGuard :: Functor Guard
142142
143143data Prop a = Prop String a
144144
145+derive instance Eq a => Eq (Prop a)
145146derive instance functorProp :: Functor Prop
146147
147148instance foldableProp :: Foldable Prop where
@@ -171,7 +172,8 @@ data Literal a
171172 | LitArray (Array a)
172173 | LitRecord (Array (Prop a))
173174
174−derive instance functorLiteral :: Functor Literal
175+derive instance Eq a => Eq (Literal a)
176+derive instance Functor Literal
175177
176178instance foldableLiteral :: Foldable Literal where
177179 foldl k = foldlDefault k
src/PureScript/Backend/Optimizer/CoreFn/Json.purs+147−13
@@ -1,28 +1,54 @@
1+-- @inline Data.Argonaut.Core.caseJson always
12module PureScript.Backend.Optimizer.CoreFn.Json
23 ( decodeModule
34 , decodeModule'
45 , decodeAnn
56 ) where
67
7−import Prelude
8+import Prelude hiding (bind)
89
9−import Control.Alternative (guard, (<|>))
10+import Control.Alternative (guard)
1011import Control.Monad.Error.Class (throwError)
11−import Data.Argonaut (Json, JsonDecodeError(..), decodeJson)
12−import Data.Argonaut.Decode.Decoders (decodeArray, decodeBoolean, decodeInt, decodeJObject, decodeNumber, decodeString, decodeTuple, getField, getFieldOptional')
12+import Control.Monad.ST as ST
13+import Control.Monad.ST.Ref as STRef
14+import Data.Argonaut (Json, JsonDecodeError(..), caseJson, decodeJson, isNull)
1315import Data.Array as Array
14−import Data.Either (Either, note)
16+import Data.Array.ST as STArray
17+import Data.Either (Either(..), note)
18+import Data.Enum (toEnum)
1519import Data.Foldable (intercalate)
20+import Data.Int as Int
21+import Data.Maybe (Maybe(..))
22+import Data.String.CodePoints (CodePoint, fromCodePointArray)
1623import Data.String.CodeUnits as SCU
1724import Data.Traversable (traverse)
18−import Data.Tuple (Tuple(..), uncurry)
25+import Data.Tuple (Tuple(..))
1926import Foreign.Object (Object)
2027import Foreign.Object as Object
21−import PureScript.Backend.Optimizer.CoreFn (Ann(..), Bind(..), Binder(..), Binding(..), CaseAlternative(..), CaseGuard(..), Comment(..), ConstructorType(..), Expr(..), Guard(..), Ident(..), Import(..), Literal(..), Meta(..), Module(..), ModuleName(..), Prop(..), ProperName(..), Qualified(..), ReExport(..), SourcePos, SourceSpan)
28+import Partial.Unsafe (unsafePartial)
29+import Prelude as Prelude
30+import PureScript.Backend.Optimizer.CoreFn (Ann(..), Bind(..), Binder(..), Binding(..), CaseAlternative(..), CaseGuard(..), Comment(..), ConstructorType(..), Expr(..), Guard(..), Ident(..), Import(..), Literal(..), Meta(..), Module(..), ModuleName(..), Prop(..), ProperName(..), Qualified(..), ReExport(..), SourcePos, SourceSpan, emptySpan)
2231import Safe.Coerce (coerce)
32+import Unsafe.Coerce (unsafeCoerce)
2333
2434type JsonDecode = Either JsonDecodeError
2535
36+infixr 2 alt as <|>
37+
38+alt :: forall e a. Either e a -> (Unit -> Either e a) -> Either e a
39+alt a k = case a of
40+ Left _ -> k unit
41+ Right _ -> a
42+
43+-- Either's bind implementation is not ideal from an optimization
44+-- standpoint and generates awkward code.
45+bind :: forall e a b. Either e a -> (a -> Either e b) -> Either e b
46+bind a k = case a of
47+ Left err ->
48+ Left err
49+ Right a' ->
50+ k a'
51+
2652decodeSourcePos :: Json -> JsonDecode SourcePos
2753decodeSourcePos json = do
2854 Tuple line column <- decodeJson json
@@ -82,11 +108,12 @@ decodeMeta json = do
82108 throwError $ TypeMismatch "Meta"
83109
84110decodeAnn :: String -> Json -> JsonDecode Ann
85−decodeAnn path json = do
111+decodeAnn _path json = do
86112 obj <- decodeJObject json
87− span <- getField (decodeSourceSpan path) obj "sourceSpan"
113+ -- Currently disabled because spans are not used and are a performance drain.
114+ -- span <- getField (decodeSourceSpan path) obj "sourceSpan"
88115 meta <- getFieldOptional' decodeMeta obj "meta"
89− pure $ Ann { span, meta }
116+ pure $ Ann { span: emptySpan, meta }
90117
91118decodeImport :: forall a. (Json -> JsonDecode a) -> Json -> JsonDecode (Import a)
92119decodeImport decodeAnn' json = do
@@ -239,7 +266,7 @@ decodeLiteral dec json = do
239266 "NumberLiteral" ->
240267 LitNumber <$> getField decodeNumber obj "value"
241268 "StringLiteral" ->
242− LitString <$> getField decodeString obj "value"
269+ LitString <$> getField decodeStringLiteral obj "value"
243270 "CharLiteral" -> do
244271 str <- getField decodeString obj "value"
245272 LitChar <$> note (TypeMismatch "Char") do
@@ -255,10 +282,117 @@ decodeLiteral dec json = do
255282 throwError $ TypeMismatch "Literal"
256283
257284decodeRecord :: forall a. (Json -> JsonDecode a) -> Json -> JsonDecode (Array (Prop a))
258−decodeRecord = decodeArray <<< map (map (uncurry Prop)) <<< decodeTuple decodeString
285+decodeRecord = decodeArray <<< decodeProp
286+ where
287+ decodeProp decoder json = do
288+ arr <- decodeJArray json
289+ case arr of
290+ [ a, b ] -> do
291+ prop <- decodeString a
292+ value <- decoder b
293+ pure $ Prop prop value
294+ _ ->
295+ Left $ TypeMismatch "Tuple"
259296
260297decodeComment :: Json -> JsonDecode Comment
261298decodeComment json = do
262299 obj <- decodeJObject json
263300 LineComment <$> getField decodeString obj "LineComment"
264− <|> BlockComment <$> getField decodeString obj "BlockComment"
301+ <|> \_ -> BlockComment <$> getField decodeString obj "BlockComment"
302+
303+decodeArray :: forall a. (Json -> JsonDecode a) -> Json -> JsonDecode (Array a)
304+decodeArray decoder json = case decodeJArray json of
305+ Left err ->
306+ Left err
307+ Right arr -> ST.run Prelude.do
308+ out <- STArray.new
309+ ix <- STRef.new 0
310+ con <- STRef.new true
311+ res <- STRef.new (unsafeCoerce unit)
312+ let len = Array.length arr
313+ ST.while (STRef.read con) Prelude.do
314+ ix' <- STRef.read ix
315+ if ix' == len then Prelude.do
316+ out' <- STArray.unsafeFreeze out
317+ _ <- STRef.write false con
318+ _ <- STRef.write (Right out') res
319+ pure unit
320+ else
321+ case decoder (unsafePartial (Array.unsafeIndex arr ix')) of
322+ Left err -> Prelude.do
323+ _ <- STRef.write false con
324+ _ <- STRef.write (Left (AtIndex ix' err)) res
325+ pure unit
326+ Right val -> Prelude.do
327+ _ <- STArray.push val out
328+ _ <- STRef.write (ix' + 1) ix
329+ pure unit
330+ STRef.read res
331+
332+getField :: forall a. (Json -> JsonDecode a) -> Object Json -> String -> JsonDecode a
333+getField decode obj prop =
334+ case Object.lookup prop obj of
335+ Nothing ->
336+ Left $ AtKey prop MissingValue
337+ Just json ->
338+ decode json
339+
340+getFieldOptional' :: forall a. (Json -> JsonDecode a) -> Object Json -> String -> JsonDecode (Maybe a)
341+getFieldOptional' decode obj prop = do
342+ case Object.lookup prop obj of
343+ Nothing ->
344+ Right Nothing
345+ Just json
346+ | isNull json ->
347+ Right Nothing
348+ | otherwise ->
349+ Just <$> decode json
350+
351+decodeJObject :: Json -> JsonDecode (Object Json)
352+decodeJObject = caseJson fail fail fail fail fail Right
353+ where
354+ fail :: forall a. a -> JsonDecode (Object Json)
355+ fail _ = Left $ TypeMismatch "Object"
356+
357+decodeJArray :: Json -> JsonDecode (Array Json)
358+decodeJArray = caseJson fail fail fail fail Right fail
359+ where
360+ fail :: forall a. a -> JsonDecode (Array Json)
361+ fail _ = Left $ TypeMismatch "Array"
362+
363+decodeStringLiteral :: Json -> JsonDecode String
364+decodeStringLiteral json =
365+ decodeString json <|> \_ -> map fromCodePointArray (decodeCodePointArray json) <|> \_ -> throwError (TypeMismatch "StringLiteral")
366+
367+decodeString :: Json -> JsonDecode String
368+decodeString = caseJson fail fail fail Right fail fail
369+ where
370+ fail :: forall a. a -> JsonDecode String
371+ fail _ = Left $ TypeMismatch "String"
372+
373+decodeCodePointArray :: Json -> JsonDecode (Array CodePoint)
374+decodeCodePointArray = decodeArray decodeCodePoint
375+
376+decodeCodePoint :: Json -> JsonDecode CodePoint
377+decodeCodePoint = note (TypeMismatch "CodePoint") <<< toEnum <=< decodeInt
378+
379+decodeNumber :: Json -> JsonDecode Number
380+decodeNumber = caseJson fail fail Right fail fail fail
381+ where
382+ fail :: forall a. a -> JsonDecode Number
383+ fail _ = Left $ TypeMismatch "Number"
384+
385+decodeBoolean :: Json -> JsonDecode Boolean
386+decodeBoolean = caseJson fail Right fail fail fail fail
387+ where
388+ fail :: forall a. a -> JsonDecode Boolean
389+ fail _ = Left $ TypeMismatch "Boolean"
390+
391+decodeInt :: Json -> JsonDecode Int
392+decodeInt json = do
393+ num <- decodeNumber json
394+ case Int.fromNumber num of
395+ Nothing ->
396+ Left $ TypeMismatch "Int"
397+ Just int ->
398+ Right int
src/PureScript/Backend/Optimizer/Directives/Defaults.purs+15
@@ -37,6 +37,21 @@ defaultDirectives =
3737 Control.Semigroupoid.composeFlipped arity=1
3838 Control.Semigroupoid.semigroupoidFn.compose arity=2
3939
40+ Data.Array.ST.freeze arity=1
41+ Data.Array.ST.length arity=1
42+ Data.Array.ST.pop arity=1
43+ Data.Array.ST.poke arity=3
44+ Data.Array.ST.peek arity=2
45+ Data.Array.ST.pushAll arity=2
46+ Data.Array.ST.push arity=2
47+ Data.Array.ST.thaw arity=1
48+ Data.Array.ST.toAssocArray arity=1
49+ Data.Array.ST.shift arity=1
50+ Data.Array.ST.unsafeFreeze arity=1
51+ Data.Array.ST.unsafeThaw arity=1
52+ Data.Array.ST.unshift arity=2
53+ Data.Array.ST.unshiftAll arity=2
54+
4055 Data.Boolean.otherwise always
4156
4257 Data.Bounded.boundedRecordCons arity=5
src/PureScript/Backend/Optimizer/Semantics.purs+564−439
@@ -6,6 +6,7 @@ import Control.Alternative (guard)
66import Data.Array as Array
77import Data.Array.NonEmpty (NonEmptyArray)
88import Data.Array.NonEmpty as NonEmptyArray
9+import Data.Either (Either(..))
910import Data.Foldable (class Foldable, and, foldMap, foldl, foldr, or)
1011import Data.Foldable as Foldable
1112import Data.Foldable as Tuple
@@ -21,7 +22,7 @@ import Data.Set as Set
2122import Data.String as String
2223import Data.Tuple (Tuple(..), fst, snd)
2324import Partial.Unsafe (unsafeCrashWith)
24−import PureScript.Backend.Optimizer.Analysis (class HasAnalysis, BackendAnalysis(..), Capture(..), Complexity(..), ResultTerm(..), Usage(..), analysisOf, analyze, analyzeEffectBlock, bound, bump, complex, resultOf, updated, withResult, withRewrite)
25+import PureScript.Backend.Optimizer.Analysis (class HasAnalysis, BackendAnalysis(..), Capture(..), Complexity(..), ResultTerm(..), Usage(..), analysisOf, bound, bump, complex, resultOf, updated, withResult, withRewrite)
2526import PureScript.Backend.Optimizer.CoreFn (ConstructorType, Ident(..), Literal(..), ModuleName, Prop(..), ProperName, Qualified(..), findProp, propKey, propValue)
2627import PureScript.Backend.Optimizer.Syntax (class HasSyntax, BackendAccessor(..), BackendEffect, BackendOperator(..), BackendOperator1(..), BackendOperator2(..), BackendOperatorNum(..), BackendOperatorOrd(..), BackendSyntax(..), Level(..), Pair(..), syntaxOf)
2728import PureScript.Backend.Optimizer.Utils (foldl1Array, foldr1Array)
@@ -35,7 +36,7 @@ data MkFn a
3536 | MkFnNext (Maybe Ident) (a -> MkFn a)
3637
3738data BackendSemantics
38− = SemExtern (Qualified Ident) (Array ExternSpine) (Lazy BackendSemantics)
39+ = SemRef EvalRef (Array ExternSpine) (Lazy BackendSemantics)
3940 | SemLam (Maybe Ident) (BackendSemantics -> BackendSemantics)
4041 | SemMkFn (MkFn BackendSemantics)
4142 | SemMkEffectFn (MkFn BackendSemantics)
@@ -45,6 +46,7 @@ data BackendSemantics
4546 | SemEffectPure BackendSemantics
4647 | SemEffectDefer BackendSemantics
4748 | SemBranch (NonEmptyArray (SemConditional BackendSemantics)) (Lazy BackendSemantics)
49+ | SemAssocOp (Either (Qualified Ident) BackendOperator2) (NonEmptyArray BackendSemantics)
4850 | NeutLocal (Maybe Ident) Level
4951 | NeutVar (Qualified Ident)
5052 | NeutStop (Qualified Ident)
@@ -65,7 +67,16 @@ data SemConditional a = SemConditional (Lazy a) (Lazy a)
6567
6668data BackendExpr
6769 = ExprSyntax BackendAnalysis (BackendSyntax BackendExpr)
68− | ExprRewrite BackendAnalysis BackendRewrite
70+ | ExprRewrite BackendAnalysis (BackendRewrite BackendExpr)
71+
72+instance Eq BackendExpr where
73+ eq = case _, _ of
74+ ExprSyntax (BackendAnalysis s1) x, ExprSyntax (BackendAnalysis s2) y ->
75+ s1.size == s2.size && x == y
76+ ExprRewrite (BackendAnalysis s1) x, ExprRewrite (BackendAnalysis s2) y ->
77+ s1.size == s2.size && x == y
78+ _, _ ->
79+ false
6980
7081type LetBindingAssoc a =
7182 { ident :: Maybe Ident
@@ -80,28 +91,33 @@ type EffectBindingAssoc a =
8091 , pure :: Boolean
8192 }
8293
83−data BackendRewrite
84− = RewriteInline (Maybe Ident) Level BackendExpr BackendExpr
85− | RewriteUncurry (Maybe Ident) Level (NonEmptyArray (Tuple (Maybe Ident) Level)) BackendExpr BackendExpr
86− | RewriteLetAssoc (Array (LetBindingAssoc BackendExpr)) BackendExpr
87− | RewriteEffectBindAssoc (Array (EffectBindingAssoc BackendExpr)) BackendExpr
94+data BackendRewrite a
95+ = RewriteInline (Maybe Ident) Level a a
96+ | RewriteUncurry (Maybe Ident) Level (NonEmptyArray (Tuple (Maybe Ident) Level)) a a
8897 | RewriteStop (Qualified Ident)
89− | RewriteUnpackOp (Maybe Ident) Level UnpackOp BackendExpr
90− | RewriteDistBranchesLet (Maybe Ident) Level (NonEmptyArray (Pair BackendExpr)) BackendExpr BackendExpr
91− | RewriteDistBranchesOp (NonEmptyArray (Pair BackendExpr)) BackendExpr DistOp
92−
93−data UnpackOp
94− = UnpackRecord (Array (Prop BackendExpr))
95− | UnpackUpdate BackendExpr (Array (Prop BackendExpr))
96− | UnpackData (Qualified Ident) ConstructorType ProperName Ident (Array (Tuple String BackendExpr))
97−
98−data DistOp
99− = DistApp (NonEmptyArray BackendExpr)
100− | DistUncurriedApp (Array BackendExpr)
98+ | RewriteUnpackOp (Maybe Ident) Level (UnpackOp a) a
99+ | RewriteDistBranchesLet (Maybe Ident) Level (NonEmptyArray (Pair a)) a a
100+ | RewriteDistBranchesOp (NonEmptyArray (Pair a)) a (DistOp a)
101+
102+derive instance Eq a => Eq (BackendRewrite a)
103+
104+data UnpackOp a
105+ = UnpackRecord (Array (Prop a))
106+ | UnpackUpdate a (Array (Prop a))
107+ | UnpackArray (Array a)
108+ | UnpackData (Qualified Ident) ConstructorType ProperName Ident (Array (Tuple String a))
109+
110+derive instance Eq a => Eq (UnpackOp a)
111+
112+data DistOp a
113+ = DistApp (NonEmptyArray a)
114+ | DistUncurriedApp (Array a)
101115 | DistAccessor BackendAccessor
102116 | DistPrimOp1 BackendOperator1
103− | DistPrimOp2L BackendOperator2 BackendExpr
104− | DistPrimOp2R BackendExpr BackendOperator2
117+ | DistPrimOp2L BackendOperator2 a
118+ | DistPrimOp2R a BackendOperator2
119+
120+derive instance Eq a => Eq (DistOp a)
105121
106122data ExternImpl
107123 = ExternExpr (Array (Qualified Ident)) NeutralExpr
@@ -161,7 +177,8 @@ type InlineDirectiveMap = Map EvalRef (Map InlineAccessor InlineDirective)
161177
162178newtype Env = Env
163179 { currentModule :: ModuleName
164− , evalExtern :: Env -> Qualified Ident -> Array ExternSpine -> Maybe BackendSemantics
180+ , evalExternRef :: Env -> Qualified Ident -> Maybe BackendSemantics
181+ , evalExternSpine :: Env -> Qualified Ident -> Array ExternSpine -> Maybe BackendSemantics
165182 , locals :: Array (LocalBinding BackendSemantics)
166183 , directives :: InlineDirectiveMap
167184 }
@@ -199,9 +216,18 @@ class Eval f where
199216 eval :: Env -> f -> BackendSemantics
200217
201218instance Eval f => Eval (BackendSyntax f) where
202− eval env = case _ of
219+ eval env@(Env e) = case _ of
203220 Var qual ->
204− evalExtern env qual []
221+ case e.evalExternSpine env qual [] of
222+ Just sem ->
223+ sem
224+ Nothing ->
225+ SemRef (EvalExtern qual) [] $ defer \_ ->
226+ case e.evalExternRef env qual of
227+ Just sem ->
228+ deref sem
229+ Nothing ->
230+ NeutVar qual
205231 Local ident lvl ->
206232 case lookupLocal env lvl of
207233 Just (One sem) -> sem
@@ -240,14 +266,12 @@ instance Eval f => Eval (BackendSyntax f) where
240266 idents
241267 env
242268 Let ident _ binding body ->
243− guardFail (eval env binding) \binding' ->
244− makeLet ident binding' (flip eval body <<< bindLocal env <<< One)
269+ makeLet ident (eval env binding) (flip eval body <<< bindLocal env <<< One)
245270 LetRec _ bindings body -> do
246271 let bindGroup sem = flip eval sem <<< bindLocal env <<< Group
247272 SemLetRec (map bindGroup <$> bindings) (bindGroup body)
248273 EffectBind ident _ binding body ->
249− guardFail (eval env binding) \binding' ->
250− SemEffectBind ident binding' (flip eval body <<< bindLocal env <<< One)
274+ makeEffectBind ident (eval env binding) (flip eval body <<< bindLocal env <<< One)
251275 EffectPure val ->
252276 guardFail (eval env val) SemEffectPure
253277 EffectDefer val ->
@@ -255,7 +279,7 @@ instance Eval f => Eval (BackendSyntax f) where
255279 Accessor lhs accessor ->
256280 evalAccessor env (eval env lhs) accessor
257281 Update lhs updates ->
258− evalUpdate env (eval env lhs) (map (eval env) <$> updates)
282+ evalUpdate (eval env lhs) (map (eval env) <$> updates)
259283 Branch branches def ->
260284 evalBranches env (evalPair env <$> branches) (defer \_ -> eval env def)
261285 PrimOp op ->
@@ -284,28 +308,6 @@ instance Eval BackendExpr where
284308 RewriteUncurry ident _ args binding body ->
285309 SemLet ident (mkFnFromArgs env (NonEmptyArray.toArray args) binding) \newFn -> do
286310 eval (bindLocal env (One (mkUncurriedAppRewrite env newFn (NonEmptyArray.length args)))) body
287− RewriteLetAssoc bindings body -> do
288− let
289− goBinding env' = case _ of
290− List.Nil ->
291− eval env' body
292− List.Cons b bs ->
293− makeLet b.ident (eval env' b.binding) \nextBinding ->
294− goBinding (bindLocal env (One nextBinding)) bs
295− goBinding env (List.fromFoldable bindings)
296− RewriteEffectBindAssoc bindings body -> do
297− let
298− goBinding env' = case _ of
299− List.Nil ->
300− eval env' body
301− List.Cons b bs
302− | b.pure ->
303− makeLet b.ident (eval env' b.binding) \nextBinding ->
304− goBinding (bindLocal env (One nextBinding)) bs
305− | otherwise ->
306− SemEffectBind b.ident (eval env' b.binding) \nextBinding ->
307− goBinding (bindLocal env (One nextBinding)) bs
308− goBinding env (List.fromFoldable bindings)
309311 RewriteStop qual ->
310312 NeutStop qual
311313 RewriteUnpackOp _ _ op body ->
@@ -329,6 +331,15 @@ instance Eval BackendExpr where
329331 (flip eval body <<< bindLocal env <<< One <<< NeutUpdate hd')
330332 props
331333 []
334+ UnpackArray exprs ->
335+ foldr
336+ ( \expr next exprs' ->
337+ makeLet Nothing (eval env expr) \val ->
338+ next (Array.snoc exprs' val)
339+ )
340+ (flip eval body <<< bindLocal env <<< One <<< NeutLit <<< LitArray)
341+ exprs
342+ []
332343 UnpackData qual ct ty tag fields ->
333344 foldr
334345 ( \(Tuple field expr) next props' ->
@@ -381,8 +392,8 @@ evalApp env hd spine = go env hd (List.fromFoldable spine)
381392 SemLam _ k, List.Cons arg args ->
382393 makeLet Nothing arg \nextArg ->
383394 go env' (k nextArg) args
384− SemExtern qual sp _, List.Cons arg args -> do
385− go env' (evalExtern env' qual (snocApp sp arg)) args
395+ SemRef ref sp sem, List.Cons arg args ->
396+ go env' (evalRef env' ref sp (ExternApp [ arg ]) sem) args
386397 SemLet ident val k, args ->
387398 SemLet ident val \nextVal ->
388399 makeLet Nothing (k nextVal) \nextFn ->
@@ -400,9 +411,9 @@ evalUncurriedApp :: Env -> BackendSemantics -> Spine BackendSemantics -> Backend
400411evalUncurriedApp env hd spine = case hd of
401412 SemMkFn mk ->
402413 evalUncurriedBeta NeutUncurriedApp mk spine
403− SemExtern qual sp _ ->
414+ SemRef ref sp sem ->
404415 guardFailOver identity spine \spine' ->
405− evalExtern env qual (Array.snoc sp (ExternUncurriedApp spine'))
416+ evalRef env ref sp (ExternUncurriedApp spine') sem
406417 SemLet ident val k ->
407418 SemLet ident val \nextVal ->
408419 makeLet Nothing (k nextVal) \nextFn ->
@@ -478,43 +489,41 @@ neutralApp hd spine
478489 NeutApp hd spine
479490
480491evalAccessor :: Env -> BackendSemantics -> BackendAccessor -> BackendSemantics
481−evalAccessor initEnv initLhs accessor =
482− evalAssocLet initEnv initLhs \env lhs -> case lhs of
483− SemExtern qual spine _ ->
484− evalExtern env qual $ Array.snoc spine (ExternAccessor accessor)
485− NeutLit (LitRecord props)
486− | GetProp prop <- accessor
487− , Just sem <- Array.findMap (\(Prop p v) -> guard (p == prop) $> v) props ->
488− sem
489− NeutUpdate rec props
490− | GetProp prop <- accessor ->
491− case Array.findMap (\(Prop p v) -> guard (p == prop) $> v) props of
492− Just sem ->
493− sem
494− Nothing ->
495− evalAccessor env rec accessor
496− NeutLit (LitArray values)
497− | GetIndex n <- accessor
498− , Just sem <- Array.index values n ->
499− sem
500− NeutData _ _ _ _ fields
501− | GetCtorField _ _ _ _ _ n <- accessor
502− , Just (Tuple _ sem) <- Array.index fields n ->
503− sem
504− NeutFail err ->
505− NeutFail err
506− _ ->
507− NeutAccessor lhs accessor
508−
509−evalUpdate :: Env -> BackendSemantics -> Array (Prop BackendSemantics) -> BackendSemantics
510−evalUpdate initEnv initLhs props =
511− evalAssocLet initEnv initLhs \_ lhs -> case lhs of
512− NeutLit (LitRecord props') ->
513− NeutLit (LitRecord (NonEmptyArray.head <$> Array.groupAllBy (comparing propKey) (props <> props')))
514− NeutUpdate r props' ->
515− NeutUpdate r (NonEmptyArray.head <$> Array.groupAllBy (comparing propKey) (props <> props'))
516− _ ->
517− NeutUpdate lhs props
492+evalAccessor env lhs accessor = floatLet lhs case _ of
493+ SemRef ref spine sem ->
494+ evalRef env ref spine (ExternAccessor accessor) sem
495+ NeutLit (LitRecord props)
496+ | GetProp prop <- accessor
497+ , Just sem <- Array.findMap (\(Prop p v) -> guard (p == prop) $> v) props ->
498+ sem
499+ NeutUpdate rec props
500+ | GetProp prop <- accessor ->
501+ case Array.findMap (\(Prop p v) -> guard (p == prop) $> v) props of
502+ Just sem ->
503+ sem
504+ Nothing ->
505+ evalAccessor env rec accessor
506+ NeutLit (LitArray values)
507+ | GetIndex n <- accessor
508+ , Just sem <- Array.index values n ->
509+ sem
510+ NeutData _ _ _ _ fields
511+ | GetCtorField _ _ _ _ _ n <- accessor
512+ , Just (Tuple _ sem) <- Array.index fields n ->
513+ sem
514+ NeutFail err ->
515+ NeutFail err
516+ lhs' ->
517+ NeutAccessor lhs' accessor
518+
519+evalUpdate :: BackendSemantics -> Array (Prop BackendSemantics) -> BackendSemantics
520+evalUpdate lhs props = floatLet lhs case _ of
521+ NeutLit (LitRecord props') ->
522+ NeutLit (LitRecord (NonEmptyArray.head <$> Array.groupAllBy (comparing propKey) (props <> props')))
523+ NeutUpdate r props' ->
524+ NeutUpdate r (NonEmptyArray.head <$> Array.groupAllBy (comparing propKey) (props <> props'))
525+ lhs' ->
526+ NeutUpdate lhs' props
518527
519528evalBranches :: Env -> NonEmptyArray (SemConditional BackendSemantics) -> Lazy BackendSemantics -> BackendSemantics
520529evalBranches _ initConds initDef = go [] (NonEmptyArray.toArray initConds) initDef
@@ -522,7 +531,7 @@ evalBranches _ initConds initDef = go [] (NonEmptyArray.toArray initConds) initD
522531 go acc conds def = case Array.uncons conds of
523532 Just { head, tail } ->
524533 case head of
525− SemConditional c t -> case force c of
534+ SemConditional c t -> case deref (force c) of
526535 NeutLit (LitBoolean didMatch)
527536 | didMatch -> go acc [] t
528537 | otherwise -> go acc tail def
@@ -553,156 +562,187 @@ rewriteBranches k = go
553562evalPair :: forall f. Eval f => Env -> Pair f -> SemConditional BackendSemantics
554563evalPair env (Pair a b) = SemConditional (defer \_ -> eval env a) (defer \_ -> eval env b)
555564
556−evalAssocLet :: Env -> BackendSemantics -> (Env -> BackendSemantics -> BackendSemantics) -> BackendSemantics
557−evalAssocLet env sem go = case sem of
558− SemLet ident val k ->
559− SemLet ident val \nextVal1 ->
560− makeLet Nothing (k nextVal1) \nextVal2 ->
561− go (bindLocal (bindLocal env (One nextVal1)) (One nextVal2)) nextVal2
562− SemLetRec vals k ->
563− SemLetRec vals \nextVals1 ->
564− makeLet Nothing (k nextVals1) \nextVal2 ->
565− go (bindLocal (bindLocal env (Group nextVals1)) (One nextVal2)) nextVal2
566− NeutFail err ->
567− NeutFail err
568− _ ->
569− go env sem
565+makeEffectBind :: Maybe Ident -> BackendSemantics -> (BackendSemantics -> BackendSemantics) -> BackendSemantics
566+makeEffectBind = go
567+ where
568+ go ident1 binding1 k1 = case binding1 of
569+ SemLet ident2 binding2 k2 ->
570+ makeLet ident2 binding2 \nextBinding2 ->
571+ makeEffectBind ident1 (k2 nextBinding2) k1
572+ SemEffectBind ident2 binding2 k2 ->
573+ go ident2 binding2 \nextBinding2 ->
574+ makeEffectBind ident1 (k2 nextBinding2) k1
575+ SemEffectDefer binding2 ->
576+ SemEffectDefer $ floatLet binding2 \nextBinding2 ->
577+ makeEffectBind ident1 nextBinding2 k1
578+ _ ->
579+ floatLet binding1 \nextBinding2 ->
580+ SemEffectBind ident1 nextBinding2 k1
570581
571−evalAssocLet2
572− :: Env
573− -> BackendSemantics
582+makeLet :: Maybe Ident -> BackendSemantics -> (BackendSemantics -> BackendSemantics) -> BackendSemantics
583+makeLet = floatLetWith go
584+ where
585+ go ident binding k = case binding of
586+ SemRef _ [] _ ->
587+ k binding
588+ NeutLocal _ _ ->
589+ k binding
590+ NeutStop _ ->
591+ k binding
592+ NeutVar _ ->
593+ k binding
594+ _ ->
595+ SemLet ident binding k
596+
597+floatLet :: BackendSemantics -> (BackendSemantics -> BackendSemantics) -> BackendSemantics
598+floatLet = floatLetWith (const (#)) Nothing
599+
600+floatLetWith
601+ :: (Maybe Ident -> BackendSemantics -> (BackendSemantics -> BackendSemantics) -> BackendSemantics)
602+ -> Maybe Ident
574603 -> BackendSemantics
575− -> (Env -> BackendSemantics -> BackendSemantics -> BackendSemantics)
604+ -> (BackendSemantics -> BackendSemantics)
576605 -> BackendSemantics
577−evalAssocLet2 env sem1 sem2 go =
578− evalAssocLet env sem1 \env' sem1' ->
579− evalAssocLet env' sem2 \env'' sem2' ->
580− go env'' sem1' sem2'
606+floatLetWith = go
607+ where
608+ go f ident1 binding1 k1 = case binding1 of
609+ SemLet ident2 binding2 k2 ->
610+ go makeLet ident2 binding2 \nextBinding2 ->
611+ f ident1 (k2 nextBinding2) k1
612+ SemLetRec bindings k2 ->
613+ SemLetRec bindings \nextBindings ->
614+ makeLet ident1 (k2 nextBindings) k1
615+ NeutFail _ ->
616+ binding1
617+ _ ->
618+ f ident1 binding1 k1
581619
582−makeLet :: Maybe Ident -> BackendSemantics -> (BackendSemantics -> BackendSemantics) -> BackendSemantics
583−makeLet ident binding go = case binding of
584− SemExtern _ [] _ ->
585− go binding
586− NeutLocal _ _ ->
587− go binding
588− NeutStop _ ->
589− go binding
590− NeutVar _ ->
591− go binding
592− _ ->
593− SemLet ident binding go
620+deref :: BackendSemantics -> BackendSemantics
621+deref = case _ of
622+ SemRef _ _ sem ->
623+ force sem
624+ sem ->
625+ sem
594626
595−-- TODO: Check for overflow in Int ops since backends may not handle it the
596−-- same was as the JS backend.
597627evalPrimOp :: Env -> BackendOperator BackendSemantics -> BackendSemantics
598628evalPrimOp env = case _ of
599629 Op1 op1 x ->
600630 case op1, x of
601− OpBooleanNot, NeutLit (LitBoolean bool) ->
602− liftBoolean (not bool)
603− OpBooleanNot, NeutPrimOp op ->
604− evalPrimOpNot op
605− OpIntBitNot, NeutLit (LitInt a) ->
606− liftInt (complement a)
607− OpIsTag a, NeutData b _ _ _ _ ->
608− liftBoolean (a == b)
609− OpArrayLength, NeutLit (LitArray arr) ->
610− liftInt (Array.length arr)
611− OpIntNegate, NeutLit (LitInt a) ->
612− liftInt (negate a)
613− OpNumberNegate, NeutLit (LitNumber a) ->
614− liftNumber (negate a)
615− _, SemExtern qual spine _ ->
616− evalExtern env qual $ Array.snoc spine (ExternPrimOp op1)
631+ OpBooleanNot, _
632+ | NeutLit (LitBoolean bool) <- deref x ->
633+ liftBoolean (not bool)
634+ OpBooleanNot, _
635+ | NeutPrimOp op <- x ->
636+ evalPrimOpNot op
637+ OpIntBitNot, _
638+ | NeutLit (LitInt a) <- deref x ->
639+ liftInt (complement a)
640+ OpIsTag a, _
641+ | NeutData b _ _ _ _ <- deref x ->
642+ liftBoolean (a == b)
643+ OpArrayLength, _
644+ | NeutLit (LitArray arr) <- deref x ->
645+ liftInt (Array.length arr)
646+ OpIntNegate, _
647+ | NeutLit (LitInt a) <- deref x ->
648+ liftInt (negate a)
649+ OpNumberNegate, _
650+ | NeutLit (LitNumber a) <- deref x ->
651+ liftNumber (negate a)
652+ _, SemRef ref spine sem ->
653+ evalRef env ref spine (ExternPrimOp op1) sem
617654 _, NeutFail err ->
618655 NeutFail err
619656 _, _ ->
620− evalAssocLet env x \_ x' ->
621− NeutPrimOp (Op1 op1 x')
657+ floatLet x (NeutPrimOp <<< Op1 op1)
622658 Op2 op2 x y ->
623659 case op2 of
624660 OpBooleanAnd
625− | NeutLit (LitBoolean false) <- x ->
661+ | NeutLit (LitBoolean false) <- deref x ->
626662 x
627− | NeutLit (LitBoolean false) <- y ->
663+ | NeutLit (LitBoolean false) <- deref y ->
628664 y
629− | NeutLit (LitBoolean true) <- x ->
665+ | NeutLit (LitBoolean true) <- deref x ->
630666 y
631− | NeutLit (LitBoolean true) <- y ->
667+ | NeutLit (LitBoolean true) <- deref y ->
632668 x
633669 OpBooleanOr
634− | NeutLit (LitBoolean false) <- x ->
670+ | NeutLit (LitBoolean false) <- deref x ->
635671 y
636− | NeutLit (LitBoolean false) <- y ->
672+ | NeutLit (LitBoolean false) <- deref y ->
637673 x
638− | NeutLit (LitBoolean true) <- x ->
674+ | NeutLit (LitBoolean true) <- deref x ->
639675 x
640− | NeutLit (LitBoolean true) <- y ->
676+ | NeutLit (LitBoolean true) <- deref y ->
641677 y
642678 OpBooleanOrd OpEq
643− | NeutLit (LitBoolean bool) <- x ->
679+ | NeutLit (LitBoolean bool) <- deref x ->
644680 if bool then y else evalPrimOp env (Op1 OpBooleanNot y)
645− | NeutLit (LitBoolean bool) <- y ->
681+ | NeutLit (LitBoolean bool) <- deref y ->
646682 if bool then x else evalPrimOp env (Op1 OpBooleanNot x)
647683 OpBooleanOrd op
648− | NeutLit (LitBoolean a) <- x
649− , NeutLit (LitBoolean b) <- y ->
684+ | NeutLit (LitBoolean a) <- deref x
685+ , NeutLit (LitBoolean b) <- deref y ->
650686 liftBoolean (evalPrimOpOrd op a b)
651687 OpCharOrd op
652− | NeutLit (LitChar a) <- x
653− , NeutLit (LitChar b) <- y ->
688+ | NeutLit (LitChar a) <- deref x
689+ , NeutLit (LitChar b) <- deref y ->
654690 liftBoolean (evalPrimOpOrd op a b)
655691 OpIntBitAnd
656− | NeutLit (LitInt a) <- x
657− , NeutLit (LitInt b) <- y ->
692+ | NeutLit (LitInt a) <- deref x
693+ , NeutLit (LitInt b) <- deref y ->
658694 liftInt (a .&. b)
659695 OpIntBitOr
660− | NeutLit (LitInt a) <- x
661− , NeutLit (LitInt b) <- y ->
696+ | NeutLit (LitInt a) <- deref x
697+ , NeutLit (LitInt b) <- deref y ->
662698 liftInt (a .|. b)
663699 OpIntBitShiftLeft
664− | NeutLit (LitInt a) <- x
665− , NeutLit (LitInt b) <- y ->
700+ | NeutLit (LitInt a) <- deref x
701+ , NeutLit (LitInt b) <- deref y ->
666702 liftInt (shl a b)
667703 OpIntBitShiftRight
668− | NeutLit (LitInt a) <- x
669− , NeutLit (LitInt b) <- y ->
704+ | NeutLit (LitInt a) <- deref x
705+ , NeutLit (LitInt b) <- deref y ->
670706 liftInt (shr a b)
671707 OpIntBitXor
672− | NeutLit (LitInt a) <- x
673− , NeutLit (LitInt b) <- y ->
708+ | NeutLit (LitInt a) <- deref x
709+ , NeutLit (LitInt b) <- deref y ->
674710 liftInt (xor a b)
675711 OpIntBitZeroFillShiftRight
676− | NeutLit (LitInt a) <- x
677− , NeutLit (LitInt b) <- y ->
712+ | NeutLit (LitInt a) <- deref x
713+ , NeutLit (LitInt b) <- deref y ->
678714 liftInt (zshr a b)
679715 OpIntNum OpSubtract
680− | NeutLit (LitInt 0) <- x ->
716+ | NeutLit (LitInt 0) <- deref x ->
681717 evalPrimOp env (Op1 OpIntNegate y)
682718 OpIntNum op
683− | Just result <- evalPrimOpNum OpIntNum liftInt caseInt op x y ->
719+ | Just result <- evalPrimOpNumInt op x y ->
684720 result
685721 OpIntOrd op
686− | NeutLit (LitInt a) <- x
687− , NeutLit (LitInt b) <- y ->
722+ | NeutLit (LitInt a) <- deref x
723+ , NeutLit (LitInt b) <- deref y ->
688724 liftBoolean (evalPrimOpOrd op a b)
689725 OpNumberNum OpSubtract
690− | NeutLit (LitNumber 0.0) <- x ->
726+ | NeutLit (LitNumber 0.0) <- deref x ->
691727 evalPrimOp env (Op1 OpNumberNegate y)
692728 OpNumberNum op
693− | Just result <- evalPrimOpNum OpNumberNum liftNumber caseNumber op x y ->
729+ | Just result <- evalPrimOpNumNumber op x y ->
694730 result
695731 OpNumberOrd op
696− | NeutLit (LitNumber a) <- x
697− , NeutLit (LitNumber b) <- y ->
698− liftBoolean (evalPrimOpOrd op a b)
732+ | NeutLit (LitNumber a) <- deref x
733+ , NeutLit (LitNumber b) <- deref y ->
734+ liftBoolean (evalPrimOpOrdNumber op a b)
699735 OpStringOrd op
700− | NeutLit (LitString a) <- x
701− , NeutLit (LitString b) <- y ->
736+ | NeutLit (LitString a) <- deref x
737+ , NeutLit (LitString b) <- deref y ->
702738 liftBoolean (evalPrimOpOrd op a b)
703739 OpStringAppend
704− | Just result <- evalPrimOpAssocL OpStringAppend caseString (\a b -> liftString (a <> b)) x y ->
705− result
740+ | NeutLit (LitString a) <- x
741+ , NeutLit (LitString b) <- y ->
742+ liftString (a <> b)
743+ OpArrayIndex
744+ | NeutLit (LitInt n) <- y ->
745+ evalAccessor env x (GetIndex n)
706746 OpBooleanAnd -> -- Lazy operator should not be reassociated
707747
708748 case x, y of
@@ -720,44 +760,12 @@ evalPrimOp env = case _ of
720760 NeutFail err, _ -> NeutFail err
721761 _, NeutFail err -> NeutFail err
722762 _, _ ->
723− evalAssocLet2 env x y \_ x' y' ->
724− NeutPrimOp (Op2 op2 x' y')
725−
726−evalPrimOpAssocL :: forall a. BackendOperator2 -> (BackendSemantics -> Maybe a) -> (a -> a -> BackendSemantics) -> BackendSemantics -> BackendSemantics -> Maybe BackendSemantics
727−evalPrimOpAssocL op match combine a b = case match a of
728− Just lhs
729− | Just rhs <- match b ->
730− Just $ combine lhs rhs
731− | Just (Tuple x y) <- decompose b ->
732− case match x of
733− Just rhs ->
734− Just $ liftOp2 op (combine lhs rhs) y
735− Nothing
736− | Just (Tuple v w) <- decompose x
737− , Just rhs <- match v ->
738− Just $ liftOp2 op (liftOp2 op (combine lhs rhs) w) y
739− _ ->
740− Nothing
741− Nothing
742− | Just rhs <- match b
743− , Just (Tuple v w) <- decompose a ->
744− case match w of
745− Just lhs ->
746− Just $ liftOp2 op v (combine lhs rhs)
747− Nothing
748− | Just (Tuple x y) <- decompose w
749− , Just lhs <- match y ->
750− Just $ liftOp2 op (liftOp2 op v x) (combine lhs rhs)
751− _ ->
752− Nothing
753− _ ->
754− Nothing
755− where
756− decompose = case _ of
757− NeutPrimOp (Op2 op' x y) | op == op' ->
758− Just (Tuple x y)
759− _ ->
760− Nothing
763+ floatLet x \x' ->
764+ floatLet y \y' ->
765+ if isAssocPrimOp op2 then
766+ evalAssocOp env (Right op2) x' y'
767+ else
768+ NeutPrimOp (Op2 op2 x' y')
761769
762770evalPrimOpOrd :: forall a. Ord a => BackendOperatorOrd -> a -> a -> Boolean
763771evalPrimOpOrd op x y = case op of
@@ -768,31 +776,50 @@ evalPrimOpOrd op x y = case op of
768776 OpLt -> x < y
769777 OpLte -> x <= y
770778
771−evalPrimOpNum
772− :: forall a
773− . EuclideanRing a
774− => (BackendOperatorNum -> BackendOperator2)
775− -> (a -> BackendSemantics)
776− -> (BackendSemantics -> Maybe a)
777− -> BackendOperatorNum
778− -> BackendSemantics
779− -> BackendSemantics
780− -> Maybe BackendSemantics
781−evalPrimOpNum injOp inj prj op x y = case op of
782− OpAdd ->
783− evalPrimOpAssocL (injOp op) prj (\a b -> inj (a + b)) x y
784− OpMultiply ->
785− evalPrimOpAssocL (injOp op) prj (\a b -> inj (a * b)) x y
786− OpSubtract
787− | Just a <- prj x
788− , Just b <- prj y ->
789− Just $ inj (a - b)
790− OpDivide
791− | Just a <- prj x
792− , Just b <- prj y ->
793− Just $ inj (a / b)
794− _ ->
795− Nothing
779+-- Duplicate because inlined operators behave differently with NaN.
780+-- This just ensures we get the same behavior for const eval.
781+evalPrimOpOrdNumber :: BackendOperatorOrd -> Number -> Number -> Boolean
782+evalPrimOpOrdNumber op x y = case op of
783+ OpEq -> x == y
784+ OpNotEq -> x /= y
785+ OpGt -> x > y
786+ OpGte -> x >= y
787+ OpLt -> x < y
788+ OpLte -> x <= y
789+
790+evalPrimOpNumNumber :: BackendOperatorNum -> BackendSemantics -> BackendSemantics -> Maybe BackendSemantics
791+evalPrimOpNumNumber op x y
792+ | NeutLit (LitNumber a) <- deref x
793+ , NeutLit (LitNumber b) <- deref y =
794+ Just $ liftNumber case op of
795+ OpAdd -> a + b
796+ OpMultiply -> a * b
797+ OpSubtract -> a - b
798+ OpDivide -> a / b
799+ | otherwise =
800+ Nothing
801+
802+evalPrimOpNumInt :: BackendOperatorNum -> BackendSemantics -> BackendSemantics -> Maybe BackendSemantics
803+evalPrimOpNumInt op x y
804+ | NeutLit (LitInt a) <- deref x
805+ , NeutLit (LitInt b) <- deref y =
806+ case op of
807+ OpAdd -> do
808+ let res = a + b
809+ if b > 0 && res < a || b < 0 && res > a then Nothing
810+ else Just $ liftInt res
811+ OpMultiply -> do
812+ let res = a * b
813+ if a /= (res / b) then Nothing
814+ else Just $ liftInt res
815+ OpSubtract -> do
816+ let res = a - b
817+ if b > 0 && res > a || b < 0 && res < a then Nothing
818+ else Just $ liftInt res
819+ OpDivide ->
820+ Just $ liftInt (a / b)
821+ | otherwise =
822+ Nothing
796823
797824evalPrimOpNot :: BackendOperator BackendSemantics -> BackendSemantics
798825evalPrimOpNot = case _ of
@@ -826,10 +853,91 @@ primOpOrdNot = case _ of
826853 OpGt -> OpLte
827854 OpGte -> OpLt
828855
829−evalExtern :: Env -> Qualified Ident -> Array ExternSpine -> BackendSemantics
830−evalExtern env@(Env e) qual spine = case e.evalExtern env qual spine of
831− Nothing -> SemExtern qual spine (defer \_ -> neutralSpine (NeutVar qual) spine)
832− Just sem -> sem
856+isAssocPrimOp :: BackendOperator2 -> Boolean
857+isAssocPrimOp = case _ of
858+ OpIntNum OpAdd -> true
859+ OpIntNum OpMultiply -> true
860+ OpNumberNum OpAdd -> true
861+ OpNumberNum OpMultiply -> true
862+ OpStringAppend -> true
863+ _ -> false
864+
865+evalAssocOp :: Env -> Either (Qualified Ident) BackendOperator2 -> BackendSemantics -> BackendSemantics -> BackendSemantics
866+evalAssocOp env op1 = case _, _ of
867+ SemAssocOp op2 as, SemAssocOp op3 bs
868+ | op1 == op2
869+ , op2 == op3 ->
870+ case evalAssocOp' env op1 (NonEmptyArray.last as) (NonEmptyArray.head bs) of
871+ SemAssocOp op4 cs
872+ | op3 == op4 ->
873+ SemAssocOp op1 $ NonEmptyArray.prependArray (NonEmptyArray.init as) (NonEmptyArray.appendArray cs (NonEmptyArray.tail bs))
874+ c ->
875+ SemAssocOp op1 $ NonEmptyArray.prependArray (NonEmptyArray.init as) (NonEmptyArray.cons' c (NonEmptyArray.tail bs))
876+ a, SemAssocOp op2 bs
877+ | op1 == op2 ->
878+ case evalAssocOp' env op1 a (NonEmptyArray.head bs) of
879+ SemAssocOp op3 cs
880+ | op2 == op3 ->
881+ SemAssocOp op1 $ NonEmptyArray.appendArray cs (NonEmptyArray.tail bs)
882+ a' ->
883+ SemAssocOp op1 $ NonEmptyArray.cons' a' (NonEmptyArray.tail bs)
884+ SemAssocOp op2 as, b
885+ | op1 == op2 ->
886+ case evalAssocOp' env op1 (NonEmptyArray.last as) b of
887+ SemAssocOp op3 cs
888+ | op2 == op3 ->
889+ SemAssocOp op1 $ NonEmptyArray.prependArray (NonEmptyArray.init as) cs
890+ b' ->
891+ SemAssocOp op1 $ NonEmptyArray.snoc' (NonEmptyArray.init as) b'
892+ a, b ->
893+ SemAssocOp op1 $ NonEmptyArray.cons' a [ b ]
894+
895+evalAssocOp' :: Env -> Either (Qualified Ident) BackendOperator2 -> BackendSemantics -> BackendSemantics -> BackendSemantics
896+evalAssocOp' env@(Env e) op a b = case op of
897+ Left qual ->
898+ case e.evalExternSpine env qual [ ExternApp [ a, b ] ] of
899+ Just res ->
900+ res
901+ Nothing ->
902+ SemAssocOp op $ NonEmptyArray.cons' a [ b ]
903+ Right primOp ->
904+ evalPrimOp env (Op2 primOp a b)
905+
906+evalRef :: Env -> EvalRef -> Array ExternSpine -> ExternSpine -> Lazy BackendSemantics -> BackendSemantics
907+evalRef env@(Env e) ref spine last sem = case ref of
908+ EvalExtern qual
909+ | Just sem' <- e.evalExternSpine env qual spine' ->
910+ sem'
911+ _ ->
912+ SemRef ref spine' $ defer \_ ->
913+ deref $ evalRefSpine env ref spine' sem last
914+ where
915+ spine' = snocSpine spine last
916+
917+evalRefSpine :: Env -> EvalRef -> Array ExternSpine -> Lazy BackendSemantics -> ExternSpine -> BackendSemantics
918+evalRefSpine env ref spine sem = case _ of
919+ ExternApp _ ->
920+ neutralSpine (evalEvalRef ref) spine
921+ ExternUncurriedApp _ ->
922+ neutralSpine (evalEvalRef ref) spine
923+ ExternAccessor acc ->
924+ evalAccessor env (force sem) acc
925+ ExternPrimOp op ->
926+ evalPrimOp env (Op1 op (force sem))
927+
928+evalEvalRef :: EvalRef -> BackendSemantics
929+evalEvalRef = case _ of
930+ EvalExtern qual ->
931+ NeutVar qual
932+ EvalLocal ident lvl ->
933+ NeutLocal ident lvl
934+
935+snocSpine :: Array ExternSpine -> ExternSpine -> Array ExternSpine
936+snocSpine spine = case _ of
937+ ExternApp apps ->
938+ foldl snocApp spine apps
939+ other ->
940+ Array.snoc spine other
833941
834942envForGroup :: Env -> EvalRef -> InlineAccessor -> Array (Qualified Ident) -> Env
835943envForGroup env ref acc group
@@ -974,6 +1082,30 @@ evalExternFromImpl env@(Env e) qual (Tuple analysis impl) spine = case spine of
9741082 _ ->
9751083 Nothing
9761084
1085+evalExternRefFromImpl :: Env -> Qualified Ident -> Tuple BackendAnalysis ExternImpl -> BackendSemantics
1086+evalExternRefFromImpl env qual (Tuple _ impl) = case impl of
1087+ ExternExpr group (NeutralExpr expr)
1088+ | isRefExpr expr ->
1089+ eval (envForGroup env (EvalExtern qual) InlineRef group) expr
1090+ ExternDict group props ->
1091+ NeutLit $ LitRecord $ map
1092+ ( \(Prop prop (Tuple _ (NeutralExpr expr))) ->
1093+ Prop prop $ eval (envForGroup env (EvalExtern qual) (InlineProp prop) group) expr
1094+ )
1095+ props
1096+ _ ->
1097+ NeutVar qual
1098+
1099+isRefExpr :: forall a. BackendSyntax a -> Boolean
1100+isRefExpr = case _ of
1101+ Var _ -> true
1102+ Lit _ -> true
1103+ CtorSaturated _ _ _ _ _ -> true
1104+ Accessor _ _ -> true
1105+ Update _ _ -> true
1106+ PrimOp _ -> true
1107+ _ -> false
1108+
9771109analysisFromDirective :: BackendAnalysis -> InlineDirective -> BackendAnalysis
9781110analysisFromDirective (BackendAnalysis analysis) = case _ of
9791111 InlineAlways ->
@@ -1018,14 +1150,25 @@ caseNumber = case _ of
10181150 NeutLit (LitNumber a) -> Just a
10191151 _ -> Nothing
10201152
1021−type Ctx =
1153+newtype Ctx = Ctx
10221154 { currentLevel :: Int
1023− , lookupExtern :: Tuple (Qualified Ident) (Maybe BackendAccessor) -> Maybe (Tuple BackendAnalysis NeutralExpr)
1155+ , lookupExtern :: Qualified Ident -> Maybe String -> Maybe BackendAnalysis
1156+ , analyze :: Ctx -> BackendSyntax BackendExpr -> BackendAnalysis
10241157 , effect :: Boolean
10251158 }
10261159
10271160nextLevel :: Ctx -> Tuple Level Ctx
1028−nextLevel ctx = Tuple (Level ctx.currentLevel) $ ctx { currentLevel = ctx.currentLevel + 1 }
1161+nextLevel (Ctx ctx) = Tuple (Level ctx.currentLevel) $ Ctx ctx { currentLevel = ctx.currentLevel + 1 }
1162+
1163+effectfully :: Ctx -> Ctx
1164+effectfully (Ctx ctx)
1165+ | ctx.effect = Ctx ctx
1166+ | otherwise = Ctx ctx { effect = true }
1167+
1168+purely :: Ctx -> Ctx
1169+purely (Ctx ctx)
1170+ | ctx.effect = Ctx ctx { effect = false }
1171+ | otherwise = Ctx ctx
10291172
10301173quote :: Ctx -> BackendSemantics -> BackendExpr
10311174quote = go
@@ -1034,33 +1177,41 @@ quote = go
10341177 -- Block constructors
10351178 SemLet ident binding k -> do
10361179 let Tuple level ctx' = nextLevel ctx
1037− build ctx $ Let ident level (quote (ctx { effect = false }) binding) $ quote ctx' $ k $ NeutLocal ident level
1180+ build ctx $ Let ident level (quote (purely ctx) binding) $ quote ctx' $ k $ SemRef (EvalLocal ident level) [] $ defer \_ -> deref binding
10381181 SemLetRec bindings k -> do
10391182 let Tuple level ctx' = nextLevel ctx
1183+ -- We are not currently propagating references
1184+ -- to recursive bindings. The language requires
1185+ -- a runtime check for strictly recursive bindings
1186+ -- which we don't currently implement.
10401187 let neutBindings = (\(Tuple ident _) -> Tuple ident $ defer \_ -> NeutLocal (Just ident) level) <$> bindings
10411188 build ctx $ LetRec level
1042− (map (\b -> quote (ctx' { effect = false }) $ b neutBindings) <$> bindings)
1189+ (map (\b -> quote (purely ctx') $ b neutBindings) <$> bindings)
10431190 (quote ctx' $ k neutBindings)
10441191 SemEffectBind ident binding k -> do
1045− let ctx' = ctx { effect = true }
1192+ let ctx' = effectfully ctx
10461193 let Tuple level ctx'' = nextLevel ctx'
10471194 build ctx $ EffectBind ident level (quote ctx' binding) $ quote ctx'' $ k $ NeutLocal ident level
10481195 SemEffectPure sem ->
1049− build ctx $ EffectPure (quote (ctx { effect = false }) sem)
1196+ build ctx $ EffectPure (quote (purely ctx) sem)
10501197 SemEffectDefer sem ->
1051− build ctx $ EffectDefer (quote (ctx { effect = true }) sem)
1198+ build ctx $ EffectDefer (quote (effectfully ctx) sem)
10521199 SemBranch branches def -> do
1053− let ctx' = ctx { effect = false }
1200+ let ctx' = purely ctx
10541201 let quoteCond (SemConditional a b) = Pair (quote ctx' $ force a) (quote ctx $ force b)
10551202 let branches' = quoteCond <$> branches
10561203 foldr (buildBranchCond ctx) (quote ctx <<< force $ def) branches'
10571204
10581205 -- Non-block constructors
1059− SemExtern _ _ sem ->
1060− go ctx (force sem)
1206+ SemRef ref sp _ ->
1207+ case ref of
1208+ EvalExtern qual ->
1209+ go ctx $ neutralSpine (NeutVar qual) sp
1210+ EvalLocal ident lvl ->
1211+ go ctx $ neutralSpine (NeutLocal ident lvl) sp
10611212 SemLam ident k -> do
10621213 let Tuple level ctx' = nextLevel ctx
1063− build ctx $ Abs (NonEmptyArray.singleton (Tuple ident level)) $ quote (ctx' { effect = false }) $ k $ NeutLocal ident level
1214+ build ctx $ Abs (NonEmptyArray.singleton (Tuple ident level)) $ quote (purely ctx') $ k $ NeutLocal ident level
10641215 SemMkFn pro -> do
10651216 let
10661217 loop ctx' idents = case _ of
@@ -1068,7 +1219,7 @@ quote = go
10681219 let Tuple lvl ctx'' = nextLevel ctx'
10691220 loop ctx'' (Array.snoc idents (Tuple ident lvl)) (k (NeutLocal ident lvl))
10701221 MkFnApplied body ->
1071− build ctx' $ UncurriedAbs idents $ quote (ctx' { effect = false }) body
1222+ build ctx' $ UncurriedAbs idents $ quote (purely ctx') body
10721223 loop ctx [] pro
10731224 SemMkEffectFn pro -> do
10741225 let
@@ -1077,30 +1228,38 @@ quote = go
10771228 let Tuple lvl ctx'' = nextLevel ctx'
10781229 loop ctx'' (Array.snoc idents (Tuple ident lvl)) (k (NeutLocal ident lvl))
10791230 MkFnApplied body ->
1080− build ctx' $ UncurriedEffectAbs idents $ quote (ctx' { effect = false }) body
1231+ build ctx' $ UncurriedEffectAbs idents $ quote (purely ctx') body
10811232 loop ctx [] pro
1233+ SemAssocOp op spine ->
1234+ foldl1Array
1235+ ( \a b -> case op of
1236+ Left qual ->
1237+ build ctx $ App (build ctx (Var qual)) $ NonEmptyArray.cons' a [ quote ctx b ]
1238+ Right primOp ->
1239+ build ctx $ PrimOp (Op2 primOp a (quote ctx b))
1240+ )
1241+ (quote ctx)
1242+ spine
10821243 NeutLocal ident level ->
10831244 build ctx $ Local ident level
10841245 NeutVar qual ->
10851246 build ctx $ Var qual
10861247 NeutStop qual ->
10871248 buildStop ctx qual
1088− NeutData qual _ _ _ [] ->
1089− build ctx $ Var qual
10901249 NeutData qual ct ty tag values ->
10911250 build ctx $ CtorSaturated qual ct ty tag (map (quote ctx) <$> values)
10921251 NeutCtorDef _ ct ty tag fields ->
10931252 build ctx $ CtorDef ct ty tag fields
10941253 NeutUncurriedApp hd spine -> do
1095− let ctx' = ctx { effect = false }
1254+ let ctx' = purely ctx
10961255 let hd' = quote ctx' hd
10971256 build ctx $ UncurriedApp hd' (quote ctx' <$> spine)
10981257 NeutUncurriedEffectApp hd spine -> do
1099− let ctx' = ctx { effect = false }
1258+ let ctx' = purely ctx
11001259 let hd' = quote ctx' hd
11011260 build ctx $ UncurriedEffectApp hd' (quote ctx' <$> spine)
11021261 NeutApp hd spine -> do
1103− let ctx' = ctx { effect = false }
1262+ let ctx' = purely ctx
11041263 let hd' = quote ctx' hd
11051264 case NonEmptyArray.fromArray (quote ctx' <$> spine) of
11061265 Nothing ->
@@ -1116,7 +1275,7 @@ quote = go
11161275 NeutPrimOp op ->
11171276 build ctx $ PrimOp (quote ctx <$> op)
11181277 NeutPrimEffect eff ->
1119− build ctx $ PrimEffect (quote (ctx { effect = false }) <$> eff)
1278+ build ctx $ PrimEffect (quote (purely ctx) <$> eff)
11201279 NeutPrimUndefined ->
11211280 build ctx PrimUndefined
11221281 NeutFail err ->
@@ -1128,37 +1287,23 @@ build ctx = case _ of
11281287 build ctx $ App hd (tl1 <> tl2)
11291288 Abs ids1 (ExprSyntax _ (Abs ids2 body)) ->
11301289 build ctx $ Abs (ids1 <> ids2) body
1131− expr@(Let ident1 level1 (ExprSyntax _ (Let ident2 level2 binding2 body2)) body1) ->
1132− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteLetAssoc
1133− [ { ident: ident2, level: level2, binding: binding2 }
1134− , { ident: ident1, level: level1, binding: body2 }
1135− ]
1136− body1
1137− expr@(Let ident1 level1 (ExprRewrite _ (RewriteLetAssoc bindings body2)) body1) ->
1138− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteLetAssoc
1139− (Array.snoc bindings { ident: ident1, level: level1, binding: body2 })
1140− body1
11411290 Let ident level binding body
11421291 | shouldInlineLet level binding body ->
11431292 rewriteInline ident level binding body
1144− Let ident level binding body
1145− | Just expr' <- shouldUncurryAbs ident level binding body ->
1146− expr'
1147− Let ident level binding body
1148− | Just expr' <- shouldUnpackRecord ident level binding body ->
1149− expr'
1150− Let ident level binding body
1151− | Just expr' <- shouldUnpackUpdate ident level binding body ->
1152− expr'
1153− Let ident level binding body
1154− | Just expr' <- shouldUnpackCtor ident level binding body ->
1155− expr'
1156− Let ident level binding body
1157− | Just expr' <- shouldDistributeBranches ident level binding body ->
1158− expr'
1159− Let _ level binding body
1160− | Just expr' <- shouldEtaReduce level binding body ->
1161− expr'
1293+ | Just expr <- shouldUncurryAbs ident level binding body ->
1294+ expr
1295+ | Just expr <- shouldUnpackRecord ident level binding body ->
1296+ expr
1297+ | Just expr <- shouldUnpackUpdate ident level binding body ->
1298+ expr
1299+ | Just expr <- shouldUnpackCtor ident level binding body ->
1300+ expr
1301+ | Just expr <- shouldUnpackArray ident level binding body ->
1302+ expr
1303+ | Just expr <- shouldDistributeBranches ident level binding body ->
1304+ expr
1305+ | Just expr <- shouldEtaReduce level binding body ->
1306+ expr
11621307 App (ExprSyntax analysis (Branch bs def)) tl
11631308 | Just expr' <- shouldDistributeBranchApps analysis bs def tl ->
11641309 expr'
@@ -1177,29 +1322,6 @@ build ctx = case _ of
11771322 PrimOp (Op2 op2 lhs (ExprSyntax analysis (Branch bs def)))
11781323 | Just expr' <- shouldDistributeBranchPrimOp2R analysis bs def lhs op2 ->
11791324 expr'
1180− expr@(EffectBind ident1 level1 (ExprSyntax _ (EffectBind ident2 level2 binding2 body2)) body1) ->
1181− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteEffectBindAssoc
1182− [ { ident: ident2, level: level2, binding: binding2, pure: false }
1183− , { ident: ident1, level: level1, binding: body2, pure: false }
1184− ]
1185− body1
1186− expr@(EffectBind ident1 level1 (ExprSyntax _ (Let ident2 level2 binding2 body2)) body1) ->
1187− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteEffectBindAssoc
1188− [ { ident: ident2, level: level2, binding: binding2, pure: true }
1189− , { ident: ident1, level: level1, binding: body2, pure: false }
1190− ]
1191− body1
1192− expr@(EffectBind ident1 level1 (ExprRewrite _ (RewriteEffectBindAssoc bindings body2)) body1) ->
1193− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteEffectBindAssoc
1194− (Array.snoc bindings { ident: ident1, level: level1, binding: body2, pure: false })
1195− body1
1196− expr@(EffectBind ident1 level1 (ExprRewrite _ (RewriteLetAssoc bindings body2)) body1) ->
1197− ExprRewrite (withRewrite (analyzeDefault ctx expr)) $ RewriteEffectBindAssoc
1198− (Array.snoc (withPure <$> bindings) { ident: ident1, level: level1, binding: body2, pure: false })
1199− body1
1200− where
1201− withPure { ident, level, binding } =
1202− { ident, level, binding, pure: true }
12031325 EffectBind ident level (ExprSyntax _ (EffectPure binding)) body ->
12041326 build ctx $ EffectDefer $ build ctx $ Let ident level binding body
12051327 EffectBind ident level (ExprSyntax _ (EffectDefer binding)) body ->
@@ -1210,74 +1332,86 @@ build ctx = case _ of
12101332 binding
12111333 EffectDefer expr@(ExprSyntax _ (EffectDefer _)) ->
12121334 expr
1213− Branch pairs def | Just expr <- simplifyBranches ctx pairs def ->
1214− expr
12151335 PrimOp (Op1 OpBooleanNot (ExprSyntax _ (PrimOp (Op1 OpBooleanNot expr)))) ->
12161336 expr
12171337 expr ->
12181338 buildDefault ctx expr
12191339
12201340buildBranchCond :: Ctx -> Pair BackendExpr -> BackendExpr -> BackendExpr
1221−buildBranchCond ctx (Pair a b) c = case b of
1222− ExprSyntax _ (Lit (LitBoolean true))
1223− | ExprSyntax _ (Lit (LitBoolean true)) <- c ->
1224− c
1225− | ExprSyntax _ (Lit (LitBoolean false)) <- c ->
1226− a
1227− | ExprSyntax _ x <- c, isBooleanTail x ->
1228− build ctx (PrimOp (Op2 OpBooleanOr a c))
1229− ExprSyntax _ (Lit (LitBoolean false))
1230− | ExprSyntax _ (Lit (LitBoolean false)) <- c ->
1231− c
1232− | ExprSyntax _ (PrimOp (Op1 (OpIsTag _) (ExprSyntax _ x1))) <- a
1233− , ExprSyntax _ (PrimOp (Op1 (OpIsTag _) (ExprSyntax _ x2))) <- c
1234− , isSameVariable x1 x2 ->
1235− c
1236− _ ->
1237− build ctx (Branch (NonEmptyArray.singleton (Pair a b)) c)
1238− where
1239− isSameVariable = case _, _ of
1240− Local _ l, Local _ r -> l == r
1241− Var l, Var r -> l == r
1242− _, _ -> false
1243−
1244−isBooleanTail :: forall a. BackendSyntax a -> Boolean
1245−isBooleanTail = case _ of
1246− Lit _ -> true
1247− Var _ -> true
1248− Local _ _ -> true
1249− PrimOp _ -> true
1250− _ -> false
1341+buildBranchCond ctx pair def
1342+ | Just expr <- simplifyCondIsTag ctx pair def =
1343+ expr
1344+ | Just expr <- simplifyCondBoolean ctx pair def =
1345+ expr
1346+ | Just expr <- simplifyCondLiftAnd ctx pair def =
1347+ expr
1348+ | Just expr <- simplifyCondRedundantElse ctx pair def =
1349+ expr
1350+ | ExprSyntax _ (Branch pairs def') <- def =
1351+ build ctx (Branch (NonEmptyArray.cons pair pairs) def')
1352+ | otherwise =
1353+ build ctx (Branch (NonEmptyArray.singleton pair) def)
1354+
1355+simplifyCondIsTag :: Ctx -> Pair BackendExpr -> BackendExpr -> Maybe BackendExpr
1356+simplifyCondIsTag _ = case _, _ of
1357+ Pair (ExprSyntax _ (PrimOp (Op1 (OpIsTag _) x1))) (ExprSyntax _ (Lit (LitBoolean false))), def@(ExprSyntax _ (PrimOp (Op1 (OpIsTag _) x2)))
1358+ | x1 == x2 ->
1359+ Just def
1360+ _, _ ->
1361+ Nothing
12511362
1252−simplifyBranches :: Ctx -> NonEmptyArray (Pair BackendExpr) -> BackendExpr -> Maybe BackendExpr
1253−simplifyBranches ctx pairs def = case NonEmptyArray.toArray pairs of
1254− [ a ]
1255− | Pair expr (ExprSyntax _ (Lit (LitBoolean true))) <- a
1256− , ExprSyntax _ (Lit (LitBoolean false)) <- def ->
1363+simplifyCondBoolean :: Ctx -> Pair BackendExpr -> BackendExpr -> Maybe BackendExpr
1364+simplifyCondBoolean ctx = case _, _ of
1365+ Pair expr body@(ExprSyntax _ (Lit (LitBoolean body'))), ExprSyntax _ (Lit (LitBoolean other))
1366+ | body' == other ->
1367+ Just body
1368+ | body' && not other ->
12571369 Just expr
1258− | Pair expr (ExprSyntax _ (Lit (LitBoolean false))) <- a
1259− , ExprSyntax _ (Lit (LitBoolean true)) <- def ->
1370+ | not body' && other ->
12601371 Just $ build ctx $ PrimOp (Op1 OpBooleanNot expr)
1261− [ a, b ]
1262− | Pair expr1@(ExprSyntax _ (Local _ lvl1)) body1 <- a
1263− , Pair (ExprSyntax _ (PrimOp (Op1 OpBooleanNot (ExprSyntax _ (Local _ lvl2))))) body2 <- b
1264− , ExprSyntax _ (Fail _) <- def
1265− , lvl1 == lvl2 ->
1266− Just $ build ctx $ Branch (NonEmptyArray.singleton (Pair expr1 body1)) body2
1267− _
1268− | ExprSyntax _ (Branch pairs2 def2) <- def ->
1269− Just $ build ctx (Branch (pairs <> pairs2) def2)
1270− | otherwise ->
1271− Nothing
1372+ Pair expr (ExprSyntax _ (Lit (LitBoolean true))), other
1373+ | isSimplePredicate other ->
1374+ Just $ build ctx $ PrimOp (Op2 OpBooleanOr expr other)
1375+ Pair expr body, ExprSyntax _ (Lit (LitBoolean false)) ->
1376+ Just $ build ctx $ PrimOp (Op2 OpBooleanAnd expr body)
1377+ _, _ ->
1378+ Nothing
1379+
1380+isSimplePredicate :: BackendExpr -> Boolean
1381+isSimplePredicate = case _ of
1382+ ExprSyntax _ expr ->
1383+ case expr of
1384+ Lit _ -> true
1385+ Var _ -> true
1386+ Local _ _ -> true
1387+ PrimOp _ -> true
1388+ _ -> false
1389+ _ ->
1390+ false
1391+
1392+simplifyCondRedundantElse :: Ctx -> Pair BackendExpr -> BackendExpr -> Maybe BackendExpr
1393+simplifyCondRedundantElse ctx = case _, _ of
1394+ Pair expr1 body1, ExprSyntax _ (Branch pairs _)
1395+ | Pair (ExprSyntax _ (PrimOp (Op1 OpBooleanNot expr2))) body2 <- NonEmptyArray.head pairs
1396+ , expr1 == expr2 ->
1397+ Just $ buildBranchCond ctx (Pair expr1 body1) body2
1398+ _, _ ->
1399+ Nothing
1400+
1401+simplifyCondLiftAnd :: Ctx -> Pair BackendExpr -> BackendExpr -> Maybe BackendExpr
1402+simplifyCondLiftAnd ctx pair def1 = case pair of
1403+ Pair x (ExprSyntax _ (Branch pairs def2))
1404+ | [ Pair y z ] <- NonEmptyArray.toArray pairs
1405+ , def1 == def2 ->
1406+ Just $ buildBranchCond ctx (Pair (build ctx (PrimOp (Op2 OpBooleanAnd x y))) z) def1
1407+ _ ->
1408+ Nothing
12721409
12731410buildStop :: Ctx -> Qualified Ident -> BackendExpr
1274−buildStop ctx stop = ExprRewrite (analyzeDefault ctx (Var stop)) (RewriteStop stop)
1411+buildStop ctx@(Ctx { analyze }) stop = ExprRewrite (analyze ctx (Var stop)) (RewriteStop stop)
12751412
12761413buildDefault :: Ctx -> BackendSyntax BackendExpr -> BackendExpr
1277−buildDefault ctx expr = ExprSyntax (analyzeDefault ctx expr) expr
1278−
1279−analyzeDefault :: Ctx -> BackendSyntax BackendExpr -> BackendAnalysis
1280−analyzeDefault ctx = (if ctx.effect then analyzeEffectBlock else analyze) (foldMap fst <<< ctx.lookupExtern)
1414+buildDefault ctx@(Ctx { analyze }) expr = ExprSyntax (analyze ctx expr) expr
12811415
12821416rewriteInline :: Maybe Ident -> Level -> BackendExpr -> BackendExpr -> BackendExpr
12831417rewriteInline ident level binding body = do
@@ -1350,6 +1484,19 @@ shouldUnpackUpdate ident level binding body = do
13501484 _ ->
13511485 Nothing
13521486
1487+shouldUnpackArray :: Maybe Ident -> Level -> BackendExpr -> BackendExpr -> Maybe BackendExpr
1488+shouldUnpackArray ident level binding body = do
1489+ let BackendAnalysis s2 = analysisOf body
1490+ case binding of
1491+ ExprSyntax _ (Lit (LitArray exprs))
1492+ | Just (Usage us) <- Map.lookup level s2.usages
1493+ , us.total == us.access -> do
1494+ -- TODO: Not sure what to do about analysis, or if it matters.
1495+ let analysis = foldr (append <<< analysisOf) (complex NonTrivial (bound level (BackendAnalysis s2))) exprs
1496+ Just $ ExprRewrite (withRewrite analysis) $ RewriteUnpackOp ident level (UnpackArray exprs) body
1497+ _ ->
1498+ Nothing
1499+
13531500shouldDistributeBranches :: Maybe Ident -> Level -> BackendExpr -> BackendExpr -> Maybe BackendExpr
13541501shouldDistributeBranches ident level a body = do
13551502 let BackendAnalysis s2 = analysisOf body
@@ -1454,7 +1601,7 @@ shouldInlineExternReference _ (BackendAnalysis s) _ =
14541601shouldInlineExternApp :: Qualified Ident -> BackendAnalysis -> NeutralExpr -> Spine BackendSemantics -> Boolean
14551602shouldInlineExternApp _ (BackendAnalysis s) _ args =
14561603 (s.complexity <= Deref && s.size < 16)
1457− || (Map.isEmpty s.usages && Set.isEmpty s.deps && s.size < 64)
1604+ || (Map.isEmpty s.usages && not s.externs && s.size < 64)
14581605 || (delayed && Array.length s.args <= Array.length args && s.size < 16)
14591606 || (delayed && or (Array.zipWith shouldInlineExternAppArg s.args args) && s.size < 16)
14601607 where
@@ -1499,94 +1646,72 @@ newtype NeutralExpr = NeutralExpr (BackendSyntax NeutralExpr)
14991646
15001647derive instance Newtype NeutralExpr _
15011648
1502−optimize :: Ctx -> Env -> Qualified Ident -> Int -> BackendExpr -> BackendExpr
1503−optimize ctx env (Qualified mn (Ident id)) initN = go initN
1649+optimize :: Boolean -> Ctx -> Env -> Qualified Ident -> Int -> BackendExpr -> Tuple (Array BackendExpr) BackendExpr
1650+optimize traceSteps ctx env (Qualified mn (Ident id)) initN originalExpr =
1651+ go (if traceSteps then pure originalExpr else List.Nil) initN originalExpr
15041652 where
1505− go n expr1
1653+ go steps n expr1 = do
1654+ let Tuple rewrite expr2 = goStep n expr1
1655+ let newSteps = if traceSteps then List.Cons expr2 steps else steps
1656+ if rewrite then
1657+ go newSteps (n - 1) expr2
1658+ else
1659+ Tuple (Array.reverse (List.toUnfoldable newSteps)) expr2
1660+
1661+ goStep :: Int -> BackendExpr -> Tuple Boolean BackendExpr
1662+ goStep n expr1
15061663 | n == 0 = do
1507− -- expr1
15081664 let name = foldMap ((_ <> ".") <<< unwrap) mn <> id
15091665 unsafeCrashWith $ name <> ": Possible infinite optimization loop."
15101666 | otherwise = do
15111667 let expr2 = quote ctx (eval env expr1)
15121668 let BackendAnalysis { rewrite } = analysisOf expr2
1513− if rewrite then
1514− go (n - 1) expr2
1515− else
1516− expr2
1669+ Tuple rewrite expr2
15171670
15181671freeze :: BackendExpr -> Tuple BackendAnalysis NeutralExpr
1519−freeze init = Tuple (analysisOf init) (go init)
1672+freeze init = Tuple (analysisOf init) $ foldBackendExpr NeutralExpr (\_ neutExpr -> neutExpr) init
1673+
1674+foldBackendExpr :: forall a. (BackendSyntax a -> a) -> (BackendRewrite BackendExpr -> a -> a) -> BackendExpr -> a
1675+foldBackendExpr foldSyntax foldRewrite = go
15201676 where
15211677 go = case _ of
15221678 ExprSyntax _ expr ->
1523− NeutralExpr $ go <$> expr
1524− ExprRewrite _ rewrite ->
1679+ foldSyntax $ go <$> expr
1680+ ExprRewrite _ rewrite -> foldRewrite rewrite
15251681 case rewrite of
15261682 RewriteInline ident level binding body ->
1527− NeutralExpr $ Let ident level (go binding) (go body)
1683+ foldSyntax $ Let ident level (go binding) (go body)
15281684 RewriteUncurry ident level args binding body ->
1529− NeutralExpr $ Let ident level (NeutralExpr (Abs args (go binding))) (go body)
1685+ foldSyntax $ Let ident level (foldSyntax (Abs args (go binding))) (go body)
15301686 RewriteStop qual ->
1531− NeutralExpr $ Var qual
1532− RewriteLetAssoc bindings body ->
1533− case NonEmptyArray.fromArray bindings of
1534− Just bindings' -> do
1535− let
1536− { ident, level, binding } = foldl1Array
1537− ( \inner outer -> outer
1538− { binding =
1539− NeutralExpr $ Let inner.ident inner.level inner.binding (go outer.binding)
1540− }
1541− )
1542− (\outer -> outer { binding = go outer.binding })
1543− bindings'
1544− NeutralExpr $ Let ident level binding (go body)
1545− Nothing ->
1546− go body
1547− RewriteEffectBindAssoc bindings body ->
1548− case NonEmptyArray.fromArray bindings of
1549− Just bindings' -> do
1550− let
1551− { ident, level, binding } = foldl1Array
1552− ( \inner outer -> outer
1553− { binding =
1554− if inner.pure then
1555− NeutralExpr $ Let inner.ident inner.level inner.binding (go outer.binding)
1556− else
1557− NeutralExpr $ EffectBind inner.ident inner.level inner.binding (go outer.binding)
1558− }
1559− )
1560− (\outer -> outer { binding = go outer.binding })
1561− bindings'
1562− NeutralExpr $ Let ident level binding (go body)
1563− Nothing ->
1564− go body
1687+ foldSyntax $ Var qual
15651688 RewriteUnpackOp ident level op body ->
15661689 case op of
15671690 UnpackRecord props ->
1568− NeutralExpr $ Let ident level (NeutralExpr (Lit (LitRecord (map go <$> props)))) (go body)
1691+ foldSyntax $ Let ident level (foldSyntax (Lit (LitRecord (map go <$> props)))) (go body)
15691692 UnpackUpdate hd props ->
1570− NeutralExpr $ Let ident level (NeutralExpr (Update (go hd) (map go <$> props))) (go body)
1693+ foldSyntax $ Let ident level (foldSyntax (Update (go hd) (map go <$> props))) (go body)
1694+ UnpackArray exprs ->
1695+ foldSyntax $ Let ident level (foldSyntax (Lit (LitArray (go <$> exprs)))) (go body)
15711696 UnpackData qual ct ty tag values ->
1572− NeutralExpr $ Let ident level (NeutralExpr (CtorSaturated qual ct ty tag (map go <$> values))) (go body)
1697+ foldSyntax $ Let ident level (foldSyntax (CtorSaturated qual ct ty tag (map go <$> values))) (go body)
15731698 RewriteDistBranchesLet ident level branches def body ->
1574− NeutralExpr $ Let ident level (NeutralExpr (Branch (map go <$> branches) (go def))) (go body)
1699+ foldSyntax $ Let ident level (foldSyntax (Branch (map go <$> branches) (go def))) (go body)
15751700 RewriteDistBranchesOp branches def op -> do
1576− let branches' = NeutralExpr $ Branch (map go <$> branches) (go def)
1701+ let branches' = foldSyntax $ Branch (map go <$> branches) (go def)
15771702 case op of
15781703 DistApp spine ->
1579− NeutralExpr $ App branches' (go <$> spine)
1704+ foldSyntax $ App branches' (go <$> spine)
15801705 DistUncurriedApp spine ->
1581− NeutralExpr $ UncurriedApp branches' (go <$> spine)
1706+ foldSyntax $ UncurriedApp branches' (go <$> spine)
15821707 DistAccessor acc ->
1583− NeutralExpr $ Accessor branches' acc
1708+ foldSyntax $ Accessor branches' acc
15841709 DistPrimOp1 op1 ->
1585− NeutralExpr $ PrimOp $ Op1 op1 branches'
1710+ foldSyntax $ PrimOp $ Op1 op1 branches'
15861711 DistPrimOp2L op2 rhs ->
1587− NeutralExpr $ PrimOp $ Op2 op2 branches' (go rhs)
1712+ foldSyntax $ PrimOp $ Op2 op2 branches' (go rhs)
15881713 DistPrimOp2R lhs op2 ->
1589− NeutralExpr $ PrimOp $ Op2 op2 (go lhs) branches'
1714+ foldSyntax $ PrimOp $ Op2 op2 (go lhs) branches'
15901715
15911716evalMkFn :: Env -> Int -> BackendSemantics -> MkFn BackendSemantics
15921717evalMkFn env n sem
src/PureScript/Backend/Optimizer/Semantics/Foreign.purs+39−110
@@ -4,8 +4,8 @@ import Prelude
44
55import Data.Array as Array
66import Data.Array.NonEmpty as NonEmptyArray
7+import Data.Either (Either(..))
78import Data.Enum (fromEnum)
8−import Data.Lazy as Lazy
99import Data.List as List
1010import Data.Map (Map)
1111import Data.Map as Map
@@ -13,7 +13,7 @@ import Data.Maybe (Maybe(..))
1313import Data.String as String
1414import Data.Tuple (Tuple(..))
1515import PureScript.Backend.Optimizer.CoreFn (Ident(..), Literal(..), ModuleName(..), Prop(..), Qualified(..), propKey)
16−import PureScript.Backend.Optimizer.Semantics (BackendSemantics(..), Env, ExternSpine(..), evalAccessor, evalApp, evalMkFn, evalPrimOp, evalUncurriedApp, evalUncurriedEffectApp, evalUpdate, liftBoolean, makeLet)
16+import PureScript.Backend.Optimizer.Semantics (BackendSemantics(..), Env, EvalRef(..), ExternSpine(..), evalAccessor, evalApp, evalAssocOp, evalMkFn, evalPrimOp, evalUncurriedApp, evalUncurriedEffectApp, evalUpdate, liftBoolean, makeEffectBind, makeLet)
1717import PureScript.Backend.Optimizer.Syntax (BackendAccessor(..), BackendEffect(..), BackendOperator(..), BackendOperator1(..), BackendOperator2(..), BackendOperatorNum(..), BackendOperatorOrd(..))
1818
1919type ForeignEval =
@@ -44,10 +44,10 @@ coreForeignSemantics = Map.fromFoldable semantics
4444 , data_eq_eqIntImpl
4545 , data_eq_eqNumberImpl
4646 , data_eq_eqStringImpl
47+ , data_euclideanRing_intDiv
4748 , data_euclideanRing_numDiv
4849 , data_heytingAlgebra_boolConj
4950 , data_heytingAlgebra_boolDisj
50− , data_heytingAlgebra_boolImplies
5151 , data_heytingAlgebra_boolNot
5252 , data_int_bits_and
5353 , data_int_bits_complement
@@ -146,7 +146,19 @@ control_monad_st_internal_modify :: ForeignSemantics
146146control_monad_st_internal_modify = Tuple (qualified "Control.Monad.ST.Internal" "modify") effectRefModify
147147
148148data_array_unsafeIndexImpl :: ForeignSemantics
149−data_array_unsafeIndexImpl = Tuple (qualified "Data.Array" "unsafeIndexImpl") $ primBinaryOperator OpArrayIndex
149+data_array_unsafeIndexImpl = Tuple (qualified "Data.Array" "unsafeIndexImpl") go
150+ where
151+ go env _ = case _ of
152+ [ ExternUncurriedApp [ a, b ] ] ->
153+ Just $ makeLet Nothing a \a' ->
154+ makeLet Nothing b \b' ->
155+ evalPrimOp env (Op2 OpArrayIndex a' b')
156+ [ ExternApp [ a ] ] ->
157+ Just $ makeLet Nothing a \a' ->
158+ SemLam Nothing \b' ->
159+ evalPrimOp env (Op2 OpArrayIndex a' b')
160+ _ ->
161+ Nothing
150162
151163data_array_length :: ForeignSemantics
152164data_array_length = Tuple (qualified "Data.Array" "length") $ primUnaryOperator OpArrayLength
@@ -199,6 +211,9 @@ data_ring_intSub = Tuple (qualified "Data.Ring" "intSub") $ primBinaryOperator (
199211data_ring_numSub :: ForeignSemantics
200212data_ring_numSub = Tuple (qualified "Data.Ring" "numSub") $ primBinaryOperator (OpNumberNum OpSubtract)
201213
214+data_euclideanRing_intDiv :: ForeignSemantics
215+data_euclideanRing_intDiv = Tuple (qualified "Data.EuclideanRing" "intDiv") $ primBinaryOperator (OpIntNum OpDivide)
216+
202217data_euclideanRing_numDiv :: ForeignSemantics
203218data_euclideanRing_numDiv = Tuple (qualified "Data.EuclideanRing" "numDiv") $ primBinaryOperator (OpNumberNum OpDivide)
204219
@@ -297,21 +312,6 @@ data_heytingAlgebra_boolDisj = Tuple (qualified "Data.HeytingAlgebra" "boolDisj"
297312data_heytingAlgebra_boolNot :: ForeignSemantics
298313data_heytingAlgebra_boolNot = Tuple (qualified "Data.HeytingAlgebra" "boolNot") $ primUnaryOperator OpBooleanNot
299314
300−data_heytingAlgebra_boolImplies :: ForeignSemantics
301−data_heytingAlgebra_boolImplies = Tuple (qualified "Data.HeytingAlgebra" "boolImplies") go
302− where
303− go _ _ = case _ of
304− [ ExternApp [ a, b ] ]
305− | NeutLit (LitBoolean false) <- a ->
306− Just $ NeutLit (LitBoolean true)
307− | NeutLit (LitBoolean true) <- b ->
308− Just $ NeutLit (LitBoolean true)
309− | NeutLit (LitBoolean x) <- a
310− , NeutLit (LitBoolean y) <- b ->
311− Just $ NeutLit (LitBoolean (not x || y))
312− _ ->
313− Nothing
314−
315315data_string_codePoints_toCodePointArray :: ForeignSemantics
316316data_string_codePoints_toCodePointArray = Tuple (qualified "Data.String.CodePoints" "toCodePointArray") go
317317 where
@@ -362,11 +362,11 @@ effectBind :: ForeignEval
362362effectBind env _ = case _ of
363363 [ ExternApp [ eff, SemLam ident next ] ] ->
364364 Just $ makeLet Nothing eff \nextEff ->
365− SemEffectBind ident nextEff next
365+ makeEffectBind ident nextEff next
366366 [ ExternApp [ eff, k ] ] ->
367367 Just $ makeLet Nothing eff \nextEff ->
368368 makeLet Nothing k \nextK ->
369− SemEffectBind Nothing nextEff \a ->
369+ makeEffectBind Nothing nextEff \a ->
370370 evalApp env nextK [ a ]
371371 _ -> Nothing
372372
@@ -375,7 +375,7 @@ effectMap env _ = case _ of
375375 [ ExternApp [ fn ] ] ->
376376 Just $ makeLet Nothing fn \fn' ->
377377 SemLam Nothing \val ->
378− SemEffectBind Nothing val \nextVal ->
378+ makeEffectBind Nothing val \nextVal ->
379379 SemEffectPure (evalApp env fn' [ nextVal ])
380380 _ -> Nothing
381381
@@ -412,7 +412,7 @@ effectRefModify env _ = case _ of
412412 [ ExternApp [ fn, ref ] ] ->
413413 Just $ makeLet Nothing fn \fn' ->
414414 makeLet Nothing ref \ref' ->
415− SemEffectBind Nothing (NeutPrimEffect (EffectRefRead ref')) \val ->
415+ makeEffectBind Nothing (NeutPrimEffect (EffectRefRead ref')) \val ->
416416 NeutPrimEffect $ EffectRefWrite ref' (evalApp env fn' [ val ])
417417 _ ->
418418 Nothing
@@ -431,91 +431,20 @@ isQualified mod tag = case _ of
431431 _ ->
432432 false
433433
434−assocBinaryOperatorL
435− :: forall a
436− . (BackendSemantics -> Maybe a)
437− -> (Env -> a -> a -> BackendSemantics)
438− -> (Env -> BackendSemantics -> BackendSemantics -> Maybe BackendSemantics)
439− -> ForeignEval
440−assocBinaryOperatorL match op def env ident = case _ of
441− [ ExternApp [ a, b ] ] ->
442− case rewrite of
443− Just _ ->
444− rewrite
445− Nothing ->
446− def env a b
447− where
448− rewrite = case match a of
449− Just lhs ->
450− case match b of
451− Just rhs ->
452− Just $ op env lhs rhs
453− Nothing ->
454− case b of
455− SemExtern ident' [ ExternApp [ x, y ] ] _ | ident == ident' ->
456− case match x of
457− Just rhs -> do
458− let result = op env lhs rhs
459− Just $ externApp ident [ result, y ]
460− Nothing ->
461− case x of
462− SemExtern ident'' [ ExternApp [ v, w ] ] _ | ident == ident'' ->
463− case match v of
464− Just rhs -> do
465− let result = op env lhs rhs
466− Just $ externApp ident [ externApp ident [ result, w ], y ]
467− Nothing ->
468− Nothing
469− _ ->
470− Nothing
471− _ ->
472− Nothing
473− Nothing ->
474− case match b of
475− Just rhs ->
476− case a of
477− SemExtern ident' [ ExternApp [ v, w ] ] _ | ident == ident' ->
478− case match w of
479− Just lhs -> do
480− let result = op env lhs rhs
481− Just $ externApp ident [ v, result ]
482− Nothing ->
483− case w of
484− SemExtern ident'' [ ExternApp [ x, y ] ] _ | ident == ident'' ->
485− case match y of
486− Just lhs -> do
487− let result = op env lhs rhs
488− Just $ externApp ident [ externApp ident [ v, x ], result ]
489− Nothing ->
490− Nothing
491− _ ->
492− Nothing
493− _ ->
494− Nothing
495− Nothing ->
496− Nothing
497− _ ->
498− Nothing
499−
500434data_semigroup_concatArray :: ForeignSemantics
501−data_semigroup_concatArray = Tuple (qualified "Data.Semigroup" "concatArray") $ assocBinaryOperatorL match op default
435+data_semigroup_concatArray = Tuple (qualified "Data.Semigroup" "concatArray") go
502436 where
503− match = case _ of
504− NeutLit (LitArray a) -> Just a
505− _ -> Nothing
506−
507− op _ a b =
508− NeutLit (LitArray (a <> b))
509−
510− default _ _ _ =
511− Nothing
437+ go env qual = case _ of
438+ [ ExternApp [ NeutLit (LitArray as), NeutLit (LitArray bs) ] ] ->
439+ Just $ NeutLit (LitArray (as <> bs))
440+ [ ExternApp [ a, b ] ] ->
441+ Just $ evalAssocOp env (Left qual) a b
442+ _ ->
443+ Nothing
512444
513445data_semigroup_concatString :: ForeignSemantics
514446data_semigroup_concatString = Tuple (qualified "Data.Semigroup" "concatString") $ primBinaryOperator OpStringAppend
515447
516−externApp :: Qualified Ident -> Array BackendSemantics -> BackendSemantics
517−externApp ident spine = SemExtern ident [ ExternApp spine ] (Lazy.defer \_ -> NeutApp (NeutVar ident) spine)
518−
519448partial_unsafe_unsafePartial :: ForeignSemantics
520449partial_unsafe_unsafePartial = Tuple (qualified "Partial.Unsafe" "_unsafePartial") go
521450 where
@@ -539,13 +468,13 @@ record_builder_copyRecord = Tuple (qualified "Record.Builder" "copyRecord") go
539468record_builder_unsafeInsert :: ForeignSemantics
540469record_builder_unsafeInsert = Tuple (qualified "Record.Builder" "unsafeInsert") go
541470 where
542− go env _ = case _ of
471+ go _ _ = case _ of
543472 [ ExternApp [ NeutLit (LitString prop), value, NeutLit (LitRecord props) ] ] ->
544473 Just $ NeutLit (LitRecord (Array.snoc props (Prop prop value)))
545474 [ ExternApp [ NeutLit (LitString prop), value, r@(NeutUpdate _ _) ] ] ->
546− Just $ evalUpdate env r [ Prop prop value ]
475+ Just $ evalUpdate r [ Prop prop value ]
547476 [ ExternApp [ NeutLit (LitString prop), value, other ] ] | Just r <- viewCopyRecord other ->
548− Just $ evalUpdate env r [ Prop prop value ]
477+ Just $ evalUpdate r [ Prop prop value ]
549478 _ ->
550479 Nothing
551480
@@ -575,17 +504,17 @@ record_builder_unsafeModify = Tuple (qualified "Record.Builder" "unsafeModify")
575504 Just $ NeutLit (LitRecord props')
576505 [ ExternApp [ NeutLit (LitString prop), fn, r@(NeutUpdate r'@(NeutLocal _ _) _) ] ] -> do
577506 let update = Prop prop (evalApp env fn [ (evalAccessor env r' (GetProp prop)) ])
578− Just $ evalUpdate env r [ update ]
507+ Just $ evalUpdate r [ update ]
579508 [ ExternApp [ NeutLit (LitString prop), fn, other ] ] | Just r <- viewCopyRecord other ->
580509 Just $ makeLet Nothing r \r' -> do
581510 let update = Prop prop (evalApp env fn [ (evalAccessor env r' (GetProp prop)) ])
582− evalUpdate env r [ update ]
511+ evalUpdate r [ update ]
583512 _ ->
584513 Nothing
585514
586515viewCopyRecord :: BackendSemantics -> Maybe BackendSemantics
587516viewCopyRecord = case _ of
588− SemExtern (Qualified (Just (ModuleName "Record.Builder")) (Ident "copyRecord")) [ ExternApp [ value ] ] _ ->
517+ SemRef (EvalExtern (Qualified (Just (ModuleName "Record.Builder")) (Ident "copyRecord"))) [ ExternApp [ value ] ] _ ->
589518 Just value
590519 _ ->
591520 Nothing
@@ -630,9 +559,9 @@ record_unsafe_unsafeHas = Tuple (qualified "Record.Unsafe" "unsafeHas") go
630559record_unsafe_unsafeSet :: ForeignSemantics
631560record_unsafe_unsafeSet = Tuple (qualified "Record.Unsafe" "unsafeSet") go
632561 where
633− go env _ = case _ of
562+ go _ _ = case _ of
634563 [ ExternApp [ NeutLit (LitString prop), value, r ] ] ->
635− Just $ evalUpdate env r [ Prop prop value ]
564+ Just $ evalUpdate r [ Prop prop value ]
636565 _ ->
637566 Nothing
638567
src/PureScript/Backend/Optimizer/Syntax.purs+7
@@ -34,6 +34,8 @@ data BackendSyntax a
3434 | PrimUndefined
3535 | Fail String
3636
37+derive instance Eq a => Eq (BackendSyntax a)
38+
3739newtype Level = Level Int
3840
3941derive newtype instance Eq Level
@@ -42,6 +44,8 @@ derive instance Newtype Level _
4244
4345data Pair a = Pair a a
4446
47+derive instance Eq a => Eq (Pair a)
48+
4549fstPair :: forall a. Pair a -> a
4650fstPair (Pair a _) = a
4751
@@ -60,6 +64,8 @@ data BackendOperator a
6064 = Op1 BackendOperator1 a
6165 | Op2 BackendOperator2 a a
6266
67+derive instance Eq a => Eq (BackendOperator a)
68+
6369data BackendOperator1
6470 = OpBooleanNot
6571 | OpIntBitNot
@@ -118,6 +124,7 @@ data BackendEffect a
118124 | EffectRefRead a
119125 | EffectRefWrite a a
120126
127+derive instance Eq a => Eq (BackendEffect a)
121128derive instance Functor BackendSyntax
122129
123130instance Foldable BackendSyntax where
src/PureScript/Backend/Optimizer/Tracer/Printer.pursnew file+425
@@ -0,0 +1,425 @@
1+module PureScript.Backend.Optimizer.Tracer.Printer
2+ ( printModuleSteps
3+ , printSteps
4+ ) where
5+
6+import Prelude
7+
8+import Data.Array (fold)
9+import Data.Array as Array
10+import Data.Array.NonEmpty (NonEmptyArray)
11+import Data.Array.NonEmpty as NonEmptyArray
12+import Data.Foldable (foldMap, foldr)
13+import Data.Maybe (Maybe(..), maybe)
14+import Data.Monoid (guard, power)
15+import Data.Tuple (Tuple(..), curry, fst, snd, uncurry)
16+import Dodo (Doc, foldWithSeparator)
17+import Dodo as D
18+import Dodo.Common as DC
19+import PureScript.Backend.Optimizer.Convert (OptimizationSteps)
20+import PureScript.Backend.Optimizer.CoreFn (Ident(..), Literal(..), ModuleName(..), Prop(..), ProperName(..), Qualified(..))
21+import PureScript.Backend.Optimizer.Semantics (BackendExpr, BackendRewrite(..), DistOp(..), UnpackOp(..), foldBackendExpr)
22+import PureScript.Backend.Optimizer.Syntax (BackendAccessor(..), BackendEffect(..), BackendOperator(..), BackendOperator1(..), BackendOperator2(..), BackendOperatorNum(..), BackendOperatorOrd(..), BackendSyntax(..), Level(..), Pair(..))
23+
24+heading :: forall a. String -> Doc a -> Doc a
25+heading repeat hd =
26+ D.words
27+ [ D.text (power repeat 2)
28+ , hd
29+ , D.withPosition \{ column, pageWidth } ->
30+ D.text (power repeat (pageWidth - column))
31+ ]
32+
33+printModuleSteps :: ModuleName -> OptimizationSteps -> Doc Void
34+printModuleSteps (ModuleName mod) steps =
35+ fold
36+ [ heading "=" $ D.text mod
37+ , D.break
38+ , D.withPosition \{ pageWidth } ->
39+ D.text (power "=" pageWidth)
40+ , D.break
41+ , D.break
42+ , foldWithSeparator (D.break <> D.break) (uncurry printSteps <$> steps)
43+ ]
44+
45+printSteps :: Qualified Ident -> NonEmptyArray BackendExpr -> Doc Void
46+printSteps qual steps = do
47+ let
48+ ident = printQualifiedIdent qual
49+ renderStep idx step = do
50+ D.lines
51+ [ heading (if idx == 0 then "+" else "-") $ D.words
52+ [ ident
53+ , D.text "Step"
54+ , D.text $ show $ idx + 1
55+ , case idx == 0, idx == NonEmptyArray.length steps - 1 of
56+ true, true -> D.text "(Original/Final)"
57+ true, _ -> D.text "(Original)"
58+ _, true -> D.text "(Final)"
59+ _, _ -> mempty
60+ ]
61+ , D.indent $ snd $ printBackendExpr step
62+ ]
63+ D.foldWithSeparator (D.break <> D.break) $ Array.mapWithIndex renderStep $ NonEmptyArray.toArray steps
64+
65+printQualifiedIdent :: Qualified Ident -> Doc Void
66+printQualifiedIdent = printQualified printIdent
67+
68+printQualified :: forall a. (a -> Doc Void) -> Qualified a -> Doc Void
69+printQualified printA (Qualified mbMod a) =
70+ maybe (printA a) (\(ModuleName mod) -> D.text mod <> D.text "." <> printA a) mbMod
71+
72+printIdent :: Ident -> Doc Void
73+printIdent (Ident i) = D.text i
74+
75+printLevel :: Level -> Doc Void
76+printLevel (Level l) = D.text $ show l
77+
78+printLocal :: Maybe Ident -> Level -> Doc Void
79+printLocal mbIdent lvl = case mbIdent of
80+ Just (Ident "$__unused") ->
81+ D.text "_"
82+ _ ->
83+ foldMap printIdent mbIdent
84+ <> D.text "@"
85+ <> printLevel lvl
86+
87+data Prec = PrecBlock | PrecApply | PrecAccess | PrecAtom
88+
89+derive instance Eq Prec
90+derive instance Ord Prec
91+
92+type PrecDoc = Tuple Prec (Doc Void)
93+
94+wrapPrec :: Prec -> PrecDoc -> Doc Void
95+wrapPrec prec1 (Tuple prec2 doc)
96+ | prec2 < prec1 = DC.pursParens doc
97+ | otherwise = doc
98+
99+printCurriedApp :: PrecDoc -> NonEmptyArray PrecDoc -> PrecDoc
100+printCurriedApp fn args =
101+ Tuple PrecApply
102+ $ D.flexGroup
103+ $ foldWithSeparator D.spaceBreak
104+ $ NonEmptyArray.cons (wrapPrec PrecApply fn) (D.indent <<< wrapPrec PrecAccess <$> args)
105+
106+printCurriedAbs :: NonEmptyArray (Doc Void) -> PrecDoc -> PrecDoc
107+printCurriedAbs args body =
108+ Tuple PrecBlock $ D.flexGroup $ fold
109+ [ D.text "\\"
110+ , D.flexGroup $ D.alignCurrentColumn $ D.foldWithSeparator D.spaceBreak args
111+ , D.space
112+ , D.text "->"
113+ , D.spaceBreak
114+ , D.indent $ snd body
115+ ]
116+
117+printUncurriedApp :: Boolean -> PrecDoc -> Array PrecDoc -> PrecDoc
118+printUncurriedApp isEffectful fn args =
119+ Tuple PrecApply $ D.flexGroup $ fold
120+ [ wrapPrec PrecAccess fn
121+ , D.softBreak
122+ , D.indent $ fold
123+ [ DC.pursParens $ D.foldWithSeparator DC.leadingComma $ snd <$> args
124+ , guard isEffectful $ D.text "!"
125+ ]
126+ ]
127+
128+printUncurriedAbs :: Boolean -> Array (Doc Void) -> PrecDoc -> PrecDoc
129+printUncurriedAbs isEffectful args body =
130+ Tuple PrecBlock $ D.flexGroup $ fold
131+ [ D.text "\\"
132+ , D.flexGroup $ D.alignCurrentColumn $ DC.pursParens $ D.foldWithSeparator DC.leadingComma args
133+ , guard isEffectful $ D.text "!"
134+ , D.space
135+ , D.text "->"
136+ , D.spaceBreak
137+ , D.indent $ snd body
138+ ]
139+
140+printLet :: String -> Doc Void -> Doc Void -> Doc Void
141+printLet letKeyword = curry (printLet' letKeyword <<< pure)
142+
143+printLet' :: String -> Array (Tuple (Doc Void) (Doc Void)) -> Doc Void
144+printLet' letKeyword bindings =
145+ D.flexGroup $ fold
146+ [ D.text letKeyword
147+ , D.spaceBreak
148+ , D.indent $ D.lines $ map
149+ ( \(Tuple ident binding) ->
150+ D.flexGroup $ fold
151+ [ ident
152+ , D.space
153+ , D.text "="
154+ , D.spaceBreak
155+ , D.indent binding
156+ ]
157+ )
158+ bindings
159+ , D.space
160+ , D.text "in"
161+ ]
162+
163+printArray :: Array (Doc Void) -> Doc Void
164+printArray = DC.pursSquares <<< D.foldWithSeparator DC.leadingComma
165+
166+printRecord :: Doc Void -> Array (Prop (Doc Void)) -> Doc Void
167+printRecord sep = DC.pursCurlies <<< D.foldWithSeparator DC.leadingComma <<< map printProp
168+ where
169+ printProp (Prop prop doc) =
170+ D.flexGroup $ fold
171+ [ D.text (show prop)
172+ , sep
173+ , D.spaceBreak
174+ , D.align 2 $ D.indent doc
175+ ]
176+
177+printBranch :: NonEmptyArray (Pair (Doc Void)) -> Doc Void -> Doc Void
178+printBranch conds fallback =
179+ foldr
180+ ( \(Pair a b) other ->
181+ fold
182+ [ D.flexGroup $ fold
183+ [ D.text "if"
184+ , D.spaceBreak
185+ , D.indent a
186+ , D.space
187+ , D.text "then"
188+ ]
189+ , D.indent b
190+ , D.break
191+ , D.text "else"
192+ , D.space
193+ , other
194+ ]
195+ )
196+ (D.break <> D.indent fallback)
197+ conds
198+
199+printBackendExpr :: BackendExpr -> PrecDoc
200+printBackendExpr =
201+ foldBackendExpr
202+ printBackendSyntax
203+ ( \rewrite expr ->
204+ Tuple (fst expr) $ D.lines
205+ [ printBackendRewriteCase rewrite
206+ , snd expr
207+ ]
208+ )
209+
210+printBackendSyntax :: BackendSyntax PrecDoc -> PrecDoc
211+printBackendSyntax = case _ of
212+ Var qi ->
213+ Tuple PrecAtom $ printQualifiedIdent qi
214+ Local mbIdent lvl ->
215+ Tuple PrecAtom $ printLocal mbIdent lvl
216+ Lit lit ->
217+ printLiteral lit
218+ App fn args ->
219+ printCurriedApp fn args
220+ Abs args body ->
221+ printCurriedAbs (map (uncurry printLocal) args) body
222+ UncurriedApp fn args ->
223+ printUncurriedApp false fn args
224+ UncurriedAbs args body ->
225+ printUncurriedAbs false (map (uncurry printLocal) args) body
226+ UncurriedEffectApp fn args ->
227+ printUncurriedApp true fn args
228+ UncurriedEffectAbs args body ->
229+ printUncurriedAbs true (map (uncurry printLocal) args) body
230+ Accessor expr accessor ->
231+ Tuple PrecAccess $ fold
232+ [ wrapPrec PrecAccess expr
233+ , printBackendAccessor accessor
234+ ]
235+ Update expr propArr ->
236+ Tuple PrecApply $ D.flexGroup $ fold
237+ [ wrapPrec PrecAccess expr
238+ , D.spaceBreak
239+ , D.indent $ printRecord (D.text " =") $ map snd <$> propArr
240+ ]
241+ CtorSaturated qi _ _ _ values ->
242+ printUncurriedApp false (Tuple PrecAtom (printQualifiedIdent qi)) (snd <$> values)
243+ CtorDef _ (ProperName proper) ctorName args ->
244+ Tuple PrecBlock $ D.words
245+ [ D.text "constructor"
246+ , printIdent ctorName <>
247+ D.encloseWithSeparator
248+ (D.text "(")
249+ (D.text ")")
250+ (D.text ", ")
251+ (Array.replicate (Array.length args) (D.text "_"))
252+ , D.text "of"
253+ , D.text proper
254+ ]
255+ LetRec lvl bindings body ->
256+ Tuple PrecBlock $ D.lines
257+ [ printLet' "letrec" $ NonEmptyArray.toArray $ map
258+ ( \(Tuple ident binding) ->
259+ Tuple (printLocal (Just ident) lvl) (snd binding)
260+ )
261+ bindings
262+ , snd body
263+ ]
264+ Let mbIdent lvl binding body ->
265+ Tuple PrecBlock $ D.lines
266+ [ printLet "let" (printLocal mbIdent lvl) $ snd binding
267+ , snd body
268+ ]
269+ EffectBind mbIdent lvl binding body ->
270+ Tuple PrecBlock $ D.lines
271+ [ printLet "let!" (printLocal mbIdent lvl) $ snd binding
272+ , snd body
273+ ]
274+ EffectPure a ->
275+ printUncurriedApp true (primOp "effect" "pure") [ a ]
276+ EffectDefer a ->
277+ printUncurriedApp true (primOp "effect" "defer") [ a ]
278+ Branch conds fallback ->
279+ Tuple PrecBlock $ printBranch (map (map snd) conds) $ snd fallback
280+ PrimOp op ->
281+ printBackendOperator op
282+ PrimEffect backendEffect ->
283+ printBackendEffect backendEffect
284+ PrimUndefined ->
285+ primOp "" "undefined"
286+ Fail _ ->
287+ printUncurriedApp false (primOp "" "fail") []
288+
289+printBackendRewriteCase :: forall a. BackendRewrite a -> Doc Void
290+printBackendRewriteCase = case _ of
291+ RewriteInline _ _ _ _ ->
292+ printRewrite "Inline"
293+ RewriteUncurry _ _ _ _ _ ->
294+ printRewrite "Uncurry"
295+ RewriteStop _ ->
296+ printRewrite "Stop"
297+ RewriteUnpackOp _ _ unpackOp _ ->
298+ printUnpackOpCase unpackOp
299+ RewriteDistBranchesLet _ _ _ _ _ ->
300+ printRewrite "DistLet"
301+ RewriteDistBranchesOp _ _ distOp ->
302+ printDistOpCase distOp
303+
304+printUnpackOpCase :: forall a. UnpackOp a -> Doc Void
305+printUnpackOpCase = case _ of
306+ UnpackRecord _ ->
307+ printRewrite "UnpackRecord"
308+ UnpackUpdate _ _ ->
309+ printRewrite "UnpackUpdate"
310+ UnpackArray _ ->
311+ printRewrite "UnpackArray"
312+ UnpackData _ _ _ _ _ ->
313+ printRewrite "UnpackData"
314+
315+printDistOpCase :: forall a. DistOp a -> Doc Void
316+printDistOpCase = case _ of
317+ DistApp _ ->
318+ printRewrite "DistApp"
319+ DistUncurriedApp _ ->
320+ printRewrite "DistUncurriedApp"
321+ DistAccessor _ ->
322+ printRewrite "DistAccessor"
323+ DistPrimOp1 _ ->
324+ printRewrite "DistPrimOp1"
325+ DistPrimOp2L _ _ ->
326+ printRewrite "DistPrimOp2L"
327+ DistPrimOp2R _ _ ->
328+ printRewrite "DistPrimOp2R"
329+
330+printRewrite :: String -> Doc Void
331+printRewrite str = D.text $ "{- " <> str <> " -}"
332+
333+printBackendEffect :: BackendEffect PrecDoc -> PrecDoc
334+printBackendEffect = case _ of
335+ EffectRefNew a ->
336+ printUncurriedApp true (primOp "ref" "new") [ a ]
337+ EffectRefRead a ->
338+ printUncurriedApp true (primOp "ref" "read") [ a ]
339+ EffectRefWrite a b ->
340+ printUncurriedApp true (primOp "ref" "write") [ a, b ]
341+
342+printBackendOperator :: BackendOperator PrecDoc -> PrecDoc
343+printBackendOperator = case _ of
344+ Op1 op1 a ->
345+ printUncurriedApp false (printBackendOperator1 op1) [ a ]
346+ Op2 op2 l r ->
347+ printUncurriedApp false (printBackendOperator2 op2) [ l, r ]
348+
349+printBackendOperator1 :: BackendOperator1 -> PrecDoc
350+printBackendOperator1 = case _ of
351+ OpBooleanNot -> primOp "boolean" "not"
352+ OpIntBitNot -> primOp "int" "bitnot"
353+ OpIntNegate -> primOp "int" "negate"
354+ OpNumberNegate -> primOp "number" "negate"
355+ OpArrayLength -> primOp "array" "length"
356+ OpIsTag qi -> Tuple PrecAtom $ D.text "#[prim.istag " <> printQualifiedIdent qi <> D.text "]"
357+
358+printBackendOperator2 :: BackendOperator2 -> PrecDoc
359+printBackendOperator2 = case _ of
360+ OpArrayIndex -> primOp "array" "index"
361+ OpBooleanAnd -> primOp "boolean" "and"
362+ OpBooleanOr -> primOp "boolean" "or"
363+ OpBooleanOrd ord -> printBackendOperatorOrd "boolean" ord
364+ OpCharOrd ord -> printBackendOperatorOrd "char" ord
365+ OpIntBitAnd -> primOp "int" "bitand"
366+ OpIntBitOr -> primOp "int" "bitor"
367+ OpIntBitShiftLeft -> primOp "int" "bitshl"
368+ OpIntBitShiftRight -> primOp "int" "bitshr"
369+ OpIntBitXor -> primOp "int" "bitxor"
370+ OpIntBitZeroFillShiftRight -> primOp "int" "bitzshr"
371+ OpIntNum num -> printBackendOperatorNum "int" num
372+ OpIntOrd ord -> printBackendOperatorOrd "int" ord
373+ OpNumberNum num -> printBackendOperatorNum "number" num
374+ OpNumberOrd ord -> printBackendOperatorOrd "number" ord
375+ OpStringAppend -> primOp "string" "append"
376+ OpStringOrd ord -> printBackendOperatorOrd "string" ord
377+
378+primOp :: String -> String -> PrecDoc
379+primOp ns op
380+ | ns == "" =
381+ Tuple PrecAtom $ D.text $ "#[prim." <> op <> "]"
382+ | otherwise =
383+ Tuple PrecAtom $ D.text $ "#[prim." <> ns <> "." <> op <> "]"
384+
385+printBackendOperatorNum :: String -> BackendOperatorNum -> PrecDoc
386+printBackendOperatorNum ns = primOp ns <<< case _ of
387+ OpAdd -> "add"
388+ OpDivide -> "div"
389+ OpMultiply -> "mul"
390+ OpSubtract -> "sub"
391+
392+printBackendOperatorOrd :: String -> BackendOperatorOrd -> PrecDoc
393+printBackendOperatorOrd ns = primOp ns <<< case _ of
394+ OpEq -> "eq"
395+ OpNotEq -> "neq"
396+ OpGt -> "gt"
397+ OpGte -> "gte"
398+ OpLt -> "lt"
399+ OpLte -> "lte"
400+
401+printBackendAccessor :: BackendAccessor -> Doc Void
402+printBackendAccessor = case _ of
403+ GetProp lbl ->
404+ D.text $ "." <> show lbl
405+ GetIndex i ->
406+ D.text $ "[" <> show i <> "]"
407+ GetCtorField _ _ _ _ _ ix ->
408+ D.text $ "#" <> show ix
409+
410+printLiteral :: Literal PrecDoc -> PrecDoc
411+printLiteral = Tuple PrecAtom <<< case _ of
412+ LitInt i ->
413+ D.text $ show i
414+ LitNumber n ->
415+ D.text $ show n
416+ LitString s ->
417+ D.text $ show s
418+ LitChar c ->
419+ D.text $ show c
420+ LitBoolean b ->
421+ D.text $ show b
422+ LitArray arr -> do
423+ printArray $ map snd arr
424+ LitRecord propArr ->
425+ printRecord (D.text ":") $ map (map snd) propArr
src/PureScript/Backend/Optimizer/Utils.purs+1−1
@@ -2,8 +2,8 @@ module PureScript.Backend.Optimizer.Utils where
22
33import Prelude
44
5−import Data.Array.NonEmpty (NonEmptyArray)
65import Data.Array.NonEmpty as NonEmptyArray
6+import Data.Array.NonEmpty.Internal (NonEmptyArray)
77import Partial.Unsafe (unsafePartial)
88
99foldl1Array :: forall a b. (b -> a -> b) -> (a -> b) -> NonEmptyArray a -> b