Îõ³h,CE?Γ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’0.6.0.0None)-1ÁÜåÛ Like “+, but also remembering that the type has a ”à instance, which can be "recovered" after pattern-matching on the . A map of • values, indexed by the – of each •$. Maintains the invariant that the – of the key matches the – of the •.  Restrict a  map to only those – s found in a —.  Check if the  map contains a value of type bean. :{3let beans = fromDynList [toDyn False, toDyn @Int 5]> in (taste @Bool beans, taste @Int beans, taste @String beans):}(Just False,Just 5,Nothing)The ˜" value corresponding to the inner . Union of to  maps. If both share a –$ key and the key is present in the  —Å, combine the values monoidally. Otherwise, keep the value from the second  map.The set of all – keys of the map. Union of two - maps, right-biased: prefers values from the right  map when both contain the same – key. (Note that   is left-biased.)     None )-14?ÁÂÉÜåäßConvenience typeclass for automatically extracting registrations from a value. Counterpart of  for registrations.õWe look for (potentially nested) tuples in the value. All tuple components except the rightmost-innermost must have ” instances, and are put into a .:{.args :: Args (Identity (Sum Int, All, String))0args = pure (Identity (Sum 5, All False, "foo"))/registeredArgs :: Args (Identity (Regs String))registeredArgs = register args:}:{ %let reps = getRegsReps registeredArgsØ in ( reps == Data.Set.fromList [ SomeMonoidTypeRep $ Type.Reflection.typeRep @(Sum Int)Ó , SomeMonoidTypeRep $ Type.Reflection.typeRep @All]; , registeredArgs & runArgs (taste Cauldron.Beans.empty)" & runIdentity# & runRegs repsÏ & \(beans,_) -> (taste @(Sum Int) beans, taste @All beans) ):}<(True,(Just (Sum {getSum = 5}),Just (All {getAll = False})))Tuples can be nested::{0args :: Args (Identity (Sum Int, (All, String)))2args = pure (Identity (Sum 5, (All False, "foo")))/registeredArgs :: Args (Identity (Regs String))registeredArgs = register args:}ÂIf there are no tuples in the result type, no values are put into .:{args :: Args (Identity String)args = pure (Identity "foo")/registeredArgs :: Args (Identity (Regs String))registeredArgs = register args:}ÓConvenience typeclass for wiring all the arguments of a curried function in one go.ÇTakes a curried function and reads all of its arguments by type using  , returning an , for the final result value of the function.:{ fun0 :: Intfun0 = 5w0 :: Args Intw0 = wire fun0fun1 :: Bool -> Int fun1 _ = 5w1 :: Args Intw1 = wire fun1fun2 :: String -> Bool -> Int fun2 _ _ = 5w2 :: Args Intw2 = wire fun2:};Imprecise exception that might lie hidden in the result of ! , if the 1 map lacks a value for some type demanded by the . Why not make ! return a ™Ù instead of throwing an imprecise exception? The answer is that, for my purposes, using ™ or šß caused undesirable strictness when doing weird things like reading values "from the future".:{/runArgs (taste Cauldron.Beans.empty) (arg @Int):}(*** Exception: LazilyReadBeanMissing IntÚIf more safety is needed, one can perform additional preliminary checks with the help of ".?A writer-like monad for collecting the values of registrations.An ›7 that knows how to construct values by searching in a Á map, and keeps track of the types that will be searched in the  map. Look for a type in the ( map and return its corresponding value.:{ fun1 :: Bool -> Int fun1 _ = 5w1 :: Args Intw1 = fun1 <$> argfun2 :: String -> Bool -> Int fun2 _ _ = 5w2 :: Args Intw2 = fun2 <$> arg <*> arg:}! Here the  map is not passed directlyã, instead, we pass a function-like value that, given a type, will return a value of that type or œ-. Such function is usually constructed using   on some  map.:{&let beans = fromDynList [toDyn @Int 5]$ in runArgs (taste beans) (arg @Int):}5 See also ."9Inspect ahead of time what types will be searched in the  map.:{3let beans = fromDynList [toDyn @Int 5, toDyn False]) args = (,) <$> arg @Int <*> arg @Bool2 in (getArgsReps args, runArgs (taste beans) args):}(fromList [Int,Bool],(5,False))#=Tweak the look-by-type function that is eventually passed to !.Unlikely to be commonly useful.:{ 7let tweak :: forall t. Typeable t => Maybe t -> Maybe t- tweak _ = case Type.Reflection.typeRep @t. `Type.Reflection.eqTypeRep`2 Type.Reflection.typeRep @Int of% Just HRefl -> Just 5# Nothing -> NothingÉ in runArgs (taste Cauldron.Beans.empty) $ contramapArgs tweak $ arg @Int:}5$äInspect ahead of time the types of registrations that might be contained in the result value of an .:{,let args = foretellReg @(Sum Int) *> pure () in getRegsReps args:}fromList [Sum Int]%This function is used in an Û context to create a tell-like function that can later be used to register a value into a .;The type of the future registration must be an instance of ”.3There are no other ways of registering values into .& Extract the 8 map of registrations, along with the main result value.The — of s will typically come from $.Only values for –Ås present in the set will be returned. There will be values for all –1s present in the set (some of them might be the ˜ for that type). #%"$!&  !"#%&$ None ()-1?ÁÂÉÜå;;6 A way of building value of type beanê, potentially requiring some dependencies, potentially returning some secondary beans along the primary beanÏ result, and also potentially requiring some initialization effect in a monad m.'Note that only the type of the primary bean is reflected in the 6= type. Those of the dependencies and secondary beans are not.'A typical initialization monad will be Ä, used for example to create mutable references that the bean will use internally. Sometimes the constructor will allocate resources with bracket-like operations, and in that case a monad like   might be needed instead.74An edge means that the source depends on the target.ÈThe dependencies of each bean are given separatedly from its decorators.8Sometimes the _ing process goes wrong.9The N identified by PathToCauldronË has beans that depend on beans that can't be found either in the current N or its ancestors.:ÍBeans that work both as primary beans and as secondary beans are disallowed.;)Dependency cycles are disallowed by some Gs.B+A step in the construction of a bean value.CUndecorated bean.D:Apply the decorator with the given index. Comes after the C and all Ds with a lower index value.EÛFinal, fully decorated version of a bean. If there are no decorators, comes directly after C.F,Beans that are secondary registrations of a 6% and which are aggregated monoidally.G,Strategy for dealing with dependency cycles.Ô(The name is admittedly uninformative; the culinary metaphor was stretched too far.)H1Convenience typeclass that allows passing either Is or 6 s to the Y and R functions.I.Instructions for how to build a value of type bean1 while possibly performing actions in the monad m.5Because the instructions aren't really run until the N is _.ed, they can be modified with functions like Z$, in order to change the base bean 6, or add or remove decorators.KA   Å of decorators that will wrap the bean. There might be no decorators.See V,   and  .LHow to build the bean itself.MŒIn order to put recipes producing different bean types into a container, we need to hide each recipe's bean type. This wrapper allows that.N&A map of bean recipes, indexed by the –ú of the bean each recipe ultimately produces. Only one recipe is allowed for each bean type. Parameterized by the monad m in which the recipe 6s might have effects.PChange the monad used by the I s in the N.QMore general form of P that lets you modify the  inside all the I s in the N. See X.RBuild a M from a I or a 6. See H.Useful in combination with T.S Access the I inside a M.W)Change the monad used by the bean's main 6 and its decos.XMore general form of W- that enables precise control over the inner  of each constructor in the I.YPut a I into the N.2Only one recipe is allowed for each bean type, so Y> for a bean will overwrite any previous recipe for that bean.ZTweak a I inside the N, if the recipe exists.\ÕForbid any kind of cyclic dependencies between beans. This is probably what you want.]Allow direct self-dependencies.ÍA bean constructor might depend on itself. This can be useful for having decorated self-invocations, because the version of the bean received as argument comes "from the future" and is already decorated. Note that a ž2 instance is required of the initialization monad.BEWARE‡: Pattern-matching too eagerly on a "bean from the future" during construction will cause infinite loops or, if you are lucky, throw s.^Allow any kind of dependency cycles.ÞUsually comes in handy for creating serializers / deserializers for mutually dependent types. Note that a ž2 instance is required of the initialization monad.BEWAREý: Pattern-matching too eagerly on argument beans during construction will cause infinite loops or, if you are lucky, throw s.ŸÀThis function DOESN'T return the bean rep itself in the argreps._2Build the beans using the recipeMap stored in the N.ÓAny secondary beans that are registered by constructors are aggregated monoidally.`Cook a nonempty list of Ns.N6s later in the list can see the beans in all previous Ns, but not vice versa. Beans in a N/ have priority over the same beans in previous Ns.aCook a hierarchy of Ns.N?IJLK8;:9MHÈNOYZ[wxTUPQIJLKHVWXMRSv6lmnopqturs_`aG\]^ 8:9;>?@A<=cdb7ijkBCEDFefghNone-?½‹This is a copy of the Managed type from the  +https://hackage.haskell.org/package/managedmanaged package, with a dodgy  instance tacked on.ŒBuild a ‹ value from a withFooÅ-style resource-handling function that accepts a continuation, like .ÈPassing functions that do weird things like running their continuation twiceÒ will tear apart the fabric of reality. Why would you want to do that? Pass only withFoo-style functions.9Make use of the managed resource by supplying a callback.’ÍThis instance is a little dodgy (continuation-like monads don't have proper ž instances) but it is nevertheless useful because it lets us use ‹ with  allowSelfDeps%. Follow the recommendations for the Œ function. ‹https://stackoverflow.com/questions/25827227/why-cant-there-be-an-instance-of-monadfix-for-the-continuation-monad#comment113010373_63906214Â"if you embrace the unsafety, it could be a fun way to tie knots."Œ‹‹Œ¥  !"#$%&'()*+,-./01223456789:;<=>?@ABCDEFGHIJKLMNOPQQRRSSTUVWXYZ[[[\[]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ&„…†‡ˆ‰Š‹ŒŽ‘’“”• –—˜™š›œžŸ ¡¢£¤Ÿ¥¦§¨©Ÿª¦«¬­®¯°±²³´µ¶·cauldron-0.6.0.0-inplaceCauldron.BeansCauldron Cauldron.ArgsCauldron.ManagedcauldronType.ReflectionTypeRepData.MapMapManaged Data.SequenceSequence|><|Control.ExceptionFixIOExceptionControl.Monad.FixMonadFix System.IOwithFile ghc-internalGHC.Internal.Data.DynamictoDyncontainers-0.7-7628Data.Sequence.InternalSomeMonoidTypeRepBeansemptyinsertdelete restrictKeys singletontaste fromDynListtoDynMapsomeMonoidTypeRepMemptyunionBeansMonoidallykeysSet $fIsListBeans $fMonoidBeans$fSemigroupBeans$fOrdSomeMonoidTypeRep$fEqSomeMonoidTypeRep$fShowSomeMonoidTypeRep $fShowBeans RegistrableregisterWireablewireLazilyReadBeanMissingRegsArgsargrunArgs getArgsReps contramapArgs getRegsReps foretellRegrunRegs$fApplicativeArgs $fMonadRegs$fApplicativeRegs$fWireable_NotYetThereFUNtip$fWireable_AtTheTipaa$fWireablecurriedtip$fRegistrable_Tup3Tuple4tip$fRegistrable_Tup3Tuple3tip$fRegistrable_Tup2Tuple2tip$fRegistrable_Innermostaa$fRegistrablenestedtip$fShowLazilyReadBeanMissing $fExceptionLazilyReadBeanMissing $fFunctorRegs $fFunctorArgs ConstructorDependencyGraph RecipeErrorMissingDependenciesErrorDoubleDutyBeansErrorDependencyCycleErrorDependencyCycleMissingDependenciesDoubleDutyBeansBeanConstructionStepBarePrimaryBeanPrimaryBeanDeco PrimaryBean SecondaryBeanFireToRecipeRecipedecosbean SomeRecipe hoistCauldronhoistCauldron'recipe withRecipefromRecipeList toRecipeMap fromDecoList hoistRecipe hoistRecipe'adjustforbidDepCycles allowSelfDepsallowDepCyclescook cookNonEmptycookTreegetDependencyGraphprettyRecipeErrorprettyRecipeErrorLinestoAdjacencyMapremoveSecondaryBeans removeDecoscollapseToPrimaryBeans writeAsDot defaultStyle setVertexNameval_valval'eff_effeff'hoistConstructorhoistConstructor'getConstructorArgsgetConstructorCallStackgetRecipeCallStack$fExceptionRecipeError$fToRecipeConstructor$fToRecipeRecipe$fIsListCauldron$fMonoidCauldron$fSemigroupCauldron$fShowDependencyGraph$fEqDependencyGraph$fOrdDependencyGraph$fSemigroupDependencyGraph$fMonoidDependencyGraph$fShowRecipeError$fShowDependencyCycle$fShowMissingDependencies$fShowDoubleDutyBeans$fShowBeanConstructionStep$fEqBeanConstructionStep$fOrdBeanConstructionStepmanagedwith$fMonadIOManaged$fMonadManaged$fApplicativeManaged$fFunctorManaged$fMonadFixManaged#GHC.Internal.Data.Typeable.Internal SomeTypeRepGHC.Internal.BaseMonoidDynamicGHC.Internal.Data.TypeableData.Set.InternalSetmemptyGHC.Internal.MaybeMaybeGHC.Internal.Data.EitherEither ApplicativeNothingghc-prim GHC.TypesIOGHC.Internal.Control.Monad.FixconstructorReps recipeRegsfollowConstructorGHC.Internal.Stack.Types CallStackcheckMissingDepscheckMissingDepsCauldron