UA      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg h i j k l m n o p q r s t u v w x y z { | } ~       Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV7UJust as a base monad can be run to remove the monad, so can a transformed monad be unlifted to remove the transformer and obtain the original monad.The overloaded function  for monad transformers takes as first argument an "algebra" just like the run function for base monads. For each monad transformer, the same algebra is used as for the base monad of which the transformer is the parameterized variant.  The class of monads for which a  C function is defined that executes the computation of the monad. The overloaded function run takes as first argument an "algebra" which captures the ingredients necessary to run the particular monad at hand. This algebra is parameterized with the domain and co-domain of run. $The algebra for the state effect of  and .  initial statestate transformer7The algebra for the non-determinacy effect of '[]' and .$The algebra for the error effect of  and .)The algebra for the partiality effect of  and .Exchange one monad by another. This function runs one monad, and puts its value in another. This is basically a monadic version of the   function itself. Note that the two monads are unrelated, so none of the effects of the incoming monad are transferred to the result monad.oMonadic choice combinator that confines the partiality effect to the first argument. This is a variation on X which allows the partiality effect to spread to both arguments and to the result. -Monadic choice combinator. Generalization of C that takes a list of choice arguments rather than a single one.Specialization of  for MaybeT.xMonadic function choice combinator that confines the partiality effect to the first argument. This is a variation on mchoiceX which allows the partiality effect to spread to both arguments and to the result. 6Monadic function choice combinator. Generalization of C that takes a list of choice arguments rather than a single one.!Implementation variant of  in terms of foldr."Implementation variant of  with  expanded:#Implementation variant of 2 where the unlift is postponed to the very end.$ Running the  monad. Note: uses !% Running the  monad.&Running the list monad.'Running the error monad.( Running the  monad.) Running the  monad. The algebra for the  monad is a unary function.*%Unlifting the state monad transformer+&Unlifting the error monad transformer.,+Unlifting the partiality monad transformer.-%Unlifting the list monad transformer.choice branches otherwiseresult   !"#'  )('&%$-,+* !"#   Ralf Laemmel, Joost Visser experimentalportableSafe ;<=>?AQVM.2The type of names of chaseable things. Synonym of ./A generic import chasing function. The type of the final result is a parameter, which will usually be instantiated to a list of parsed modules.0Read a file from a number of possible directories, given a base name and a list of possible extensions. Returns the content of the file it found.1Find a file in a number of possible directories, given a base name and a list of possible extensions. Returns the full name of the file it found.;Helper function for reporting errors and progress to stderr/ $path (list of directories to search)$todo (list of modules still to find)$done (list of modules already found)$initial (start value of accumulator)8parse (function that attempt to find and parse a module)?imports (function that extracts imports from a parse result)Kon module (function that computes a new accumulator from a parse result)Ron missing (function that computes a new accumulator value when parsing failed)result (accumulated value)0path (directories to search) base namepossible extensionscontents of file1path (directories to search) base namepossible extensionscontents of file./01./01None ;<=>?AQVM22Ralf Laemmel, Joost Visser experimentalportableSafe ;<=>?AQVT4]Force success. If the argument value corresponds to failure, a run-time error will occur.5+Sequential composition of monadic functions6ASequential composition with value passing; a kind of monadic let.7'Choice combinator for monadic functions88Type guard described by the argument type of a function.9*Type guard described by a type of a value.:A kind of monadic conditional.456789:456789:None ;<=>?AQVU2;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX2<;=>?@ABCDEGFHIJKLMRSNTOUVPWXQ;<Ralf Laemmel, Joost Visser experimentalportableSafe ;<=>?AQVXLYAny  is a .YRalf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVsq ZCType-preserving identity. Returns the incoming term without change.[QType-preserving failure. Always fails, independent of the incoming term. Uses  to model partiality.\OType-unifying failure. Always fails, independent of the incoming term. Uses  to model partiality.]CType-unifying constant strategy. Always returns the argument value a&, independent of the incoming term.^UType-unifying monadic constant strategy. Always performs the argument computation aF, independent of the incoming term. This is a monadic variation of ]._Apply the monomorphic, type-preserving argument function, if its input type matches the input term's type. Otherwise, fail.`}Apply the monomorphic, type-unifying argument function, if its input type matches the input term's type. Otherwise, fail.aSequential ccomposition of monomorphic function and type-unifying strategy. In other words, after the type-unifying strategy s0 has been applied, the monomorphic function f# is applied to the resulting value.bParallel combination of two type-unifying strategies with a binary combinator. In other words, the values resulting from applying the type-unifying strategies are combined to a final value by applying the combinator o.cReduce a type-preserving strategy to a type-unifying one that ignores its result term and returns void, but retains its monadic effects.dReduce a type-unifying strategy to a type-unifying one that ignores its result value and returns void, but retains its monadic effects.e0Test for constant term, i.e. having no subterms.f9Test for compound term, i.e. having at least one subterm.,2;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXZ[\]^_`abcdef Z[\]^_`abcdef Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV~g)Overload msubst combinator (Experimental)h Substitute one monad for anotheri2Overload basic combinators which involve MonadPlusjFailurekChoice lPush down to a single childm7Overload basic combinators which might involve a monoidnIdentity (success)o&Push down to all children pCombine sequentially q$Overload apply and adhoc combinatorsrStrategy applicationsDynamic type caset7Overload completely unconstrained strategy combinators v Sequential composition w1Sequential composition with value passing x Overloaded lifting with failure ghilkjmponqsrtwvuxtuvwzyqrs|{mnop~}ijklxghghijklmnopqrstuvw Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV\Sequential composition)Sequential composition with value passing:Sequential composition, ignoring value from first strategyDynamic type-case1112 Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVDType guard (function type), i.e., guard that does not observe valuesAttempt a strategy s, but recover if it fails.#Attempt a type-preserving strategy s6, but if it fails, return the input term unchanged.!Attempt a type-unifying strategy s!, but if it fails, return the  element of a .;Test for a strategy's success in a type-preserving context.NTest for a type-preserving strategy's success in a type-preserving context.MTest for a type-unifying strategy's success in a type-preserving context.If c- succeeds, pass its value to the then-clause t*, otherwise revert to the else-clause e.If c- succeeds, pass its value to the then-clause t*, otherwise revert to the else-clause e.If c- succeeds, pass its value to the then-clause t*, otherwise revert to the else-clause e.Guard then-clause t/ by the void-valued type-unifying condition c."Guard type-preserving then-clause t/ by the void-valued type-unifying condition c. Guard type-unifying then-clause t/ by the void-valued type-unifying condition c.%Invert the success-value of strategy s.5Invert the success-value of type-preserving strategy s:. Its output term (in case of success) will be ignored.3Invert the success-value of type-unifying strategy s;. Its output value (in case of success) will be ignored.2Succeed if exactly one argument strategy succeeds.2Succeed if exactly one argument strategy succeeds.2Succeed if exactly one argument strategy succeeds. If predicate gG holds for the input term, return it as output term, otherwise fail. If predicate gH holds for the input term, return it as output value, otherwise fail. If predicate g; holds for the input term, return 1 otherwise return 0.)Type guard (function). Typical usage: 7 full_tdTU (typeTickTU (typeGuard::TypeGuard MyType)) HIf type guard holds for the input term, return 1 otherwise return 0.UIf type guard holds for the input term, return it as output term, otherwise fail. VIf type guard holds for the input term, return it as output value, otherwise fail.  Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV- The type of metric namesThe type of metricsCreate * with given initial value for all metrics.Create ) with 0 as initial value for all metrics.Create l with initTypeMetrics :: MetricName -> a -> Metrics initTypeMetrics key _ = incMetrics1 key initMetrics0:Increment metric with the given name with the given value.*Increment metric with the given name by 1.*Print value of metric with the given name.(Additionally collect type-based metrics.-Generic algorithm for computing nesting depthMetric collecting strategy!Name of the metric and type guard6Strategy that additionally collects type-based metricsRecognize relevant contructs+Count nesting depth of relevant constructs. Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVZ OReplace the monad in a type-preserving strategy, given a monad algebra (see  ) for the monad that is replaced. The two monads are unrelated, so none of the effects in the monad that is replaced carry over to the one that replaces it.MReplace the monad in a type-unifying strategy, given a monad algebra (see  ) for the monad that is replaced. The two monads are unrelated, so none of the effects in the monad that is replaced carry over to the one that replaces it.Add an effect to the monad in a type-preserving strategy. The monads are related by a monad transformer, so the effects of the incoming monad are preserved in the result monad. We use the  & function of the monad transformer.Add an effect to the monad in a type-unifying strategy. The monads are related by a monad transformer, so the effects of the incoming monad are preserved in the result monad. We use the  & function of the monad transformer.wremove an effect from the monad of a type-preserving strategy. The monads are related by a monad untransformer (see ), so the effects of the incoming monad are preserved in the result monad, except for the effect for which a monad algebra is supplied.uremove an effect from the monad of a type-unifying strategy. The monads are related by a monad untransformer (see ), so the effects of the incoming monad are preserved in the result monad, except for the effect for which a monad algebra is supplied.Localize the partiality effect in a type-preserving strategy. A default value must be supplied to be used to recover from failure. Since this default parameter is universally quantified, only !V and 'error ...' can be used to instantiate it. See also 'unsafeGuaranteeSuccessTP.Localize the partiality effect in a type-unifying strategy. A default value must be supplied to be used to recover from failure. Unsafe version of . This version uses uses !f to recover from failure. For the type-preserving case, this is the only possible default value."Unsafe version of . This version uses uses !! to recover from failure. Use  instead.gLocalize the state of a type-preserving strategy. The first argument represents the initial state. eLocalize the state of a type-unifying strategy. The first argument represents the initial state. -default value (Note: universally quantified!) type-preserving partial strategy+type-preserving strategy without partiality default value type-preserving partial strategy+type-preserving strategy without partiality Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVType of generic mapsType of generic sets/Pointwise modification of monomorphic functions4Pointwise modification of type-preserving strategies2Pointwise modification of type-unifying strategiesEmpty generic set.Completely filled generic setAdd an element to a generic set$Remove an element from a generic set:Test whether a given element is contained in a generic setEmpty generic map-Remove an element from a generic map (my key)DTest whether an element with given key is contained in a generic map6Add an entry with given key and value to a generic map3Obtain the value for a given key from a generic map Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVv1Full type-preserving traversal in top-down order.2Full type-preserving traversal in bottom-up order./Full type-unifying traversal in top-down order.fTop-down type-preserving traversal that is cut of below nodes where the argument strategy succeeds.dTop-down type-unifying traversal that is cut of below nodes where the argument strategy succeeds.WTop-down type-preserving traversal that performs its argument strategy at most once.UTop-down type-unifying traversal that performs its argument strategy at most once.XBottom-up type-preserving traversal that performs its argument strategy at most once.VBottom-up type-unifying traversal that performs its argument strategy at most once.DTop-down type-unifying traversal with propagation of an environment.Use O instead.Use P instead.ARecursive completion of full type-preserving one-layer traverasalZRecursive completion of type-preserving one-layer traversal that succeeds exactly once.,Full top-down traversal (overloaded between ; and <)./One-hit top-down traversal (overloaded between ; and <).0One-hit bottom-up traversal (overloaded between ; and <).POne-hit top-down traversal with environment propagation (overloaded between ; and <).See .See .Type-specialised version of <, which works with lists instead of any arbitrary monoid.See .See .initial environment)environment modification at downward step-extraction of value, dependent on environmentbinary strategy combinatorargument strategyresult strategybinary strategy combinatorargument strategyresult strategyRalf Laemmel, Joost Visser experimentalportableNone ;<=>?AQVSelect or transform a node below a node where a condition holds. We find the top-most node which admits selection or transformation below the top-most node which meets the condition. Thus, the distance between guard and application node is minimized.FSelect or transform a node below or at a node where a condition holds.EApply a transformation strictly below a node where a condition holds.BApply a transformation below or at a node where a condition holds.Select or transform a node above a node where a condition holds. The distance between guard and application node is minimized.FSelect or transform a node above or at a node where a condition holds.EApply a transformation strictly above a node where a condition holds.BApply a transformation above or at a node where a condition holds.Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV4Generic free name analysis algorithm (without types)/Generic free name analysis algorithm with types"Accumulate declarations for focus Identify declarationsIdentify references Input term Free namesIdentify declarationsIdentify referencesDerived declarations Input termFree names with typesRalf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV(DSelect the identified focus. Fails if no subterm can be selected.EReplace the identified focus. Fails if no subterm can be replaced.`Delete the focus assuming it is an element in a list. Fails if no deletion can be performed.QFind the host of the focused entity, i.e. a superterm of the focussed subterm.,Put all nodes of a certain type into a list.Put all nodes of type 2 into a list. This is a type-specialization of .Apply the argument function to the unique subterm of the input term. Fail if the input term has more subterms or if the subterm is not of the appropriate type. This is a keyhole version of the traversal combinator QIdentify focus Input term Focused termIdentify focus Input term"Output term without focused entity Get focusGet host Input term Located host Test focus Wrap host Input term Output termRalf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV2KClass of abstractionsRemove an unused abstraction Insert a new abstraction Extract an abstractionIdentify declarationsIdentify referencesUnwrap abstraction Input programOutput program Identify declarationsIdentify referencesUnwrap scope with abstractionsAbstraction to be inserted Input programOutput program Identify declarationsIdentify references Unwrap focus Wrap host Unwrap host Check focusName for abstraction Input programOutput program     Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV; =Exhaustive repeated application at the root of the input term :Exhaustive repeated application throughout the input term. [Exhaustive repeated application according to the left-most outermost traversal strategy.Exhaustive repeated application according to the left-most innermost traversal strategy, implemented in a naive way. Use  instead.Exhaustive repeated application according to the left-most innermost traversal strategy, implemented in a more efficient way.      Ralf Laemmel, Joost Visser experimentalportableNone ;<=>?AQV=%#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn ./012;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXZ[\]^_`abcdefghijklmnopqrstuvwx     o !""#$%%&'(()*++,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxy z { | } ~              !"#$%&'()*+,)-./012)345678)9):);<=>? @AB)C)D)E)F)G)H)I)JKLKMNONP)Q)RSTSUAVAWAXAYAZA[A\A]A^A_A`AaAbAcNdefegeheijkjljljmjnjnjojpjpjqjrjrjsjtjtjujvjvjwjxjxjyjzjzj{j|j|j}~)))))))))<5Strafunski-StrategyLib-5.0.1.0-EiLWRzEDkTv6gp351YjHem0Data.Generics.Strafunski.StrategyLib.StrategyLibControl.Monad.Run1Data.Generics.Strafunski.StrategyLib.ChaseImports)IO$fMonadRunStateAlgStateT$fMonadRunListAlg[]$fMonadRunErrorAlgEither$fMonadRunMaybeAlgMaybe$fMonadRun(->)Identity$fMonadUnTransStateAlgStateT$fMonadUnTransErrorAlgErrorT$fMonadUnTransMaybeAlgMaybeT$fMonadUnTransListAlgListT ChaseName chaseWith chaseFilefindFileTerm$fTermxsucceedmseqmletmchoiceargtypevaltypeifMTUTPparaTPparaTUapplyTPapplyTUadhocTPadhocTUmsubstTPmsubstTUseqTPpassTPseqTUpassTUchoiceTPchoiceTU mchoicesTP mchoicesTUallTPoneTPanyTPsomeTPinjTPallTUallTU'oneTUanyTUanyTU'someTUsomeTU' $fMonoidaidTPfailTPfailTUconstTUcompTUmonoTPmonoTUdotTUop2TUvoidTPvoidTUconcomStrategyMSubstmsubstS StrategyPlusfailSchoiceSoneSStrategyMonoidskipSallScombS StrategyApplyapplySadhocSStrategyvoidSseqSpassSmonoS $fStrategyTUm $fStrategyTPm$fStrategyApplyTUmta$fStrategyApplyTPmtt$fStrategyMonoidTUm$fStrategyMonoidTPm$fStrategyPlusTUm$fStrategyPlusTPm$fStrategyMSubstTU$fStrategyMSubstTP>>>>>>=>>>--+ TypeGuardtryStryTPtryTUtestStestTPtestTUifSifTPifTUifthenSifthenTPifthenTUnotSnotTPnotTUxchoiceS xchoiceTP xchoiceTUfilterTPfilterTUtickTU typeGuard typeTickTU typeFilterTP typeFilterTU MetricNameMetrics initMetrics initMetrics0 incMetrics incMetrics1 putMetricLn typeMetric depthWith $fMonoid(->)mrunTPmrunTUliftTPliftTUunliftTPunliftTUguaranteeSuccessTPguaranteeSuccessTUunsafeGuaranteeSuccessTP localStateTP localStateTUCoderGListGMapGSetmodifymodifyTPmodifyTU emptyGSetfullGSetaddGSet removeGSet containsGSet emptyGMap removeGMap containsGMapputGMapgetGMap sizeGList indxGList emptyGListaddGListputGListgetGList mapGListTP mapGListTU elemsGListnthnoCodegetCodesetCodenextCodeenCode full_tdTP full_buTP full_tdTU stop_tdTP stop_tdTU once_tdTP once_tdTU once_buTP once_buTU once_peTUanyTP'someTP' all_recTU one_recTUfull_tdonce_tdonce_buonce_petopdowncrushcollectselect selectenvbelowSbeloweqSbelowTP beloweqTPaboveSaboveeqSaboveTP aboveeqTP freeNamesfreeTypedNamesboundTypedNames selectFocus replaceFocus deleteFocus selectHostmarkHostlistifystringsinj Abstraction getAbstrName getAbstrParas getAbstrBody getApplyName getApplyParas constrAbstr constrApply eliminate introduceextractrepeatTPreduce outermost innermost' innermostControl.Monad.Trans.ListListT Data.EitherEitherControl.Monad.Trans.ErrorErrorTGHC.BaseMaybeControl.Monad.Trans.MaybeMaybeTmplusghc-prim GHC.TypesIO GHC.IO.UnsafeunsafePerformIOStringerrLnMkTUMkTPGHC.NumNumMonoid MonadPlusmemptyControl.Monad.Trans.ClassliftGHC.Err undefinedunsafeGuaranteeSuccessTU Control.MonadguardjoinMonad>>=>>returnfailFunctorfmapControl.Monad.FixMonadFixmfixData.TraversablemapMsequencemappendmconcatControl.Monad.IO.ClassMonadIOliftIOmfilter<$!>unless replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMforever<=<>=>filterMforM Data.Foldablemsum sequence_forM_mapM_ Data.Monoid<>DualgetDualEndoappEndoAllgetAllAnygetAnySumgetSumProduct getProductFirstgetFirstLastgetLastAltgetAlt Data.Functionfix Data.FunctorvoidapliftM5liftM4liftM3liftM2liftMwhen=<<mzero MonadTrans