#       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    Safe&',-.=?@AHSUVXgkq.Esimplistic-genericsCarries information about x being an instance of c!simplistic-generics Negation of ""simplistic-genericsCWe will carry constructive information on the constraint. Forcing ( to true )simplistic-genericssExistential type wrapper. This comesin particularly handy when we want to add mrsop terms to some container. See Generics.MRSOP.Holes.Unify for example.+simplistic-generics&Higher order, poly kinded, version of ; We provide the same ! mechanism. The documentation of  Text.Show- has a good example of the correct usage of :  infixr 5 :^: data Tree a = Leaf a | Tree a :^: Tree a instance (Show a) => Show (Tree a) where showsPrec d (Leaf m) = showParen (d > app_prec) $ showString "Leaf " . showsPrec (app_prec+1) m where app_prec = 10 showsPrec d (u :^: v) = showParen (d > up_prec) $ showsPrec (up_prec+1) u . showString " :^: " . showsPrec (up_prec+1) v where up_prec = 5.simplistic-generics'Higher order , poly kinded, version of 0simplistic-genericsTrivial constraint1simplistic-genericsConstraint implication2simplistic-genericsDiagonal indexed functor3simplistic-genericsNatural transformations4simplistic-generics Lifted curry5simplistic-genericsLifted uncurry6simplistic-genericsDuplicates its argument7simplistic-generics8Applies the same function to both components of the pair8simplistic-genericsHigher-order sum eliminator9simplistic-generics Just like 8%, but the result type is of kind Star:simplistic-genericsKleisli Composition;simplistic-generics Maps over )<simplistic-genericsMaps a monadic actino over )=simplistic-genericseliminates an )>simplistic-genericsQReturns whether two types are the same, given that both belong to the same list.?simplistic-genericsProvides the witness that x is an instance of c@simplistic-generics Fetches the " instance for an element of a listAsimplistic-generics Fetches the " instance for an element of a listBsimplistic-genericsProvides the witness that x is an instance of c,  !"#$%&'()*+,-./0123456789:;<=>?@AB,3:24567 8910./+,-)*;<="!#$%&'(> ?B@A:8None&',-.178=>?@AHSUVXq[7Usimplistic-generics Similar to h3, but is indexed over the functors that make up a  8, used to explicitely encode types with one parameter. `simplistic-genericsShallow conversion between  GHC.Generics representation and h; The  and % functions provide the toplevel api.csimplistic-genericsIdentity functorfsimplistic-generics~Computes the constraint that corresponds to ensuring all leaves of a representation satisfy a given constraint. For example, .OnLeaves Eq (Rep (Either a b)) = (Eq a , Eq b)gsimplistic-genericsAll types supported by  GHC.Generics are  simplistic9, this constraint just couples their necessary together.hsimplistic-generics Given some a, a value of type SRep w (Rep a)8 is a closed representation of a generic value of type a.psimplistic-genericsSingletons for metainformationzsimplistic-generics3Retrieves the datatype name for a representation. WARNING; UNSAFE this function only works if f3 is the representation of a type constructed with  GHC.Generics builtin mechanisms.{simplistic-generics6Retrieves the constructor name for a representation. WARNING; UNSAFE this function only works if f3 is the representation of a type constructed with  GHC.Generics builtin mechanisms.|simplistic-generics\Zips two representations together if they are made up of the same constructor. For example, zipSRep (fromS (: 1 [])) (fromS (: 2 (: 3 []))) == Just (fromS (: (1 , 2) ([] , [3]))) zipSRep (fromS (: 1 [])) (fromS []) == Nothing}simplistic-generics Performs a crush over the leaves of a h carrying a constraint around.~simplistic-generics Performs a crush over the leaves of a hsimplistic-generics Example of ~ that places the values of w inside a list.simplistic-generics}Maps a function over a representation taking into account that the leaves of the representation satisfy a given constraint.simplistic-generics/Maps a monadic function over the representationsimplistic-generics.Maps a simple functino over the representationsimplistic-genericsXConverts a value of a generic type directly to its (shallow) simplistic representation.simplistic-genericsNConverts a simplistic representation back to its corresponding value of type a.simplistic-genericsjConverts a value of a generic type directly to its (shallow) simplistic1 representation with a parameter.simplistic-genericsOConverts a simplistic1 representation back to its corresponding value of type a.}simplistic-genericsleaf extractionsimplistic-generics join productsimplistic-genericsempty~simplistic-genericsleaf extractionsimplistic-generics join productsimplistic-genericsemptysimplistic-generics*Which constraint shall be threaded throughR   01PQRSTUYVWXZ[\]^_`abcdefghlijkmnopqrstuvwxyz{|}~R   pqtuvwrshlijkmnocdegf|~}xyz{`abUYVWXZ[\]^_SPQRT10Y5l5None &',7>HUVX^None&'>UVbjsimplistic-genericsU is a functorsimplistic-genericspThe action of f over arrows can be obtained by translating into the generic representation, using the generic 0 and translating back to regular representation.None &',>HUVbNone&',-.178=>?@AHSUVXgq:simplistic-generics.Annotated fixpoints are also easy; forbid the ) constructor but add something to every  of the representation.simplistic-generics&A tree with holes has unit annotationssimplistic-generics;Deep representations are easily achieved by forbiding the , constructor and providing unit annotations.simplistic-genericswThe cofree comonad and free monad on the same type; this allows us to use the same recursion operator for everything.simplistic-generics"Retrieves the annotation inside a %; this is the counit of the comonad.simplistic-generics Maps over a / treating annotations and holes independently.simplistic-generics Maps over  maintaining annotations intact.simplistic-genericsMaps over the holes in a simplistic-generics%Maps over holes and annotations in a simplistic-genericsMonadic multiplicationsimplistic-generics Computes the list of holes in a simplistic-generics$Refines holes using a monadic actionsimplistic-generics!Refine holes with a simple actionsimplistic-genericsRefine holes and primitivessimplistic-genericsCounts how many s and s are inside a .simplistic-genericsCatamorphism over simplistic-genericsSynthetization of attributessimplistic-genericsSimpler version of  working over the Identity monad.simplistic-generics Computes the least general generalization of two trees.simplistic-generics Annotationsimplistic-generics Annotationsimplistic-generics Annotationsimplistic-genericsFunction to transform holessimplistic-generics!Function to transform annotationssimplistic-genericsHow to handle recursionsimplistic-genericsHow to handle primitiviessimplistic-genericsHow to handle holessimplistic-genericsHow to handle recursionsimplistic-genericsHow to handle primitivessimplistic-genericsHow to handle holes&&None&',-.=>?@AHPSUVXsimplistic-genericsUnification is done in a monad.simplistic-genericsdA substitution is but a map; the existential quantifiers are necessary to ensure we can reuse from Data.Map%Note that we must be able to compare  Exists phiE. This comparison needs to work heterogeneously and it must return W only when the contents are in fact equal. Even though we only need this instance for Data.MapA typical example for phi is  Const Int at , representing a variable. The Ord instance would then be: iinstance Ord (Exists (Const Int)) where compare (Exists (Const x)) (Exists (Const y)) = compare x ysimplistic-generics5Unification can return succesfully or find either a  failure or a  failure.simplistic-genericsmThe occurs-check fails when the variable in question occurs within the term its supposed to be unified with.simplistic-generics_A symbol-clash is thrown when the head of the two terms is different and neither is a variabe.simplistic-genericsEmpty substitutionsimplistic-generics(Looks a value up in a substitution, see simplistic-genericslApplies a substitution to a term once; Variables not in the support of the substitution are left untouched.simplistic-generics:Inserts a point in a substitution. Note how the index of phi mustg match the index of the term being inserted. This is important when looking up terms because we must * the existential type variables to return.ePlease, always use this insertion function; or, if you insert by hand, ensure thetype indices match.simplistic-genericsAttempts to unify two C, but ignores which error happened when they could not be unified.simplistic-genericsAttempts to unify two simplistic-genericsAttempts to unify two ' with an already existing substitutionsimplistic-generics#The minimization step performs the  occurs checke and removes unecessary steps, returning an idempodent substitution when successful. For example; Fsigma = fromList [ (0 , bin 1 2) , (1 , bin 4 4) ]Then, minimize sigma will return 0fromList [(0 , bin (bin 4 4) 2) , (1 , bin 4 4)] This returns Left vs$ if occurs-check fail for variables vs. simplistic-genericsRRemoves the keys that project to themselves according to the provided projection. MremoveIds id $ M.fromList [(0,0), (1,2) , (3,4)] = M.fromList [(1,2),(3,4)] simplistic-genericsYWill make sure there are no cycles in the map as per the provided function. For example, TbreakCycles id Just $ M.fromList [(0,1) , (1,2) , (2,0)] = M.fromList [(1,0),(2,0)]tUsefull when the maps represent some sort of equivalence; the function essentially collapses the equivalence class.simplistic-genericssimplistic-genericssimplistic-genericssimplistic-genericssimplistic-genericssimplistic-genericsStarting substsimplistic-generics None .14PUVʶsimplistic-generics0Lists all the necessary types that should have Generic and  instances. For example, _data Rose2 a b = Fork (Either a b) [Rose2 a b] unfoldFamilyInto 'rose2tys [t| Rose2 Int Char |]Will yield the following code: rose2tys :: String rose2tys = [ "Rose2 Int Char" , "Either Int Char" , "[Rose2 Int Char]" , "Int" , "Char" ]tYou should then use some elbow grease or your favorite text editor and its provided macro functionality to produce: Ttype Rose2Prim = '[Int , Char] type Rose2Fam = '[Rose2 Int Char , Either Int Char , [Rose2 Int Char]] deriving instance Generic (Rose2 Int Char) deriving instance Generic (Either Int Char) instance Deep Rose2Prim Rose2Fam (Rose2 Int Char) instance Deep Rose2Prim Rose2Fam (Either Int Char) instance Deep Rose2Prim Rose2Fam [Rose2 Int Char]Note that types like Int< will appear fully qualified, this will need some renaming.simplistic-genericsGiven two type-level lists Prims and Fam, will generate instance Deep Prim Fam f for every f in Fam.simplistic-genericsGiven a function f and a type level stored in fam, deriveInstacesWith will generate:  instance f x for each x in fam2. This function is mostly internal, please check  and deriveGenericFor. simplistic-genericsHandy substitution function.stySubst t m n. substitutes m for n within t, that is: t[m/n] simplistic-generics4Just like subst, but applies a list of substitutions simplistic-generics1Flattens an application into a list of arguments; 7styFlatten (AppST (AppST Tree A) B) == (Tree , [A , B])simplistic-genericsInstance to derivesimplistic-genericsfam None&',-.18=>?@AHSUVXgq simplistic-generics.Auxiliar type synonym for annotated fixpoints.simplistic-genericsThe  datatype packages a 3 in a more standard presentation. A value of type Zipper c f g t represents a value of type SRep f t,, where exactly one recursive leaf (of type t) carries a value of type g t7, moreover, we also carry a proof that the constraint c holds.simplistic-genericshA value of type 'SZip ty w f' corresponds to a value of type 'SRep w f' with one of its leaves of type w ty+ absent. This is essentially a zipper for h.simplistic-genericsWe can transform a  into a h( given we are provided with a value to plug into the identified position.simplistic-generics Maps over a simplistic-genericsGiven a z :: SZip ty h f and a  r :: Rep w f, if z and rS are made with the same constuctor we return a representation that contains both hs and w-s in its leaves, except in one leaf of type ty. This is analogous to |.simplistic-genericsaOverlaps two zippers together; only succeeds if both zippers have the same constructor AND hole.simplistic-generics Analogous to simplistic-genericsWGiven a function that checks wheter an arbitrary position is recursive and a value of t$, returns all possible zippers ove t. simplistic-generics6Retrieves the constructor name for a representation. WARNING; UNSAFE this function only works if f3 is the representation of a type constructed with  GHC.Generics builtin mechanisms. Safe                    !  "  # $  % &'()'(*++,-./01234556789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnnopqrstuvwxyz{||}~                                     !!simplistic-generics-2.0.0-inplaceGenerics.SimplisticGenerics.Simplistic.UtilGenerics.Simplistic.Derive.Show"Generics.Simplistic.Derive.FunctorGenerics.Simplistic.Derive.EqGenerics.Simplistic.DeepGenerics.Simplistic.UnifyGenerics.Simplistic.Deep.THGenerics.Simplistic.ZipperPaths_simplistic_genericsbase GHC.GenericsGenericV1U1Par1Rec1K1M1:+::*::.:RRepRep1Data.Functor.SumInRInLSum Control.Arrow&&&***unK1unM1R1L1unComp1Comp1knd-pply-0.3.2.0-a197e92aGHC.Generics.ExtraSuchThat:=>:WitnessAllNotElemElemHasElemhasElemElemPrfHereThereIsElemExistsShowHOshowHO showsPrecHOEqHOeqHOTrivialImpliesDelta:->curry'uncurry'deltadeltaMapeither'either''<.>exMapexMapMexElimsameTywitnessweqwshow witnessPrf $fImpliescd $fTrivialkc $fEqHOkiU1 $fEqHOkiV1 $fEqHOkiSum $fEqHOki:*: $fEqHOkiConst $fShowHOkiSum $fShowHOki:*:$fShowHOkiConst $fShowExists $fHasElemaa: $fHasElemaa:0 GShallow1sfrom1sto1 OnLeaves1 Simplistic1SRep1S1_U1S1_L1S1_R1:***:S1_K1S1_M1S1_STS1_ParS1_RecS1_CompGShallowsfromstoIunIOnLeaves SimplisticSRepS_U1S_L1S_R1:**:S_K1S_M1S_STGMetasmetaSMetaISMetaSM_DSM_CSM_SgetDatatypeNamegetConstructorNamerepDatatypeNamerepConstructorNamezipSRep repLeavesC repLeaves repLeavesListrepMapCMrepMapMrepMapfromStoSfromS1toS1 $fGMetakSs $fGMetakDd $fGMetakCc $fNFDataSRep$fMonadI$fApplicativeI $fFunctorI$fShowI $fGShallowkK1 $fGShallowkM1$fGShallowk:*:$fGShallowk:+: $fGShallowkU1$fGShallow1:.:$fGShallow1Rec1$fGShallow1Par1$fGShallow1:=>: $fGShallow1M1 $fGShallow1K1$fGShallow1:*:$fGShallow1:+: $fGShallow1U1 $fGShallow1V1$fEqI$fEqSRep $fShowSRep $fEqSMeta $fShowSMetagshow gshowsPrecgfmap'gfmapgeq'geqGDeepgdfromgdtoDeepdfromdtoSFixAnnHolesSFixHolesAnnHole'Prim'Roll' CompoundCnstr PrimCnstrPrimAnnRollPrimHole sfixToHoles holesToSFixgetAnn holesMapAnnM holesMapMholesMap holesMapAnn holesJoinholesHolesListholesRefineHolesMholesRefineHoles holesRefineM holesSizecataM synthesizeM synthesizelgg $fNFDataU1 $fNFDataV1$fNFDataHolesAnn $fEqHolesAnn$fEqHOTYPEHolesAnn$fGDeepkkappafamM1$fGDeepkkappafam:+:$fGDeepkkappafam:*:$fGDeepkkappafamU1$fGDeepkkappafamK1$fGDeepAtomkappafamTruea$fGDeepAtomkappafamFalseaSubstUnifyErr OccursCheck SymbolClash substEmpty substLkup substApply substInsertunify_unify unifyWithminimizeunfoldFamilyInto deriveDeepForderiveInstancesWith$fEqSTy $fShowSTy$fOrdSTyZipper'ZipperzipperselSZipZ_KHZ_L1Z_R1Z_PairLZ_PairRZ_M1plug zipperMapinr1 zipperRepZipzipSZip zipLeavesListzipperszipConstructorName$fEqSZip $fShowSZipGHC.ShowShow showsPrecghc-prim GHC.ClassesEqUnifyM GHC.TypesEQ Unsafe.Coerce unsafeCoerce removeIds breakCyclesstySubst styReduce styFlattenversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName