:&#>      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = Safe+,DQRZips up xs and ys, which must be the same length The typelist xs replaced by ys at the indices ns. ns and ys must be the same length. ns must be within bounds of xs The type x replaced by an y if an n matches i. The typelist zs with the first xs replaced by ys. xs must be the same size as ys The typelist xs with the first x replaced by y. It is okay for x not to exist in xs The typelist xs without the type at Nat n replaced by y. n must be within bounds of xs The typelist xs without the type at Nat n. n must be within bounds of xs)Ensures two typelists are the same lengthLabelled access into the list Indexed access into the list Ensures that the label in tagged label v only ever appears once in xs.  Ensures that x only ever appears once in xs EEnsures that the type list contain unique types. Not implemented as  (xs ~ Nub xs) for better type error messages. &Errors if a label exists in a typelist%Errors if a type exists in a typelistSearches for y in ys if not found, than use y, and repeat search with next (y ': ys) in ctx else if found, then don't use y, then repeat search with next (y ': ys) in ctx)Get the first index of a type from a listBGet the first position of a type (indexed by 1) Will return 0 if x doesn't exists in xs.    Safe *+,:DQR.9Tests if all the types in a typelist satisfy a constraint'Return a list of results from applying  to every type in the xs typelist.The result from evaluating a Case with a type from a typelist.XTakes two lists which must be the same length and returns a list of corresponding pairs.!Returns the typelist without the  type Returns a xs appended with ys-Set complement. Returns the set of things in xs that are not in ys.)Ensures two typelists are the same length Get the first type in a typelistGet the typelist without the  type0Returns the typelist from (and including) index n. If n is larger then the xs% size, then an empty '[] is returned.0Returns the typelist after (and exluding) index n. If n is larger then the xs% size, then an empty '[] is returned. 1Returns the typelist up to (and including) index n. If n is larger then the xs size, then the original xs is returned.!1Returns the typelist before (and exluding) index n. If n is larger then the xs size, then the original xs is returned.")Returns the typelist after and including x. If x. doesn't exist, then an empty '[] is returned.#)Returns the typelist after and excluding x. If x. doesn't exist, then an empty '[] is returned.$)Returns the typelist up to and including x. If x" doesn't exist, then the original xs is returned.%)Returns the typelist up to and excluding x. If x" doesn't exist, then the original xs is returned.& The typelist xs replaced by ys at the indices ns. ns and ys must be the same length. ns must be within bounds of xs' The typelist xs without the type at Nat n replaced by y. n must be within bounds of xs( The typelist xs without the type at Nat n. n must be within bounds of xs) The typelist zs with the first xs replaced by ys. xs must be the same size as ys* The typelist xs with the first x replaced by y. It is okay for x not to exist in xs+ The typelist xs without first x. It is okay for x not to exist in xs,Get the types with labels ls from xs-!Get the types at an list of index.\It's actually ok for the position to be zero, but if it's not zero then the types must match/Get the type at a label0Get the type at an index1VGet the first index of a type (Indexed by 1) Will return 0 if x doesn't exists in xs.2aGet the first index of a type (Indexed by 0) Will result in type error if x doesn't exist in xs.3Ensures that the label list all 4s4Ensures that the label in tagged label v only ever appears once in xs.5 Ensures that x only ever appears once in xs6/Return the list of distinct types in a typelist7/Ensures that the type list contain unique types8 Ensures x is a unique member in xs iff it exists in ys9 For each y in ys, snocs them to end of xs if y doesn't already exist in xs:Snoc x to end of xs if x doesn't already exist in xs; Ensures that x is a member of xs at n if it exists, and that > can be used.< Ensures that x is a member of xs at n , and that > can be used.= Ensures that x is a unique member of xs if it exists, and that > can be used.> Ensures that x is a unique member of xs , and that > can be used.? Ensures that x is a unique member of xs , and that > can be used.@ Every x in xs is a `UniqueMember x ys`A Ensures that x is a unique member of xs , and that > can be used.0 !"#$%&'()*+,-./0123456789:;<=>?@A0 !"#$%&'()*+,-./0123456789:;<=>?@A0A@?>=<;:9876543210/.-,+*)('&%$#"! 0 !"#$%&'()*+,-./0123456789:;<=>?@ASafe+,<=DQRBTAllows iterating over the types in a typelist, whilst also incrementing an Nat indexC&Return the next iteration without the  type x in (x ': xs)D-Allows iterating over the types in a typelistE&Return the next iteration without the  type x in (x ': xs)BCDEBCDEDEBCBCDESafe,<=DRHConvert something v into rg using handlers. This class is required in order to step through all the different types in a variant.FGHFGHHFGFGHSafe,<=DQRTI8This class allows defining handlers that can handle the  type in the xs typelist. In conjunction with  @, you can define handlers that can handle all the types in the xs typelist.See Data.Diverse.CaseFunc and Data.Diverse.Cases.J3Return the handler/continuation when x is observed.IJIJIJIJSafe*,9:;<=DOQRTKHThis handler stores a polymorphic function that doesn't change the type. let x = (5 :: Int)   (6 :: Int8)   (7 :: Int16)   (8 :: Int32)     y = (15 :: Int)   (16 :: Int8)   (17 :: Int16)   (18 :: Int32)      (K @? (+10)) x `shouldBe` y MIThis handler stores a polymorphic function that returns a different type. let y =  (5 :: Int) ::  '[Int, Bool]  y (M @. (show . typeRep . (pure @Proxy))) `shouldBe` Int let x = (5 :: Int)   False   'X'   Just 'O'   (6 :: Int)   Just 'A'       (:) [] (  (M @p (show . typeRep . (pure @Proxy))) x) `shouldBe` ["Int", "Bool", "Char", "Maybe Char", "Int", "Maybe Char"] KLMNOPQRKLMNMNRQKLPOKLMNOPQRNone%&*,9:;<=DEOQRTaf9@bDo not export constructor Stores the right Any to be compared when the correct type is discoveredAbDo not export constructor Stores the right Any to be compared when the correct type is discoveredS$A friendlier constraint synonym for z.TT is a variation of W which C!s through the possibilities in a ^, delegating work to CaseN, ensuring termination when ^ only contains one type.V$A friendlier constraint synonym for z.WW is an instance of F for which E!s through the possibilities in a ^, delegating handling to I, ensuring termination when ^ only contains one type.Y$A friendlier constraint synonym for  reinterpretN.Z$A friendlier constraint synonym for u.[$A friendlier constraint synonym for t.\$A friendlier constraint synonym for s.]$A friendlier constraint synonym for o.^A ^ is an anonymous sum type (also known as a polymorphic variant, or co-record) which can only contain one of the types in the typelist. This is essentially a typed version of .\The following functions are available can be used to manipulate unique types in the typelist constructor: a destructor: g injection: o and tcatamorphism: y or z~These functions are type specified. This means labels are not required because the types themselves can be used to access the ^E. It is a compile error to use those functions for duplicate fields.fFor duplicate types in the list of possible types, Nat-indexed version of the functions are available: constructor: e destructor: m inejction: s and  reinterpretNcatamorphism: { or |{Encoding: The variant contains a value whose type is at the given position in the type list. This is the same encoding as  Rhttps://github.com/haskus/haskus-utils/blob/master/src/lib/Haskus/Utils/Variant.hsHaskus.Util.Variant and  Rhttps://hackage.haskell.org/package/HList-0.4.1.0/docs/src/Data-HList-Variant.htmlData.Hlist.Variant.(The constructor is only exported in the Data.Diverse.Which.Internal module` Analogous to  . Renamed ` to avoid conflicts.Since 'Which '[]' values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet", ie "from falsehood, anything follows".A 'Which '[]' is a ^, with no alternatives, which may occur as a B -over from ging a  Which '[x]6 with one type. It is an uninhabited type, just like aLift a value into a ^ of possibly other types xs. xsT can be inferred or specified with TypeApplications. NB. forall is used to specify xs3 first, so TypeApplications can be used to specify xs first aT 'A' @_ @'[Int, Bool, Char, Maybe String] :: Which '[Int, Bool, Char, Maybe String] bA variation of a where x is specified via a label let y = bZ @Foo Proxy (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x = i @Foo Proxy y x shouldBe (Right (Tagged 5)) cA variation of a into a ^ of a single type. c 'A' :: Which '[Char] dA variation of a into a ^ where x is the first type. d! 'A' :: Which '[Char, Int, Bool] eLift a value into a ^H of possibly other (possibley indistinct) types, where the value is the n -th type. eD (Proxy @4) (5 :: Int) :: Which '[Bool, Int, Char, Bool, Int, Char] fIt is f what value is inside a ^ of one type. let x = pick' 'A' :: Which '[Char] f x `shouldBe` 'A' gg a type in a ^ and C get the D value or the B-over possibilities. let x = a* 'A' @'[Int, Bool, Char, Maybe String] :: ^" '[Int, Bool, Char, Maybe String] g @Char x `shouldBe` Right 'A' g @Int x `shouldBe` Left (a 'A') :: ^ '[Bool, Char, Maybe String] h Variation of g which returns a MaybeiA variation of g! where x is specified via a label let y = bZ @Foo Proxy (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x = i @Foo Proxy y x shouldBe (Right (Tagged 5)) j Variation of i which returns a MaybekA variation of a ^ g which g"s the first type in the type list. let x = a* 'A' @'[Int, Bool, Char, Maybe String] :: ^" '[Int, Bool, Char, Maybe String] k x `shouldBe` Left (a 'A') :: ^ '[Bool, Char, Maybe String] l Variation of k which returns a Maybemm the n-th type of a ^ , and get C the D value or the B-over possibilities. let x = a- 'A' @_ @'[Int, Bool, Char, Maybe String] :: ^" '[Int, Bool, Char, Maybe String] m @_ @1 Proxy x `shouldBe` Left (a 'A') :: ^ '[Int, Char, Maybe String] n Variation of m which returns a Maybeo Convert a ^ to another ^1 that may include other possibilities. That is, branch is equal or is a subset of tree.AThis can also be used to rearrange the order of the types in the ^.It is a compile error if tree has duplicate types with branch.NB. Use TypeApplications with  _ to specify tree@. let a = pick' (5 :: Int) :: ^ '[Int] b = o @_ @[Int, Bool] a :: ^ '[Int, Bool] c = o @_ @[Bool, Int] b :: ^ '[Bool, Int] pA simple version of o5 which add another type to the front of the typelist.qA restricted version of o which only rearranges the typesrA variation of o where branch+is additionally specified by a labels list. let y = c (5 :: Tagged Bar Int) y' = r @'[Bar] Proxy y :: ^. '[Tagged Bar Int, Tagged Foo Bool] y'' = r @'[Bar, Foo] Proxy y' :: ^$ '[Tagged Foo Bool, Tagged Bar Int] z y'' ( @A (show . typeRep . (pure @Proxy))) `shouldBe` "Tagged * Bar Int" sA variation of o which uses a Nat list indices, to specify how to reorder the fields, where indices[branch_idx] = tree_idx This variation allows tree! to contain duplicate types with branch$ since the mapping is specified by indicies. let y = c (5 :: Int) y' = s) @'[0] @_ @[Int, Bool] Proxy y y'' = s! @[1,0] @_ @[Bool, Int] Proxy y' z y'' ( @4 (show . typeRep . (pure @Proxy))) `shouldBe` "Int" t Convert a ^ into possibly another ^6 with a totally different typelist. Returns either a ^ with the D value, or a ^ with the Bover  compliment types.It is a compile error if branch or  compliment has duplicate types with tree.NB. forall used to specify branch3 first, so TypeApplications can be used to specify branch first.  let a = a" @[Int, Char, Bool] (5 :: Int) :: ^! '[Int, Char, Bool] let b = t ([String, Char] y b `shouldBe` Left (a (5 :: Int)) :: ^ '[Int, Bool] let c = t ([String, Int] a c `shouldBe` Right (a (5 :: Int)) :: ^ '[String, Int] u Variation of t which returns a Maybe.vA variation of t where the branch. is additionally specified with a labels list. let y = ad @[Tagged Bar Int, Tagged Foo Bool, Tagged Hi Char, Tagged Bye Bool] (5 :: Tagged Bar Int) y' = v @[Foo, Bar] Proxy y x = aP @[Tagged Foo Bool, Tagged Bar Int] (5 :: Tagged Bar Int) y' `shouldBe` Right x w Variation of v which returns a Maybe.xA limited variation of t which uses a Nat list n, to specify how to reorder the fields, where indices[branch_idx] = tree_idx This variation allows tree! to contain duplicate types with branch$ since the mapping is specified by indicies.However, unlike  reinterpert, in this variation, branch must be a subset of treeL instead of any arbitrary Which. Also it returns a Maybe instead of Either.This is so that the same indices can be used in narrowN.yCatamorphism for ^. This is equivalent to flip z.zA switch/case statement for ^. This is equivalent to flip yUse I instances like    to apply a ^% of functions to a variant of values. let y =  (5 :: Int) ::  '[Int, Bool]  y (  ! (show @Bool   show @Int    )) `shouldBe` "5" Or  @2 to apply a polymorphic function that work on all Typeables. let y =  (5 :: Int) ::  '[Int, Bool]  y ( @. (show . typeRep . (pure @Proxy))) `shouldBe` Int +Or you may use your own custom instance of I.{Catamorphism for ^. This is equivalent to flip |.|A switch/case statement for ^. This is equivalent to flip {Use I instances like  " to apply a ^5 of functions to a variant of values in index order. let y = e @0 Proxy (5 :: Int) :: ^ '[Int, Bool, Bool, Int] | y (  # (show @Int   show @Bool   show @Bool   show @Int    )) `shouldBe` "5" +Or you may use your own custom instance of I.}rReading a 'Which '[]' value is always a parse error, considering 'Which '[]' as a data type with no constructors.~This Eb instance tries to read using the each type in the typelist, using the first successful type read. show (pick' 'A') == "pick 'A'" (F zilch zilch) == EQA ^9 with a type at smaller type index is considered smaller. (zilch == zilch ) == TrueTwo ^Tes are only equal iff they both contain the equivalnet value at the same type index.:Terminating case of the loop, ensuring that a instance of Case '[]< with an empty typelist is not required. You can't reduce zilchk each type in a ^, and either handle the J with value discovered, or C( trying the next type in the type list.Allow 'Which '[]' to be ued or o,ed into anything else This is safe because  Which '[]F is uninhabited, and this is already something that can be done with `:Terminating case of the loop, ensuring that a instance of Case '[]< with an empty typelist is not required. You can't reduce zilchk each type in a ^, and either handle the J with value discovered, or E( trying the next type in the type list.The Unique x branch1 is important to get a compile error if the from branch doesn't have a unique xA G instance encoded as either the x value (H ) or the ped remaining 'Which xs'. The I and J metadata are not encoded.A terminating G$ instance for one type encoded with pick'. The I and J metadata are not encoded.A terminating G$ instance for no types encoded as a zilch. The I and J metadata are not encoded.iKLMNOP@QARSTUVWXSTYUVZWX[YZ\[\]^_`a]bcdefg^h_ijklmnopqrstuvwxyz{|`a}~*STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|*^_`adcbefghklijmn]oqpr\s[tZuvwYxVWXyzSTU{|\KLMNOP@QARSTUVWXSTYUVZWX[YZ\[\]^_`a]bcdefg^h_ijklmnopqrstuvwxyz{|`a}~None)STUVWXYZ[\]^`abcdefghijklmnopqrstuvwxyz{|)^`adcbefghklijmn]oqpr\s[tZuvwYxVWXyzSTU{|Safe<=Given a $%7 that transforms each type in the typelist, convert a f xs to f (CasesResult2 c xs) Safe<=@Constrained Foldable for a specified type instead for all types. None%&*+,-9:;<=DEOQRTfnbbP avoids the following: Illegal type synonym family application in instance: Any)A friendlier type constraint synomyn for )A friendlier type constraint synomyn for )A friendlier type constraint synomyn for )A friendlier type constraint synomyn for )A friendlier type constraint synomyn for cFor each type x in larger, generate the (k, v) in smaller (if it exists))A friendlier type constraint synomyn for )A friendlier type constraint synomyn for  and A variation of  which uses B instead of D)A friendlier type constraint synomyn for  and Collects the output from Jing each field in a . Uses D to prepare the I to accept the next type in the xs typelist.@Internally, this holds the left-over [(k, v)] from the original  for the remaining typelist xs..That is, the first v in the (k, v) is of type x7, and the length of the list is equal to the length of xs.dA variation of  which uses e instead of If Variation of  which uses e instead of Ig3Return the handler/continuation when x is observed.;Appends the unique fields fields from the right Many using mThis instance allows converting to and from Many There are instances for converting tuples of up to size 15.h8Many stored as a list. This is useful when folding over = efficienty so that the conversion to List is only done oncemA Many is an anonymous product type (also know as polymorphic record), with no limit on the number of fields.MThe following functions are available can be used to manipulate unique fields getter/setter for single field:  and #getter/setter for multiple fields:  and folds:  or These functions are type specified. This means labels are not required because the types themselves can be used to access the 'Many. It is a compile error to use those functions for duplicate fields.JFor duplicate fields, Nat-indexed versions of the functions are available: getter/setter for single field:  and #getter/setter for multiple fields:  and folds:  or uEncoding: The record is encoded as (S.Seq Any). This encoding should reasonabily efficient for any number of fields.gThe map Key is index + offset of the type in the typelist. The Offset is used to allow efficient cons . (Key = Index of type in typelist + OffsetvThe constructor will guarantee the correct number and types of the elements. The constructor is only exported in the Data.Diverse.Many.Internal module(Converts from a value (eg a tuple) to a , via a i wrapperBConverts from a Many to a value (eg a tuple), via a Tagged wrapper Analogous to &'. Named  to avoid conflicting with &'.0Create a Many from a single value. Analogous to j1Add an element to the left of a Many. Not named cons to avoid conflict with ()Infix version of .)Mnemonic: Element on the left is smaller  than the larger  to the right.1Add an element to the right of a Many Not named snoc to avoid conflict with (*JAdd an element to the right of a Many iff the field doesn't already exist.Infix version of .Mnemonic: Many is larger  than the smaller elementInfix version of . Mnemonic:   with an extra slash (meaning  ) in front.Appends two Manys togetherXSplit a non-empty Many into the first element, then the rest of the Many. Analogous to kVSplit a non-empty Many into initial part of Many, and the last element. Analogous to lUExtract the first element of a Many, which guaranteed to be non-empty. Analogous to m Extract the D element of a Many, which guaranteed to be non-empty. Analogous to &+`Extract the elements after the front of a Many, which guaranteed to be non-empty. Analogous to n-Return all the elements of a Many except the 6 one, which guaranteed to be non-empty. Analogous to &,oGSplit a Many into two, where the last type in the first Many is unique xpISplit a Many into two, where the first type in the second Many is unique xGSplit a Many into two, where the last type in the first Many is unique xISplit a Many into two, where the first type in the second Many is unique xMSplit a Many into two, where the last type in the first Many is unique label lOSplit a Many into two, where the first type in the second Many is unique label l=Split a Many into two, where the second Many starts at index (n + 1)=Split a Many into two, where the second Many starts at index nq:Insert a Many into another Many, inserting after a unique xr;Insert a Many into another Many, inserting before a unique x:Insert a Many into another Many, inserting after a unique x;Insert a Many into another Many, inserting before a unique x@Insert a Many into another Many, inserting after a unique label lAInsert a Many into another Many, inserting before a unique label l3Insert a Many into another Many, starting at index (n + 1)3Insert a Many into another Many, starting at index ns8Insert an item into a Many, inserting after unique type xt9Insert an item into a Many, inserting before unique type x8Insert an item into a Many, inserting after unique type x9Insert an item into a Many, inserting before unique type x9Insert an item into a Many, inserting after unique label l:Insert an item into a Many, inserting before unique label l2Insert an item into a Many, inserting after index n3Insert an item into a Many, inserting before index nuRemove the unique x from a Many. Not named delete to avoid conflicts with -.Remove the unique x from a Many. Not named delete to avoid conflicts with -.Remove the unique label l from a Many. Remove the n-th item from a Many./Getter by unique type. Get the field with type x. let x = (5 :: Int)  False  'X'  Just 'O'    @Int x `shouldBe` 5 v5Using S.lookup to ensure Seq is not stored in a thunk5Getter by label. Get the value of the field with tag label! which can be any type not just  KnownSymbol. let y = False  Tagged @Foo 'X'  Tagged @Hi True   ) @Foo Proxy y `shouldBe` Tagged @Foo 'X'  @Hi Proxy y `shouldBe` Tagged @Hi True DGetter by index. Get the value of the field at index type-level Nat n let x = (5 :: Int)  False  'X'  Just 'O'    @1 Proxy x `shouldBe` False /Setter by unique type. Set the field with type x. let x = (5 :: Int)  False  'X'  Just 'O'    @Int x 6 `shouldBe` (6 :: Int)  False  'X'  Just 'O'   ;Polymorphic setter by unique type. Set the field with type x, and replace with type y let x = (5 :: Int)  False  'X'  Just 'O'   / @Int Proxy x (Just True) `shouldBe` Just True  False  'X'  Just 'O'   1Setter by unique label. Set the field with label l. let y = (5 :: Int)  False  Tagged @Foo 'X'  Tagged @"Hello" (6 :: Int)   : @Foo Proxy y (Tagged @Foo 'Y') `shouldBe` (5 :: Int)  False  Tagged @Foo 'Y'  Tagged @"Hello" (6 :: Int)   @ @"Hello" Proxy y (Tagged @"Hello" 7) `shouldBe` (5 :: Int)  False  Tagged @Foo 'X'  Tagged @"Hello" (7 :: Int)   ;Polymorphic setter by unique type. Set the field with type x, and replace with type y let y = (5 :: Int)  False  Tagged @Foo 'X'  Tagged @"Hello" (6 :: Int)  * replaceL' @Foo Proxy y (Tagged @Bar 'Y') shouldBe (5 :: Int)  False  Tagged Bar Y  Tagged Hello (6 :: Int)  N replaceL' @"Hello" Proxy y (Tagged @"Hello" False) `shouldBe` (5 :: Int)  False  Tagged @Foo 'X'  Tagged @"Hello" False   DSetter by index. Set the value of the field at index type-level Nat n let x = (5 :: Int)  False  'X'  Just 'O'    @0 Proxy x 7 shouldBe Polymorphic version of w3Internal function for construction - do not expose! Folds any %, even with indistinct types. Given distinct handlers for the fields in  , create < of the results of running the handlers over the fields in . let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   y = show @Int  show @Char  show @(Maybe Char)  show @Bool    (:) [] ( ( !I y) x) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"] This is flip  let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   y = show @Int  show @Char  show @(Maybe Char)  show @Bool    (:) [] ( x ( !G y)) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  Folds any %, even with indistinct types. Given index handlers for the fields in  , create < of the results of running the handlers over the fields in . let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   y = show @Int  show @Bool  show @Char  show @(Maybe Char)  show @Int  show @(Maybe Char)    (:) [] ( ( #I y) x) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"] This is flip  let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   y = show @Int  show @Bool  show @Char  show @(Maybe Char)  show @Int  show @(Maybe Char)    (:) [] ( x ( #G y)) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  Construct a B with a smaller number of fields than the original. Analogous to  getter but for multiple fields.8This can also be used to reorder fields in the original . let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   # @'[Bool, Char] x `shouldBe` False  'X'   A variation of  which selects by labels let x = False  Tagged @"Hi" (5 :: Int)  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Bye" O   3 @'[Foo, Bar] Proxy x `shouldBe` Tagged @Foo False  Tagged @Bar 'X'   < @'["Hi", "Bye"] Proxy x `shouldBe` Tagged @"Hi" (5 :: Int)  Tagged @"Bye" 'O'   A variation of  which uses a Nat list n, to specify how to reorder the fields, where  indices[branch_idx] = tree_idx@ This variation allows smaller or larger: to contain indistinct since the mapping is specified by indicies. let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   + (Proxy @'[5, 4, 0]) x `shouldBe` Just 'A'  (6 :: Int)  (5 ::Int)   Sets the subset of  in the larger . Analogous to  setter but for multiple fields. let x = (5 :: Int)  False  'X'  Just 'O'   # @'[Int, Maybe Char] x ((6 :: Int)  Just 'P'  ) `shouldBe` (6 :: Int)  False  'X'  Just 'P'   A variation of  which amends via labels. let x = False . Tagged @"Hi" (5 :: Int) . Tagged @Foo False . Tagged @Bar 'X' . Tagged @"Bye" 'O' ./  ) @'[Foo, Bar] Proxy x (Tagged @Foo True . Tagged @Bar 'Y' . nil) shouldBe False . Tagged @"Hi" (5 :: Int) . Tagged @Foo True . Tagged @Bar 'Y' . Tagged @"Bye" 'O' ./  3 @'["Hi", "Bye"] Proxy x (Tagged @"Hi" (6 :: Int) . Tagged @"Bye" 'P' . nil) shouldBe False . Tagged @"Hi" (6 :: Int) . Tagged @Foo False . Tagged @Bar 'X' . Tagged @"Bye" 'P' ./  A variation of  which amends via labels. let x = False  Tagged @"Hi" (5 :: Int)  Tagged @Foo False  Tagged @Bar X  Tagged @"Bye" 'O'    @'[Foo, Bar] Proxy x ('Y'  True  nil) `shouldBe` False  Tagged @"Hi" (5 :: Int)  'Y'  True  Tagged @"Bye" 'O'    @'["Hi", "Bye"] Proxy x (True  Tagged @"Changed" True  ) `shouldBe` False  True  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Changed" True   A variation of  which uses a Nat list n, to specify how to reorder the fields, where  indices[branch_idx] = tree_idx@ This variation allows smaller or larger: to contain indistinct since the mapping is specified by indicies. let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   ! (Proxy @'[5, 4, 0]) x (Just 'B'  (8 :: Int)  (4 ::Int)  ) `shouldBe` (4 :: Int)  False  'X'  Just 'O'  (8 :: Int)  Just 'B'   A polymorphic variation of   read "5 . False . X . Just O . nil" == (5 :: Int)  False  'X'  Just 'O'   show (5 :: Int)  False  'X'  Just 'O'   == "5 . False . X . Just O . nil" ==Two s are ordered by Fing their fields in index orderTwo %s are equal if all their fields equalfor each x in smaller1, convert it to a (k, v) to insert into the x in larger for each x in smaller1, convert it to a (k, v) to insert into the x in larger for each y in smaller1, convert it to a (k, v) to insert into the x in  Many larger for each x in smaller1, convert it to a (k, v) to insert into the x in  Many largerFor each type x in larger?, find the index in ys, and create an (incrementing key, value)JFor each type x in larger, find the index in ys, and create a (key, value)Folds values by Eing Emitters through the xs typelist. nill case that doesn't even use J, so that an instance of Case '[] is not needed.Given a $%7 that transforms each type in the typelist, convert a Many xs to Many (CaseResults c xs)Recursive AFunctor instance for non empty type list delegate afmap'ing the remainder to an instance of Collector' with one less type in the type list1Terminating AFunctor instance for empty type listFolds values by Eing Is through the xs typelist. nill case that doesn't even use J, so that an instance of Case '[] is not needed. nill case that doesn't even use caseAnyN, so that an instance of  CaseAnyN '[] is not needed. nill case that doesn't even use g, so that an instance of  CaseAny '[] is not needed..-This single field instance is the reason for i0 wrapper. Otherwise this instance will overlap./8These instances add about 7 seconds to the compile time!0A G instance encoded as the  value x with the  . The I and J metadata are not encoded.1A terminating G instance encoded as a .byz{|}~cdfeghopqrstuvw      !"#$%&'()*+,-./0123MMbyz{|}~cdfeghopqrstuvw      !"#$%&'()*+,-./012355555555 NoneLL None*,9:;<=DQRTf4A variation of 5 which uses  to get the handler by index. There may be different handlers for the same type, but the handlers must be in the same order as the input xs typelist. Use 8# to construct this safely ensuring n starts at 0.5 Contains a 4 of handlers/continuations for all the types in the xs typelist. This uses / to get the unique handler for the type at the  of xs.Use 6 to construct this with , constraint to reduce programming confusion.6Create an instance of I for either handling ing a Which. let y =  (5 :: Int) ::  '[Int, Bool]  y ( 6 (show @Bool  show @Int  nul)) `shouldBe` "5" Or for handling  from a . let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'  nul y = show @Int  show @Char  show @(Maybe Char)  show @Bool  nul   (:) [] ( x (6$ y)) `shouldBe` ["5", "False", "X ", "Just 'O'", "6", "Just 'A'"] !This function imposes additional  SameLength! constraints than when using the 55 constructor directly. It is better practice to use 6@ to prevent programming confusion with dead code. However, the 5A constructor is still exported to allow creating a master-of-all-I.7A variation of 6 without the  SameLength. constraint to allow creating a master-of-all-I.8Safe Constructor for 4 ensuring that the n( Nat starts at 0. It is an instance of CaseN for either handling /ing a Which in index order. let y = 06 @0 Proxy (5 :: Int) :: Which '[Int, Bool, Bool, Int] / y ( 8 (show @Int  show @Bool  show @Bool  show @Int  nul)) `shouldBe` "5" Or for handling  from a . let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'  nul y = show @Int  show @Bool  show @Char  show @(Maybe Char)  show @Int  show @(Maybe Char)  nul   (:) [] ( x (8$ y)) `shouldBe` ["5", "False", "X ", "Just 'O'", "6", "Just 'A'"] 9A variation of 8 without the  SameLength. constraint to allow creating a master-of-all-I.:UndecidableInstances because fs appears more often.<UndecidableInstances because fs appers more often. 456789:;<=456789567489 456789:;<=$None !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNSTUVWXYZ[\]^`abcdefghijklmnopqrstuvwxyz{|456789123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst uvwx%yzz{|}~0/                                                     ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q "  ! R # S T U V WXYZX[\]^X_`X_aX_bXcdefgXhiXhjXhkXhlmmnopp]^qqrrssttuuvwxyz { | } ~   XX         Xh {           |   }                "  +data-diverse-1.2.0.0-GbBm26XCSLcB13eeEYYb75Data.Diverse.TypeLevel.InternalData.Diverse.TypeLevelData.Diverse.ReiterateData.Diverse.ReduceData.Diverse.CaseData.Diverse.CaseFuncData.Diverse.Which.InternalData.Diverse.AFunctorData.Diverse.AFoldableData.Diverse.Many.InternalData.Diverse.Cases ReiterateData.Diverse.Many./nilafmapData.Diverse.WhichpickWhichswitch Data.TypeableTypeablenulafoldrforManyDataDynamic Data.VoidabsurdVoidCaseFuncCasescasesCasesNcasesN Data.DiverseCasePreludenull Control.Lensconssnoclastinit Data.ListdeleteswitchNpickNZipImplReplacesIndexImplReplaceIfIndex ReplacesImpl ReplaceImplReplaceIndexImplRemoveIndexImplSameLengthImplKindAtLabelImplKindAtIndexImplUniqueLabelImpl UniqueImplIsDistinctImplIsUniqueLabelImpl IsUniqueImplNubImpl IndexOfImplPositionOfImplAllConstrained CaseResults CaseResultZipInitAppend Complement SameLengthLengthLastHeadTail FromIndex AfterIndexToIndex BeforeIndexFromAfterToBefore ReplacesIndex ReplaceIndex RemoveIndexReplacesReplaceRemove KindsAtLabelsKindsAtIndicesKindAtPositionIs KindAtLabel KindAtIndex PositionOfIndexOf UniqueLabels UniqueLabelUniqueNub IsDistinctUniqueIfExists AppendUnique SnocUnique MaybeMemberAtMemberAtMaybeUniqueMemberAtUniqueLabelMemberUniqueMemberAt UniqueMembers UniqueMember ReiterateN reiterateN reiterateReducereduceReducedcase' CaseFunc'$fCaseCaseFunc':$fReiterateCaseFunc'xs$fCaseCaseFunc:$fReiterateCaseFuncxsSwitchN SwitcherNSwitchSwitcher ReinterpretN' Reinterpret' Reinterpret DiversifyN Diversify impossiblepickLpickOnlypick0obvioustrialtrial'trialLtrialL'trial0trial0'trialNtrialN' diversify diversify0 diversify' diversifyL diversifyN reinterpret reinterpret' reinterpretL reinterpretL' reinterpretN'whichwhichN $fReadWhich $fReadWhich0$fWhichReadWhich_$fWhichReadWhich_0$fCaseCaseShowWhich:$fReiterateCaseShowWhich: $fShowWhich $fShowWhich0$fCaseCaseOrdWhich:$fReiterateCaseOrdWhich: $fOrdWhich $fOrdWhich0$fCaseCaseEqWhich:$fReiterateCaseEqWhich: $fEqWhich $fEqWhich0$fReduceWhichSwitcherN$fReduceWhichSwitcherN0$fReduceWhichSwitcher$fReduceWhichSwitcher0$fReduceWhichSwitcher1$fCaseCaseReinterpretN':#$fReiterateNCaseReinterpretN'ntree'$fCaseCaseReinterpret': $fReiterateCaseReinterpret'tree'$fCaseCaseReinterpret:$fReiterateCaseReinterprettree'$fCaseCaseDiversifyN:"$fReiterateNCaseDiversifyNnbranch'$fCaseCaseDiversify:$fReiterateCaseDiversifybranch'$fSemigroupWhich$fGenericWhich$fGenericWhich0$fGenericWhich1 $fNFDataWhich$fNFDataWhich0$fNFDataWhich1AFunctor AFoldableafoldl'AmendN'AmendNAmend'AmendSelectNSelectCollectN CollectorNCollect CollectorCanAppendUniqueappend'IsManytoManyfromManyManytoMany' fromMany'singleprefixpostfixpostfix'\././appendviewfviewbfrontbackaftfore splitAfter splitBefore splitAfterL splitBeforeL splitAfterN splitBeforeN insetAfter insetBefore insetAfterL insetBeforeL insetAfterN insetBeforeN insertAfter insertBefore insertAfterL insertBeforeL insertAfterN insertBeforeNremoveremoveLremoveNfetchfetchLfetchNreplacereplace'replaceL replaceL'replaceN replaceN'collectforManyNcollectNselectselectLselectNamendamendLamend'amendL'amendNamendN' $fReadMany $fReadMany_ $fReadMany_0 $fShowMany $fShowMany_ $fShowMany_0 $fMonoidMany $fMonoidMany_$fMonoidMany_0$fSemigroupMany$fSemigroupMany_$fSemigroupMany_0 $fOrdMany $fOrdMany_ $fOrdMany_0$fEqMany $fEqMany_ $fEqMany_0$fCaseAnyCaseAmendN':$fReiterateNCaseAmendN'n:$fCaseAnyCaseAmendN:$fReiterateNCaseAmendNn:$fCaseAnyCaseAmend':$fReiterateCaseAmend':$fCaseAnyCaseAmend:$fReiterateCaseAmend:$fCaseAnyCaseSelectN:$fReiterateNCaseSelectNn:$fCaseAnyCaseSelect:$fReiterateCaseSelect:$fAFoldableCollectorNr$fAFoldableCollectorNr0$fAFunctorManycas$fAFunctorMany_c:$fAFunctorMany_c[]$fAFoldableCollectorr$fAFoldableCollectorr0$fAFoldableCollectorAnyNr$fAFoldableCollectorAnyNr0$fAFoldableCollectorAnyr$fAFoldableCollectorAnyr0$fCanAppendUniquexs:$fCanAppendUniquexs[]#$fIsManyTYPETagged:(,,,,,,,,,,,,,,)"$fIsManyTYPETagged:(,,,,,,,,,,,,,)!$fIsManyTYPETagged:(,,,,,,,,,,,,) $fIsManyTYPETagged:(,,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,)$fIsManyTYPETagged:(,,,,,,)$fIsManyTYPETagged:(,,,,,)$fIsManyTYPETagged:(,,,,)$fIsManyTYPETagged:(,,,)$fIsManyTYPETagged:(,,)$fIsManyTYPETagged:(,)$fIsManyTYPETagged:a$fIsManyTYPETagged[]() $fGenericMany$fGenericMany0 $fNFDataMany $fNFDataMany0cases'casesN'$fCaseCasesNxs$fReiterateNCasesNnxs $fCaseCasesxs$fReiterateCasesxsbase GHC.TypeLitsnatValGHC.NumNum CaseOrdWhich CaseEqWhich Data.EitherLeftEitherRightGHC.ReadReadghc-prim GHC.Classescompare GHC.GenericsGeneric:+:C1S1Which_ WhichRead whichReadPrec CaseShowWhichCaseReinterpretN'CaseReinterpret'CaseReinterpretCaseDiversifyN CaseDiversifypick_trial_trial_' diversify0' readWhich_ WrappedAny CaseSelect CollectorAnyNCaseAny CollectorAnycaseAnyMany_"tagged-0.8.5-jDBtbBndklGIlXZjVMhpH Data.TaggedTagged*containers-0.5.10.2-BsNvjXoQS1iGZ9xbXaQ0MzData.Sequence.Internal singletonviewlviewrGHC.Listheadtail splitAfter_ splitBefore_ insetAfter_ insetBefore_ insertAfter_ insertBefore_remove_fetch_ fromList':*: CaseAmendN' CaseAmendN CaseAmend' CaseAmend CaseSelectNrunMany_toMany_ fromMany_getMany_prefix_front_aft_replace_ replace'_forMany' forManyN' forMany'' forManyN''