h,KGǫ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.6.1.0None)-1S 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 IntIf 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.9A 6< depends 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.EFinal, 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.MIn 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;:9MHNOYZ[yzTUPQIJLKHVWXMRSx6lmnopqrsvwtu_`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."None-GThis class allows you to define polymorphic "wirings" which can work in the  monad to produce N$s, but also wire beans directly in  or .If we limit ourselves exclusively to the methods of this class, it's not possible to define decorators or secondary beans.=This class can help migrating from "direct"-style wirings to Ns.:{data A = A deriving Showdata B = B deriving Showdata C = C deriving Show makeA :: A makeA = AmakeB :: A -> BmakeB = \_ -> BmakeC :: A -> B -> IO CmakeC = \_ _ -> pure C8instantiations :: (Builder IO (Args C), IO (Identity C))instantiations = let polymorphicWiring = do! a <- _val_ $ pure makeA" b <- _val_ $ makeB <$> a* c <- _ioEff_ $ makeC <$> a <*> b pure c- in (polymorphicWiring, polymorphicWiring):}Wraps every bean type that we bind using methods of this class. Will be  for  , but simply  for  and .-The monad in which constructors have effects.Because cauldron inject dependencies based on their types, a do-notation block which binds two or more values of the same type would be ambiguous.:{"builderOops :: Builder Identity ()builderOops = do! foo1 <- _val_ $ pure (5 :: Int)! foo2 <- _val_ $ pure (6 :: Int) pure ():}:{case execBuilder builderOops of9 Left (DuplicateBeans _) -> "this should be the result" Right _ -> "won't happen":}"this should be the result"Add a I to the N that is being built.Like  , but lifts $ constructor effects into a general .A I or a 6.   !"#$%&'()*+,-./01233456789:;<=>?@ABCDEFGHIJKLMNOPQRRSSTTUVWXYZ[\\\]\^_`abcdefghijklmnopqrstuvwxyz{|}~'  cauldron-0.6.1.0-inplaceCauldron.BeansCauldron Cauldron.ArgsCauldron.ManagedCauldron.BuildercauldronType.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_ioEff_effioEffeff'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 MonadWiringArgsApplicativeConstructorMonad_val__eff_DuplicateBeansBuilder execBuilderprettyDuplicateBeansprettyDuplicateBeansLinesadd_ioEff_$fMonadFixBuilder$fMonadBuilder$fApplicativeBuilder$fExceptionDuplicateBeans$fMonadWiringManaged$fMonadWiringIO$fMonadWiringBuilder$fShowDuplicateBeans$fFunctorBuilder#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 recipeRegsfollowConstructorbaseControl.Monad.IO.ClassMonadIOGHC.Internal.Stack.Types CallStackcheckMissingDepscheckMissingDepsCauldron"GHC.Internal.Data.Functor.IdentityIdentity