5#      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ 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 listIndexed access into the listEnsures that the label in tagged label v only ever appears once in xs. Ensures that x only ever appears once in xsEEnsures 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 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 lengthGet the last type in a typelist Get the first type in a typelistGet the typelist without the  type 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 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 matchGet the type at a labelGet the type at an indexVGet the first index of a type (Indexed by 1) Will return 0 if x doesn't exists in xs.aGet the first index of a type (Indexed by 0) Will result in type error if x doesn't exist in xs.Ensures that the label list all sEnsures that the label in tagged label v only ever appears once in xs. Ensures that x only ever appears once in xs/Return the list of distinct types in a typelist/Ensures that the type list contain unique types Ensures x is a unique member in xs iff it exists in ys 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.  Ensures that x is a unique member of xs , and that  can be used.!  !  !  !  Safe+,<=DQR!TAllows iterating over the types in a typelist, whilst also incrementing an Nat index"&Return the next iteration without the  type x in (x ': xs)#-Allows iterating over the types in a typelist$&Return the next iteration without the  type x in (x ': xs)!"#$!"#$#$!"!"#$Safe,<=D%Reduce a polymorphic variant v xs into rg using handlers. This class is required in order to step through all the different types in a variant.%&%&%&%&Safe,<=DQRT'8This 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.CaseTypeable and Data.Diverse.Cases.(3Return the handler/continuation when x is observed.'('('('(Safe ,9:;<=DOT)=This handler stores a polymorphic function for all Typeables. let y =   (5 :: Int) ::   '[Int, Bool]   y (). (show . typeRep . (pure @Proxy))) `shouldBe` Int let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'    (:) [] ( ()p (show . typeRep . (pure @Proxy))) x) `shouldBe` ["Int", "Bool", "Char", "Maybe Char", "Int", "Maybe Char"] )*+,)*)*,+)*+,None%&*,9:;<=DEOQRTf6bDo not export constructor Stores the right Any to be compared when the correct type is discoveredbDo not export constructor Stores the right Any to be compared when the correct type is discovered-- is a variation of / which "!s through the possibilities in a 5, delegating work to CaseN, ensuring termination when 5 only contains one type.// is an instance of % for which $!s through the possibilities in a 5, delegating handling to ', ensuring termination when 5 only contains one type.1$A friendlier constraint synonym for K.2$A friendlier constraint synonym for I.3$A friendlier constraint synonym for H.4$A friendlier constraint synonym for E.5A 5 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: 8 destructor: > injection: E and Icatamorphism: O or P~These functions are type specified. This means labels are not required because the types themselves can be used to access the 5E. 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: < destructor: A inejction: H and Kcatamorphism: Q or R{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 module7A 52 with no alternatives. You can't do anything with 76 except Eq, Read, and Show it. Using functions like P and > with 7 is a compile error. 7 is only useful as a  -over from >ing a  Which '[x] with one type.8Lift a value into a 5 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 8Q 'A' @'[Int, Bool, Char, Maybe String] :: Which '[Int, Bool, Char, Maybe String] 9A variation of 8 where x is specified via a label let y = 9Z @Foo Proxy (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x = ? @Foo Proxy y x shouldBe (Right (Tagged 5)) :A variation of 8 into a 5 of a single type. : 'A' :: Which '[Char] ;A variation of 8 into a 5 where x is the first type. ;! 'A' :: Which '[Char, Int, Bool] <Lift a value into a 5H of possibly other (possibley indistinct) types, where the value is the n -th type. <D (Proxy @4) (5 :: Int) :: Which '[Bool, Int, Char, Bool, Int, Char] =It is = what value is inside a 5 of one type. let x = pick' 'A' :: Which '[Char] = x `shouldBe` 'A' >> a type in a 5 and  get the  value or the -over possibilities. let x = 8* 'A' @'[Int, Bool, Char, Maybe String] :: 5" '[Int, Bool, Char, Maybe String] > @Char x `shouldBe` Right 'A' > @Int x `shouldBe` Left (8 'A') :: 5 '[Bool, Char, Maybe String] ?A variation of >! where x is specified via a label let y = 9Z @Foo Proxy (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x = ? @Foo Proxy y x shouldBe (Right (Tagged 5)) @A variation of a 5 > which >"s the first type in the type list. let x = 8* 'A' @'[Int, Bool, Char, Maybe String] :: 5" '[Int, Bool, Char, Maybe String] @ x `shouldBe` Left (8 'A') :: 5 '[Bool, Char, Maybe String] AA the n-th type of a 5 , and get  the  value or the -over possibilities. let x = 8* 'A' @'[Int, Bool, Char, Maybe String] :: 5" '[Int, Bool, Char, Maybe String] A @1 Proxy x `shouldBe` Left (8 'A') :: 5 '[Int, Char, Maybe String] "Utility to convert Either to MaybeB8 ( B) and > ( B) in  form. B =   8 (either (const Nothing) Just . >) let y =  (B @Int) (5 :: Int) :: 5# '[Bool, Int, Char, Bool, Char] -- 8 x =  (B @Int) y -- > x `shouldBe` (Just 5) C9 ( C) and ? ( C) in  form. let y =  (Cg @Bar Proxy) (Tagged (5 :: Int)) :: Which '[Tagged Foo Bool, Tagged Bar Int, Char, Bool, Char] x =  (C. @Bar Proxy) y x `shouldBe` (Just (Tagged 5)) D< ( D) and A ( D) in  form. D p =   (<# p) (either (const Nothing) Just . A p) let y =  (D (Proxy @4)) (5 :: Int) :: 5( '[Bool, Int, Char, Bool, Int, Char] -- < x =  (D (Proxy @4)) y -- A x `shouldBe` (Just 5) E Convert a 5 to another 51 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 5.It is a compile error if tree has duplicate types with branch.NB. forall is used to tree> is ordered first, so TypeApplications can be used to specify tree first. let a = pick' (5 :: Int) :: 5 '[Int] b = E @[Int, Bool] a :: 5 '[Int, Bool] c = E @[Bool, Int] b :: 5 '[Bool, Int] FA simple version of E5 which add another type to the front of the typelist.GA variation of E where branch+is additionally specified by a labels list. let y = : (5 :: Tagged Bar Int) y' = G @'[Bar] Proxy y :: 5. '[Tagged Bar Int, Tagged Foo Bool] y'' = G @'[Bar, Foo] Proxy y' :: 5$ '[Tagged Foo Bool, Tagged Bar Int] P y'' (A (show . typeRep . (pure @Proxy))) `shouldBe` "Tagged * Bar Int" HA variation of E 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 = : (5 :: Int) y' = H& @'[0] @[Int, Bool] Proxy y y'' = H @[1,0] @[Bool, Int] Proxy y' P y'' (4 (show . typeRep . (pure @Proxy))) `shouldBe` "Int" I Convert a 5 into possibly another 56 with a totally different typelist. Returns either a 5 with the  value, or a 5 with the over  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 = 8" @[Int, Char, Bool] (5 :: Int) :: 5! '[Int, Char, Bool] let b = I ([String, Char] y b `shouldBe` Left (8 (5 :: Int)) :: 5 '[Int, Bool] let c = I ([String, Int] a c `shouldBe` Right (8 (5 :: Int)) :: 5 '[String, Int] JA variation of I where the branch. is additionally specified with a labels list. let y = 8d @[Tagged Bar Int, Tagged Foo Bool, Tagged Hi Char, Tagged Bye Bool] (5 :: Tagged Bar Int) y' = J @[Foo, Bar] Proxy y x = 8P @[Tagged Foo Bool, Tagged Bar Int] (5 :: Tagged Bar Int) y' `shouldBe` Right x KA limited variation of I 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.LE ( L) and I ( L) in  form. let x = 8 (5 :: Int) :: 5 '[String, Int] y =  (L% @_ @[Bool, Int, Char, String]) x -- E! y `shouldBe` pick (5 :: Int) :: 5% '[Bool, Int, Char, String] let y' =  (L @[String, Int]) y -- I0 y' `shouldBe` Just (pick (5 :: Int)) :: Maybe (5 '[String, Int]) MG ( M) and J ( M) in  form. let t = 8c @[Tagged Bar Int, Tagged Foo Bool, Tagged Hi Char, Tagged Bye Bool] (5 :: Tagged Bar Int) b = 8D @'[Tagged Foo Bool, Tagged Bar Int] (5 :: Tagged Bar Int) t' =  (Mf @[Foo, Bar] @_ @[Tagged Bar Int, Tagged Foo Bool, Tagged Hi Char, Tagged Bye Bool] Proxy) b b' =  (M< @[Foo, Bar] Proxy) t' t `shouldBe` t' b' `shouldBe` Just b NH ( N) and K ( N) in  form. let x = 8 (5 :: Int) :: 5 '[String, Int] y = < (injectN @[3, 1] @_ @[Bool, Int, Char, String] Proxy) x -- H! y `shouldBe` pick (5 :: Int) :: 5% '[Bool, Int, Char, String] let y' =  (N$ @[3, 1] @[String, Int] Proxy) y --  reinterpertN' y' `shouldBe` Just (8 (5 :: Int)) :: Maybe (5 '[String, Int]) OCatamorphism for 5. This is equivalent to flip P.PA switch/case statement for 5. This is equivalent to flip OUse ' instances like   to apply a 5% 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 ( CaseTypeable. (show . typeRep . (pure @Proxy))) `shouldBe` Int +Or you may use your own custom instance of '.QCatamorphism for 5. This is equivalent to flip R.RA switch/case statement for 5. This is equivalent to flip QUse ' instances like   to apply a 55 of functions to a variant of values in index order. let y = < @0 Proxy (5 :: Int) :: 5 '[Int, Bool, Bool, Int] R y (   (show @Int  show @Bool  show @Bool  show @Int  )) `shouldBe` "5" +Or you may use your own custom instance of '.S read "impossible" == 7TThis  b instance tries to read using the each type in the typelist, using the first successful type read.Y read "impossible" == 7Z show (pick' 'A') == "pick 'A'"] (  7 7) == EQ^A 59 with a type at smaller type index is considered smaller.a (7 == 7 ) == TruebTwo 5Tes are only equal iff they both contain the equivalnet value at the same type index.c:Terminating case of the loop, ensuring that a instance of Case '[]< with an empty typelist is not required. You can't reduce 7d@ each type in a 5, and either handle the ( with value discovered, or "( trying the next type in the type list.e:Terminating case of the loop, ensuring that a instance of Case '[]< with an empty typelist is not required. You can't reduce 7f@ each type in a 5, and either handle the ( with value discovered, or $( trying the next type in the type list.mThe Unique x branch1 is important to get a compile error if the from branch doesn't have a unique xoA   instance encoded as either the x value (  ) or the Fed remaining 'Which xs'. The  and  metadata are not encoded.pA terminating  $ instance for one type encoded with pick'. The  and  metadata are not encoded.qA terminating  $ instance for no types encoded as a 7. The  and  metadata are not encoded.\-./012345678 9:;<=>!?@ABCDEFGHIJKLMNOPQR"#STUVWXYZ[\]^_`abcdefghijklmnopq&-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR&5678;:9<=>@?ABCD4EFG3H2IJ1KLMN/0OP-.QRP-./012345678 9:;<=>!?@ABCDEFGHIJKLMNOPQR"#STUVWXYZ[\]^_`abcdefghijklmnopq None%-./012345789:;<=>?@ABCDEFGHIJKLMNOPQR%578;:9<=>@?ABCD4EFG3H2IJ1KLMN/0OP-.QRSafe<=r@Constrained Foldable for a specified type instead for all types.rstrstrstrstNone%&*+,-9:;<=DEOQRTfY$$P avoids the following: Illegal type synonym family application in instance: Anyu)A friendlier type constraint synomyn for v)A friendlier type constraint synomyn for w)A friendlier type constraint synomyn for x)A friendlier type constraint synomyn for y)A friendlier type constraint synomyn for %For each type x in larger, generate the (k, v) in smaller (if it exists)z)A friendlier type constraint synomyn for &A variation of ' which uses ! instead of #'Collects the output from (ing each field in a ~. Uses # to prepare the ' 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.(A variation of & which uses ) instead of '* Variation of ' which uses ) instead of '+3Return the handler/continuation when x is observed.{mThis instance allows converting to and from Many There are instances for converting tuples of up to size 15.,8Many stored as a list. This is useful when folding over ~= efficienty so that the conversion to List is only done once~mA 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 Encoding: The record is encoded as (Offset, Map Int 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 - wrapperBConverts from a Many to a value (eg a tuple), via a Tagged wrapper _Many = iso fromMany toMany _Many' = iso fromMany' toMany'.6When appending two maps together, get the function to / the RightMap when adding RightMap into LeftMap. The existing contents of LeftMap will not be changed. LeftMap Offset will also not change. The desired key for element from the RightMap = RightIndex (of the element) + LeftOffset + LeftSize OldRightKey = RightIndex + RightOffset, therefore RightIndex = OldRightKey - RightOffset So we need to adjust the existing index on the RightMap by OldRightKey -> RightIndex + LeftOffset + LeftSize (as above) OldRightKey -> OldRightKey - RightOffset + LeftOffset + LeftSize0When appending two maps together, get the function to modify the RightMap's offset when adding LeftMap into RightMap. The existing contents of RightMap will not be changed. NewRightOffset = OldRightOffset - LeftSize16When appending two maps together, get the function to / the LeftMap when adding LeftMap into RightMap. The existing contents of RightMap will not be changed. The RightMap's offset will be adjusted using  rightOffsetWithRightMapUnchangedj The desired key for the elements in the the LeftMap = LeftIndex (of the element) + NewRightOffset OldLeftKey = LeftIndex + LeftOffset, therefore LeftIndex = OldLeftKey - LeftOffset So we need to adjust the existing index on the LeftMap by OldLeftKey -> LeftIndex + NewRightOffset (as above) OldLeftKey -> OldLeftKey - LeftOffset + NewRightOffset (as above) Analogous to . Named  to avoid conflicting with .0Create a Many from a single value. Analogous to 21Add an element to the left of a Many. Not named cons to avoid conflict with 3Infix 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 4 to avoid conflict with 44 mnemonic: Many is larger  than the smaller element mnemonic: 3  with an extra slash (meaning ~ ) in front.Appends two Manys togetherUExtract the first element of a Many, which guaranteed to be non-empty. Analogous to 5 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 6-Return all the elements of a Many except the 6 one, which guaranteed to be non-empty. Analogous to  /Getter by unique type. Get the field with type x. let x = (5 :: Int)  False  'X'  Just 'O'    @Int x `shouldBe` 5 5Getter 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  (7 ) and  (8 ) in 9 form. let x = (5 :: Int)  False  'X'  Just 'O'   x :  @Int `shouldBe` 5 (x ; " @Int .~ 6) `shouldBe` (6 :: Int)  False  'X'  Just 'O'   Polymorphic version of  (7 ) and  (8 ) in 9 form. let x = (5 :: Int)  Tagged @Foo False  Tagged @Bar 'X'   x : , @Foo Proxy `shouldBe` Tagged @Foo False (x ;  @Foo Proxy <) Tagged @Foo True) `shouldBe` (5 :: Int)  Tagged @Foo True  Tagged @Bar 'X'   Polymorphic version of  let x = (5 :: Int)  Tagged @Foo False  Tagged @Bar 'X'   (x ; itemL' @Foo Proxy < "foo") `shouldBe` (5 :: Int)  "foo"  Tagged @Bar 'X'    (7 ) and  (8 ) in 9 form. let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A' ./ nil x :  (Proxy @0) `shouldBe` 5 (x ;  (Proxy @0) < 6) `shouldBe` (6 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   Polymorphic version of =3Internal function for construction - do not expose! Folds any ~%, even with indistinct types. Given distinct handlers for the fields in ~ , create a '< of the results of running the handlers over the fields in ~.The ' is r to combine the results. let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   y = show @Int  show @Char  show @(Maybe Char)  show @Bool   s (:) [] ( ( 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   s (:) [] ( 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 a &< of the results of running the handlers over the fields in ~.The & is r to combine the results. 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)   s (:) [] ( ( 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)   s (:) [] ( 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  (7 ) and  (8 ) in 9 form.  = >   let x = (5 :: Int)  False  'X'  Just 'O'   x : (, @'[Int, Maybe Char]) `shouldBe` (5 :: Int)  Just 'O'   (x ; ( @'[Int, Maybe Char]) < ((6 :: Int)  Just P  )) `shouldBe` (6 :: Int)  False  'X'  Just 'P'   Polymorphic version of project' (7 ) and  (8 ) in 9 form. let x = False  Tagged @"Hi" (5 :: Int)  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Bye" 'O'   x : (2 @'[Foo, Bar] Proxy) `shouldBe` Tagged @Foo False  Tagged @Bar 'X'  nil (x ; ( @'["Hi", "Bye"] Proxy) < (Tagged @"Hi" (6 :: Int)  Tagged @"Bye" 'P'  nil)) 'shouldBe False  Tagged @"Hi" (6 :: Int)  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Bye" 'P'    Polymorphic version of projectL' let x = False  Tagged @"Hi" (5 :: Int)  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Bye" 'O'   (x ; ( @'["Hi", "Bye"] Proxy) < (True  Tagged @"Changed" False  )) `shouldBe` False  True  Tagged @Foo False  Tagged @Bar 'X'  Tagged @"Changed" False    (7 ) and  (8 ) in 9 form.  = >   let x = (5 :: Int)  False  'X'  Just 'O'  (6 :: Int)  Just 'A'   x : (( @'[5, 4, 0] Proxy) `shouldBe` Just 'A'  (6 :: Int)  (5 ::Int)   (x ; ( @'[5, 4, 0] Proxy) < (Just 'B'  (8 :: Int)  (4 ::Int) ! nil)) `shouldBe` (4 :: Int)  False  'X'  Just 'O'  (8 :: Int)  Just 'B'   Polymorphic version of   read "5 . False . X . Just O . nil" == (5 :: Int)  False  'X'  Just 'O'  Two ~%s are equal if all their fields equalTwo ~s are ordered by  ing 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 largerfor each x in smaller1, convert it to a (k, v) to insert into the x in largerfor each y in smaller1, convert it to a (k, v) to insert into the x in  Many largerfor 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 $ing Emitters through the xs typelist. nill case that doesn't even use (, so that an instance of Case '[] is not needed.Folds values by $ing Emitters through the xs typelist. nill case that doesn't even use (, 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 +, so that an instance of  CaseAny '[] is not needed.-This single field instance is the reason for -0 wrapper. Otherwise this instance will overlap.8These instances add about 7 seconds to the compile time!A   instance encoded as the  value ? with the  ~. The  and  metadata are not encoded.A terminating   instance encoded as a .$@ABuCDvEFwGHxIJy%Kz&L'M(N*O)+{|},P~QR.01STUVWX=YZ[\=uvwxyz{|}~=~{|}zyxwvu$@ABuCDvEFwGHxIJy%Kz&L'M(N*O)+{|},P~QR.01STUVWX=YZ[\555555None<uvwxyz{|}~<~{|}zyxwvu None,9:;<=DQRTfA variation of  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 # to construct this safely ensuring n starts at 0. 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  to construct this with ; constraint to reduce programming confusion. However, the A constructor is still exported to allow creating a master-of-all-'.Create an instance of ' for either handling  ing a Which. let y =   (5 :: Int) ::   '[Int, Bool]   y (  (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 ($ y)) `shouldBe` ["5", "False", "X ", "Just 'O'", "6", "Just 'A'"] !This function imposes additional  SameLength! constraints than when using the 5 constructor directly. It is better practice to use @ to prevent programming confusion with dead code. However, the A constructor is still exported to allow creating a master-of-all-'.Safe Constructor for  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 =  "6 @0 Proxy (5 :: Int) :: Which '[Int, Bool, Bool, Int]  ! y (  (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 ($ y)) `shouldBe` ["5", "False", "X ", "Just 'O'", "6", "Just 'A'"] UndecidableInstances because fs appears more often.UndecidableInstances because fs appers more often. ]]#None  !"#$%&'()*-./012345789:;<=>?@ABCDEFGHIJKLMNOPQRrstuvwxyz{|}~^$%&'()*+,-./0123456789:;<=>?@ABCDEF GHIJKLMNNOOPQRST UVW"XYZ[\]^_`abcdefghijk!lmnopqrstuvwxyz{|}~                         !"#$%&'&(&)&*++,-..//0011223456789:;<=>?@ABCDEFGHDIJKLKMNONPQRSTUQVWXSYZ[\&]7^^__``aabb89:;=?cdefghijklmn o+data-diverse-0.4.0.0-5ZATtDvfp547htMkVgvUohData.Diverse.TypeData.Diverse.ReiterateData.Diverse.ReduceData.Diverse.CaseData.Diverse.CaseTypeableData.Diverse.Which.InternalData.Diverse.AFoldableData.Diverse.Many.InternalData.Diverse.CasesData.Diverse.Type.Internal ReiterateData.Diverse.WhichpickWhichswitchData.Diverse.Many./nulafoldrforManyDataDynamic CaseTypeableCasescasesnilCasesNcasesNPreludenilllastinitswitchNpickN Data.DiverseZipInitAppend Complement SameLengthLastHeadTail ReplacesIndex ReplaceIndex WithoutIndexReplacesReplaceWithout KindsAtLabelsKindsAtIndicesKindAtPositionIs KindAtLabel KindAtIndex PositionOfIndexOf UniqueLabels UniqueLabelUniqueNub IsDistinctUniqueIfExists MaybeMemberAtMemberAtMaybeUniqueMemberAtUniqueLabelMemberUniqueMemberAt UniqueMember ReiterateN reiterateN reiterateReducereduceCasecase'$fCaseCaseTypeablexsr$fReiterateTYPECaseTypeablexsSwitchNSwitch ReinterpretN Reinterpret DiversifyN Diversify impossiblepickLpickOnlypick0obvioustrialtrialLtrial0trialNfacetfacetLfacetN diversify diversify0 diversifyL diversifyN reinterpret reinterpretL reinterpretNinjectinjectLinjectNwhichwhichN $fReadWhich $fReadWhich0$fWhichReadWhich_$fWhichReadWhich_0$fCaseCaseShowWhich:(->)$fReiterateTYPECaseShowWhich: $fShowWhich $fShowWhich0$fCaseCaseOrdWhich:Ordering$fReiterateTYPECaseOrdWhich: $fOrdWhich $fOrdWhich0$fCaseCaseEqWhich:Bool$fReiterateTYPECaseEqWhich: $fEqWhich $fEqWhich0$fReduceWhichSwitchN:r$fReduceWhichSwitchN:r0$fReduceWhichSwitch:r$fReduceWhichSwitch:r0$fCaseCaseReinterpretN:Maybe&$fReiterateNTYPECaseReinterpretNntree'$fCaseCaseReinterpret:Either#$fReiterateTYPECaseReinterprettree'$fCaseCaseDiversifyN:Which&$fReiterateNTYPECaseDiversifyNnbranch'$fCaseCaseDiversify:Which#$fReiterateTYPECaseDiversifybranch'$fGenericWhich$fGenericWhich0$fGenericWhich1 AFoldableafoldl'AmendN'AmendNAmend'AmendSelectNSelectIsManytoManyfromManyManytoMany' fromMany'_Many_Many'singleprefixpostfix\././appendfrontbackaftforefetchfetchLfetchNreplacereplace'replaceL replaceL'replaceN replaceN'itemitem'itemLitemL'itemNitemN'collectforManyNcollectNselectselectLselectNamendamendLamend'amendL'amendNamendN'projectproject'projectL projectL'projectN projectN' $fReadMany $fReadMany_ $fReadMany_0 $fShowMany $fShowMany_ $fShowMany_0 $fOrdMany $fOrdMany_ $fOrdMany_0$fEqMany $fEqMany_ $fEqMany_0$fCaseAnyCaseAmendN':(,)$fReiterateNkCaseAmendN'n:$fCaseAnyCaseAmendN:(,)$fReiterateNkCaseAmendNn:$fCaseAnyCaseAmend':(,)$fReiteratekCaseAmend':$fCaseAnyCaseAmend:(,)$fReiteratekCaseAmend:$fCaseAnyCaseSelectN:Maybe$fReiterateNkCaseSelectNn:$fCaseAnyCaseSelect:Maybe$fReiteratekCaseSelect:$fAFoldableCollectorNr$fAFoldableCollectorNr0$fAFoldableCollectorr$fAFoldableCollectorr0$fAFoldableCollectorAnyNr$fAFoldableCollectorAnyNr0$fAFoldableCollectorAnyr$fAFoldableCollectorAnyr0#$fIsManyTYPETagged:(,,,,,,,,,,,,,,)"$fIsManyTYPETagged:(,,,,,,,,,,,,,)!$fIsManyTYPETagged:(,,,,,,,,,,,,) $fIsManyTYPETagged:(,,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,)$fIsManyTYPETagged:(,,,,,,)$fIsManyTYPETagged:(,,,,,)$fIsManyTYPETagged:(,,,,)$fIsManyTYPETagged:(,,,)$fIsManyTYPETagged:(,,)$fIsManyTYPETagged:(,)$fIsManyTYPETagged:a$fIsManyTYPETagged[]() $fGenericMany$fGenericMany0$fCaseCasesNxsr$fReiterateNTYPECasesNnxs$fCaseCasesxsr$fReiterateTYPECasesxsZipImplReplacesIndexImplReplaceIfIndex ReplacesImpl ReplaceImplReplaceIndexImplWithoutIndexImplSameLengthImplKindAtLabelImplKindAtIndexImplUniqueLabelImpl UniqueImplIsDistinctImplMissingLabelImpl MissingImplNubImpl IndexOfImplPositionOfImplbase GHC.TypeLitsnatVal CaseOrdWhich CaseEqWhich Data.EitherLeftEitherRighthush"lens-4.15.3-GRH811MbksMBOUEHeCzPzdControl.Lens.ReviewreviewControl.Lens.FoldpreviewControl.Lens.TypePrism'Control.Lens.Prismprism'GHC.ReadReadghc-prim GHC.Classescompare GHC.GenericsGeneric:+:C1S1Which_ WhichRead whichReadPrec CaseShowWhichCaseReinterpretNCaseReinterpretCaseDiversifyN CaseDiversifypick_trial_ diversify0' readWhich_ WrappedAny CaseSelect CollectorN Collector CollectorAnyNCaseAny CollectorAnycaseAnyMany_"tagged-0.8.5-jDBtbBndklGIlXZjVMhpH Data.TaggedTaggedrightKeyForSnoccontainers-0.5.7.1 Data.Map.BasemapKeysrightOffsetForConsleftKeyForConsData.Map.Strict singletonControl.Lens.ConsconssnocGHC.ListheadtailControl.Lens.GetterviewControl.Lens.SettersetLens'^. Data.Function&.~ fromList'Control.Lens.Lenslens:*: CaseAmendN' CaseAmendN CaseAmend' CaseAmend CaseSelectNtoMany_ fromMany_prefix'front'aft'fetch_replace_ replace'_forMany' forManyN' forMany'' forManyN''