!H84A      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef g h i j k l m n o p q r s t u v w x y z { | } ~                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ Safe>? data-diverse@Constrained Foldable for a specified type instead for all types.Safe->?FT data-diverseConvert something v into rg using handlers. This class is required in order to step through all the different types in a variant.Safe,-FST- data-diverseZips up xs and ys, which must be the same length data-diverse 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 data-diverse The type x replaced by an y if an n matches i.  data-diverse The typelist zs with the first xs replaced by ys. xs must be the same size as ys  data-diverse The typelist xs with the first x replaced by y. It is okay for x not to exist in xs  data-diverse The typelist xs with the type at Nat n replaced by y. n must be within bounds of xs  data-diverse The typelist xs without the type at Nat n. n must be within bounds of xs  data-diverse)Ensures two typelists are the same length data-diverseLabelled access into the list data-diverseIndexed access into the list data-diverseEnsures that the label in tagged label v only ever appears once in xs. data-diverse Ensures that x only ever appears once in xs data-diverseEEnsures that the type list contain unique types. Not implemented as  (xs ~ Nub xs) for better type error messages. data-diverse&Errors if a label exists in a typelist data-diverse%Errors if a type exists in a typelist data-diverseSearches 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 data-diverse)Get the first index of a type from a list data-diverseBGet the first position of a type (indexed by 1) Will return 0 if x doesn't exists in xs.  Safe+,-;<=>?FSTVib' data-diverse'This is useful as a level function for k in  CaseFunc1 data-diverse9Tests if all the types in a typelist satisfy a constraint data-diverse'Return a list of results from applying   to every type in the xs typelist.  data-diverseThe result from evaluating a Case with a type from a typelist.! data-diverseXTakes two lists which must be the same length and returns a list of corresponding pairs." data-diverse!Returns the typelist without the & type# data-diverse Returns a xs appended with ys$ data-diverse-Set complement. Returns the set of things in xs that are not in ys.% data-diverse)Ensures two typelists are the same length' data-diverse Get the first type in a typelist( data-diverseGet the typelist without the ' type) data-diverse 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* data-diverse The typelist xs without the type at Nat n replaced by y. n must be within bounds of xs+ data-diverse The typelist xs without the type at Nat n. n must be within bounds of xs, data-diverse The typelist zs with the first xs replaced by ys. xs must be the same size as ys- data-diverse The typelist xs with the first x replaced by y. It is okay for x not to exist in xs. data-diverse The typelist xs without first x. It is okay for x not to exist in xs/ data-diverseGet the types with labels ls from xs0 data-diverse!Get the types at an list of index1 data-diverse\It's actually ok for the position to be zero, but if it's not zero then the types must match2 data-diverseGet the type at a label3 data-diverseGet the type at an index4 data-diverseVGet the first index of a type (Indexed by 1) Will return 0 if x doesn't exists in xs.5 data-diverseaGet the first index of a type (Indexed by 0) Will result in type error if x doesn't exist in xs.6 data-diverseEnsures that the label list all 7s7 data-diverseEnsures that the label in tagged label v only ever appears once in xs.8 data-diverse Ensures that x only ever appears once in xs9 data-diverse/Return the list of distinct types in a typelist: data-diverse/Ensures that the type list contain unique types; data-diverse Ensures x is a unique member in xs iff it exists in ys< data-diverse For each y in ys, snocs them to end of xs if y doesn't already exist in xs= data-diverseSnoc x to end of xs if x doesn't already exist in xs> data-diverse Ensures that x is a member of xs at n if it exists, and that E can be used.? data-diverse Ensures that x is a member of xs at n , and that E can be used.@ data-diverse Ensures that x is a unique member of xs if it exists, and that E can be used.A data-diverse Ensures that x is a unique member of xs , and that E can be used.B data-diverse Every x in xs is a `UniqueMember x ys`C data-diverse Ensures that x is a unique member of xs , and that E can be used.D data-diverseProduce a runtime A value corresponding to a B type. Based on  khttps://github.com/VinylRecords/Vinyl/blob/a5ffd10fbc747c5366ae9806e61bf45f78c3eb33/Data/Vinyl/TypeLevel.hs This is used instead of C because to avoid inefficient D  1https://github.com/louispan/data-diverse/issues/8 AllowsAmbiguousTypes! Uses TypeApplication instead of Proxy. !"#$%&'()*+,-./0123456789:;<=>?@ABCDE.DECBA@?>=<;:9876543210/.-,+*)('&%$#"! Safe,->?FSTihN data-diverseTAllows iterating over the types in a typelist, whilst also incrementing an Nat indexO data-diverse&Return the next iteration without the ' type x in (x ': xs)P data-diverse-Allows iterating over the types in a typelistQ data-diverse&Return the next iteration without the ' type x in (x ': xs)NOPQPQNOSafe->?FSTVoR data-diverse8This 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.S data-diverse3Return the handler/continuation when x is observed.RSRSSafe+-;<=>?FQSTV}T data-diverseA varation of Z$ that doesn't change the return typeV data-diverseIThis handler stores a polymorphic function that work on higher kinds, eg E You may want to use NoContraint for k@X data-diverseHThis 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)      (X @F (+10)) x `shouldBe` y Z data-diverseIThis handler stores a polymorphic function that returns a different type. let y =  (5 :: Int) ::  '[Int, Bool]  y (Z @. (show . typeRep . (pure @Proxy))) `shouldBe` Int let x = (5 :: Int)   False   'X'   Just 'O'   (6 :: Int)   Just 'A'      (:) [] (  (Z @p (show . typeRep . (pure @Proxy))) x) `shouldBe` ["Int", "Bool", "Char", "Maybe Char", "Int", "Maybe Char"] TUVWXYZ[Z[XYVWTUSafe>??d data-diverseGiven a 7 that transforms each type in the typelist, convert a f xs to f (CasesResults c xs)dede None&'+,-.;<=>?FGQSTViMTG data-diverseGP avoids the following: Illegal type synonym family application in instance: Anyf data-diverse)A friendlier type constraint synomyn for g data-diverse)A friendlier type constraint synomyn for h data-diverse)A friendlier type constraint synomyn for i data-diverse)A friendlier type constraint synomyn for j data-diverse)A friendlier type constraint synomyn for H data-diverseFor each type x in larger, generate the (k, v) in smaller (if it exists)k data-diverse)A friendlier type constraint synomyn for l data-diverse)A friendlier type constraint synomyn for  and m data-diverseA variation of o which uses N instead of Pn data-diverse)A friendlier type constraint synomyn for  and o data-diverseCollects the output from Sing each field in a s. Uses P to prepare the R to accept the next type in the xs typelist.@Internally, this holds the left-over [(k, v)] from the original s 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.I data-diverseA variation of m which uses J instead of RK data-diverse Variation of o which uses J instead of RL data-diverse3Return the handler/continuation when x is observed.p data-diversemThis instance allows converting to and from Many There are instances for converting tuples of up to size 15.M data-diverse8Many stored as a list. This is useful when folding over s= efficienty so that the conversion to List is only done onces data-diversemA 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 y. (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 moduleu data-diverse(Converts from a value (eg a tuple) to a s, via a N wrapperv data-diverseBConverts from a Many to a value (eg a tuple), via a Tagged wrapperw data-diverseEmpty s.x data-diverse0Create a Many from a single value. Analogous to Oy data-diverse1Add an element to the left of a Many. Not named cons to avoid conflict with z data-diverseInfix version of y.)Mnemonic: Element on the left is smaller z than the larger s to the right.{ data-diverse1Add an element to the right of a Many Not named snoc to avoid conflict with | data-diverseJAdd an element to the right of a Many iff the field doesn't already exist.} data-diverseInfix version of {.Mnemonic: Many is larger } than the smaller element~ data-diverseInfix version of . Mnemonic: y z with an extra slash (meaning s ) in front. data-diverseAppends two Manys together data-diverseXSplit a non-empty Many into the first element, then the rest of the Many. Analogous to P data-diverseVSplit a non-empty Many into initial part of Many, and the last element. Analogous to Q data-diverseUExtract the first element of a Many, which guaranteed to be non-empty. Analogous to R data-diverse Extract the D element of a Many, which guaranteed to be non-empty. Analogous to   data-diverse`Extract the elements after the front of a Many, which guaranteed to be non-empty. Analogous to S data-diverse-Return all the elements of a Many except the 6 one, which guaranteed to be non-empty. Analogous to ! data-diverse/Getter by unique type. Get the field with type x. let x = (5 :: Int) z False z 'X' z Just 'O' z w  @Int x `shouldBe` 5  data-diverse5Getter by label. Get the value of the field with tag label! which can be any type not just  KnownSymbol. let y = False z Tagged @Foo 'X' z Tagged @Hi True z w # @Foo y `shouldBe` Tagged @Foo 'X'  @Hi y `shouldBe` Tagged @Hi True  data-diverse Variation of  of a Tagged field N that untags the field. data-diverseDGetter by index. Get the value of the field at index type-level Nat n let x = (5 :: Int) z False z 'X' z Just 'O' z w  @1 x `shouldBe` False  data-diverse/Setter by unique type. Set the field with type x. let x = (5 :: Int) z False z 'X' z Just 'O' z w  @Int x 6 `shouldBe` (6 :: Int) z False z 'X' z Just 'O' z w  data-diverse;Polymorphic setter by unique type. Set the field with type x, and replace with type y let x = (5 :: Int) z False z 'X' z Just 'O' z w ) @Int x (Just True) `shouldBe` Just True z False z 'X' z Just 'O' z w  data-diverse1Setter by unique label. Set the field with label l. let y = (5 :: Int) z False z Tagged @Foo 'X' z Tagged @"Hello" (6 :: Int) z w 4 @Foo y (Tagged @Foo 'Y') `shouldBe` (5 :: Int) z False z Tagged @Foo 'Y' z Tagged @"Hello" (6 :: Int) z w : @"Hello" y (Tagged @"Hello" 7) `shouldBe` (5 :: Int) z False z Tagged @Foo 'X' z Tagged @"Hello" (7 :: Int) z w  data-diverse;Polymorphic setter by unique type. Set the field with type x, and replace with type y let y = (5 :: Int) z False z Tagged @Foo 'X' z Tagged @"Hello" (6 :: Int) z w# replaceL @Foo y (Tagged @Bar 'Y') shouldBe (5 :: Int) z False z Tagged Bar Y z Tagged Hello (6 :: Int) z wG replaceL @"Hello" y (Tagged @"Hello" False) `shouldBe` (5 :: Int) z False z Tagged @Foo 'X' z Tagged @"Hello" False z w  data-diverse Variation of  specialized to N2 that automatically tags the value to be replaced. data-diverse Variation of  specialized to N2 that automatically tags the value to be replaced. data-diverseDSetter by index. Set the value of the field at index type-level Nat n let x = (5 :: Int) z False z 'X' z Just 'O' z w  @0 x 7 shouldBe  data-diversePolymorphic version of T data-diverse3Internal function for construction - do not expose! data-diverse Folds any s%, even with indistinct types. Given distinct handlers for the fields in s , create < of the results of running the handlers over the fields in s. let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w y = show @Int z show @Char z show @(Maybe Char) z show @Bool z w  (:) [] ( ( "I y) x) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  data-diverseThis is flip  let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w y = show @Int z show @Char z show @(Maybe Char) z show @Bool z w  (:) [] ( x ( "G y)) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  data-diverse Folds any s%, even with indistinct types. Given index handlers for the fields in s , create < of the results of running the handlers over the fields in s. let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w y = show @Int z show @Bool z show @Char z show @(Maybe Char) z show @Int z show @(Maybe Char) z w  (:) [] ( ( #I y) x) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  data-diverseThis is flip  let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w y = show @Int z show @Bool z show @Char z show @(Maybe Char) z show @Int z show @(Maybe Char) z w  (:) [] ( x ( #G y)) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]  data-diverse Construct a sB 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 s. let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w # @'[Bool, Char] x `shouldBe` False z 'X' z w  data-diverseA variation of  which selects by labels let x = False z Tagged @"Hi" (5 :: Int) z Tagged @Foo False z Tagged @Bar 'X' z Tagged @"Bye" O z w - @'[Foo, Bar] x `shouldBe` Tagged @Foo False z Tagged @Bar 'X' z w 6 @'["Hi", "Bye"] x `shouldBe` Tagged @"Hi" (5 :: Int) z Tagged @"Bye" 'O' z w  data-diverseA 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) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w # @'[5, 4, 0] x `shouldBe` Just 'A' z (6 :: Int) z (5 ::Int) z w  data-diverseSets the subset of s in the larger s. Analogous to  setter but for multiple fields. let x = (5 :: Int) z False z 'X' z Just 'O' z w # @'[Int, Maybe Char] x ((6 :: Int) z Just 'P' z w) `shouldBe` (6 :: Int) z False z 'X' z Just 'P' z w  data-diverseA variation of  which amends via labels. let x = False . Tagged @"Hi" (5 :: Int) . Tagged @Foo False . Tagged @Bar 'X' . Tagged @"Bye" 'O' ./ w # @'[Foo, Bar] x (Tagged @Foo True . Tagged @Bar 'Y' . nil) shouldBe False . Tagged @"Hi" (5 :: Int) . Tagged @Foo True . Tagged @Bar 'Y' . Tagged @"Bye" 'O' ./ w - @'["Hi", "Bye"] x (Tagged @"Hi" (6 :: Int) . Tagged @"Bye" 'P' . nil) shouldBe False . Tagged @"Hi" (6 :: Int) . Tagged @Foo False . Tagged @Bar 'X' . Tagged @"Bye" 'P' ./ w  data-diversePolymorphic version of . Analogous to  setter but for multiple fields. data-diverseA variation of  which amends via labels. let x = False z Tagged @"Hi" (5 :: Int) z Tagged @Foo False z Tagged @Bar X z Tagged @"Bye" 'O' z w  @'[Foo, Bar] x ('Y' z True z nil) `shouldBe` False z Tagged @"Hi" (5 :: Int) z 'Y' z True z Tagged @"Bye" 'O' z w  @'["Hi", "Bye"] x (True z Tagged @"Changed" True z w) `shouldBe` False z True z Tagged @Foo False z Tagged @Bar 'X' z Tagged @"Changed" True z w  data-diverseA 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) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z w  @'[5, 4, 0] x (Just 'B' z (8 :: Int) z (4 ::Int) z w) `shouldBe` (4 :: Int) z False z 'X' z Just 'O' z (8 :: Int) z Just 'B' z w  data-diverseA polymorphic variation of  data-diverseA U instance encoded as the  value V with the  s. The W and X metadata are not encoded. data-diverseA terminating U instance encoded as a w. data-diverse  read "5 . False . X . Just O . nil" == (5 :: Int) z False z 'X' z Just 'O' z w data-diverse show (5 :: Int) z False z 'X' z Just 'O' z w == "5 . False . X . Just O . nil" == data-diverseTwo ss are ordered by Ying their fields in index order data-diverseTwo s%s are equal if all their fields equal data-diverseGiven a 7 that transforms each type in the typelist, convert a Many xs to Many (CaseResults c xs) data-diverseRecursive AFunctor instance for non empty type list delegate afmap'ing the remainder to an instance of Collector' with one less type in the type list data-diverse1Terminating AFunctor instance for empty type list data-diverse-This single field instance is the reason for N0 wrapper. Otherwise this instance will overlap. data-diverse8These instances add about 7 seconds to the compile time! data-diverse nill case that doesn't even use L, so that an instance of  CaseAny '[] is not needed. data-diverse nill case that doesn't even use caseAnyN, so that an instance of  CaseAnyN '[] is not needed. data-diverseFolds values by Qing Rs through the xs typelist. data-diverse nill case that doesn't even use S, so that an instance of Case '[] is not needed. data-diverseFolds values by Qing Emitters through the xs typelist. data-diverse nill case that doesn't even use S, so that an instance of Case '[] is not needed. data-diversefor each x in smaller1, convert it to a (k, v) to insert into the x in larger data-diversefor each x in smaller1, convert it to a (k, v) to insert into the x in larger data-diversefor each y in smaller1, convert it to a (k, v) to insert into the x in  Many larger data-diversefor each x in smaller1, convert it to a (k, v) to insert into the x in  Many larger data-diverseFor each type x in larger?, find the index in ys, and create an (incrementing key, value) data-diverseJFor each type x in larger, find the index in ys, and create a (key, value)9fghijklmnopqrstuvwxyz{|}~9stpqrvuwxyz{|}~kjhifgnolmy5z5{5|5}5~55 NoneO8fghijklmnopqrsuvwxyz{|}~8spqrvuwxyz{|}~kjhifgnolm None+-;<=>?FSTViu data-diverseA 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. data-diverse Contains a s4 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. data-diverseCreate an instance of R for either handling ing a Which. let y =  (5 :: Int) ::  '[Int, Bool]  y (  (show @Bool z show @Int z nul)) `shouldBe` "5" Or for handling  from a s. let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z nul y = show @Int z show @Char z show @(Maybe Char) z show @Bool z 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-R. data-diverseA variation of  without the  SameLength. constraint to allow creating a master-of-all-R. data-diverseSafe 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 z show @Bool z show @Bool z show @Int z nul)) `shouldBe` "5" Or for handling  from a s. let x = (5 :: Int) z False z 'X' z Just 'O' z (6 :: Int) z Just 'A' z nul y = show @Int z show @Bool z show @Char z show @(Maybe Char) z show @Int z show @(Maybe Char) z nul  (:) [] ( x ($ y)) `shouldBe` ["5", "False", "X ", "Just 'O'", "6", "Just 'A'"]  data-diverseA variation of  without the  SameLength. constraint to allow creating a master-of-all-R. data-diverseUndecidableInstances because fs appers more often. data-diverseUndecidableInstances because fs appears more often. None&'+,-;<=>?AFGQSTVdi.HEZ data-diversebDo not export constructor Stores the right Any to be compared when the correct type is discovered[ data-diversebDo not export constructor Stores the right Any to be compared when the correct type is discovered data-diverseA switch/case statement for . This is equivalent to flip Use R instances like  & to apply a 5 of functions to a variant of values in index order. let y =  @0 (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 R. data-diverse is a variation of  which O!s through the possibilities in a , delegating work to CaseN, ensuring termination when  only contains one type. data-diverse$A friendlier constraint synonym for  reinterpretN. data-diverse is an instance of  for which Q!s through the possibilities in a , delegating handling to R, ensuring termination when  only contains one type. data-diverse$A friendlier constraint synonym for  reinterpretN. data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for . data-diverse$A friendlier constraint synonym for  . data-diverseA  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:  destructor:  injection:   and catamorphism:  or ~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:  destructor:  inejction:  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 data-diverse 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 ] -over from ing a  Which '[x]6 with one type. It is an uninhabited type, just like ^ data-diverseA  Which '[Void] is equivalent to  Which '[] A  Which '[Void] might occur if you lift a ^ into a Which with ). This allows you to convert it back to ^ or  Which '[] data-diverseThis function is useful to type restrict something that returns a polymorphic type to return (Which '[]). Eg. use thishat to prove at compile time that a finished continuation monad has no more unhandled holes. data-diverseLift 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 T 'A' @_ @'[Int, Bool, Char, Maybe String] :: Which '[Int, Bool, Char, Maybe String]  data-diverseA variation of  where x is specified via a label let y = T @Foo (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x =  @Foo y x shouldBe (Right (Tagged 5))  data-diverse Variation of  specialized to N# that automatically tags the value. data-diverseA variation of  into a  of a single type.  'A' :: Which '[Char]  data-diverseA variation of  into a  where x is the first type. ! 'A' :: Which '[Char, Int, Bool]  data-diverseLift a value into a H of possibly other (possibley indistinct) types, where the value is the n -th type. < @4 (5 :: Int) :: Which '[Bool, Int, Char, Bool, Int, Char]  data-diverseIt is  what value is inside a  of one type. let x = pick' 'A' :: Which '[Char]  x `shouldBe` 'A'  data-diverse the n-th type of a  , and get _ the ` value or the ]-over possibilities. let x = - 'A' @_ @'[Int, Bool, Char, Maybe String] :: " '[Int, Bool, Char, Maybe String]  @1 x `shouldBe` Left ( 'A') ::  '[Int, Char, Maybe String]  data-diverse a type in a  and _ get the ` value or the ]-over possibilities. let x = * 'A' @'[Int, Bool, Char, Maybe String] :: " '[Int, Bool, Char, Maybe String]  @Char x `shouldBe` Right 'A'  @Int x `shouldBe` Left ( 'A') ::  '[Bool, Char, Maybe String]  data-diverseA variation of ! where x is specified via a label let y = T @Foo (Tagged (5 :: Int)) :: Which '[Bool, Tagged Foo Int, Tagged Bar Char] x =  @Foo Proxy y x shouldBe (Right (Tagged 5))  data-diverse Variation of  specialized to N which untags the field. data-diverse Variation of  which returns a Maybe data-diverse Variation of  which returns a Maybe data-diverse Variation of  which returns a Maybe data-diverse Variation of  specialized to N which untags the field.  data-diverseA variation of a   which "s the first type in the type list. let x = * 'A' @'[Int, Bool, Char, Maybe String] :: " '[Int, Bool, Char, Maybe String]   x `shouldBe` Left ( 'A') ::  '[Bool, Char, Maybe String]   data-diverse Variation of   which returns a Maybe  data-diverse 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 =   @_ @[Int, Bool] a ::  '[Int, Bool] c =   @_ @[Bool, Int] b ::  '[Bool, Int]   data-diverseA simple version of  5 which add another type to the front of the typelist.  data-diverseA restricted version of   which only rearranges the types data-diverseA variation of   where branch+is additionally specified by a labels list. let y =  (5 :: Tagged Bar Int) y' =  @'[Bar] y :: . '[Tagged Bar Int, Tagged Foo Bool] y'' =  @'[Bar, Foo] y' :: $ '[Tagged Foo Bool, Tagged Bar Int]  y'' (Z @A (show . typeRep . (pure @Proxy))) `shouldBe` "Tagged * Bar Int"  data-diverseA variation of   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' = # @'[0] @_ @[Int, Bool] y y'' =  @[1,0] @_ @[Bool, Int] y'  y'' (Z @4 (show . typeRep . (pure @Proxy))) `shouldBe` "Int"  data-diverse Convert a  into possibly another 6 with a totally different typelist. Returns either a  with the ` value, or a  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 = " @[Int, Char, Bool] (5 :: Int) :: ! '[Int, Char, Bool] let b =  ([String, Char] y b `shouldBe` Left ( (5 :: Int)) ::  '[Int, Bool] let c =  ([String, Int] a c `shouldBe` Right ( (5 :: Int)) ::  '[String, Int]  data-diverse Variation of  which returns a Maybe. data-diverseA variation of  where the branch. is additionally specified with a labels list. let y = d @[Tagged Bar Int, Tagged Foo Bool, Tagged Hi Char, Tagged Bye Bool] (5 :: Tagged Bar Int) y' =  @[Foo, Bar] y x = P @[Tagged Foo Bool, Tagged Bar Int] (5 :: Tagged Bar Int) y' `shouldBe` Right x  data-diverse Variation of  which returns a Maybe. data-diverseA limited variation of  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. data-diverseA switch/case statement for . This is equivalent to flip Use R 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 Z @2 to apply a polymorphic function that work on all Typeables. let y =  (5 :: Int) ::  '[Int, Bool]  y (Z @. (show . typeRep . (pure @Proxy))) `shouldBe` Int +Or you may use your own custom instance of R. data-diverseCatamorphism for  . This is flip . data-diverseCatamorphism for . This is equivalent to flip .a data-diverseHcoerce Which to another type without incrementing Int. THis is because b$ instance already increments the intc data-diverse&Succeed reading if the Int index match data-diverseRecursive AFunctor instance for non empty type list delegate afmap'ing the remainder to an instance of Collector' with one less type in the type list data-diverse1Terminating AFunctor instance for empty type list data-diverse (Y zilch zilch) == EQ data-diverse (zilch == zilch ) == True data-diverseA U instance encoded as either the x value (d ) or the  ed remaining 'Which xs'. The W and X metadata are not encoded.  data-diverseA terminating U$ instance for one type encoded with pick'. The W and X metadata are not encoded.! data-diverseA terminating U6 instance for no types encoded as a 'Which '[]'. The W and X metadata are not encoded." data-diverseThe Unique x branch1 is important to get a compile error if the from branch doesn't have a unique x- data-diverseAllow 'Which '[Void]' to be ed or  ,ed into anything else This is safe because  Which '[Void]F is uninhabited, and this is already something that can be done with . data-diverseAllow ^ to be ed or  ,ed into anything else This is safe because VoidF is uninhabited, and this is already something that can be done with / data-diverseAllow 'Which '[]' to be ed or  ,ed into anything else This is safe because  Which '[]F is uninhabited, and this is already something that can be done with 0 data-diverse:Terminating case of the loop, ensuring that a instance of Case '[]) with an empty typelist is not required.1 data-diverse  each type in a , and either handle the S with value discovered, or Q( trying the next type in the type list.2 data-diverse:Terminating case of the loop, ensuring that a instance of Case '[]< with an empty typelist is not required. You can't reduce zilch3 data-diverse  each type in a , and either handle the S with value discovered, or O( trying the next type in the type list.7 data-diverseTwo Tes are only equal iff they both contain the equivalnet value at the same type index.: data-diverseA 9 with a type at smaller type index is considered smaller.= data-diverse show (pick' 'A') == "pick 'A'"> data-diverseThis eb instance tries to read using the each type in the typelist, using the first successful type read.2     2     None01     1     None1 !"#$%&'()*+,-./0123456789:;<=>?@ABCDENOPQRSTUVWXYZ[defghijklmnopqrsuvwxyz{|}~     f*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx yz{{||}}~~                 & ) " #  $                        %               ! " # $ % & '  ( ) * + , - . / 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 RSTUSTVWXYZ[\W]^W_` a b c d e f ghijklmklnkloWpqWpr sWtuWtvWtwWtxSyz { |W}~WW}WW   WtW+data-diverse-4.6.0.0-8c5zxltYQ4IFMiJvxgdpXUData.Diverse.AFoldableData.Diverse.ReduceData.Diverse.TypeLevel.InternalData.Diverse.TypeLevelData.Diverse.ReiterateData.Diverse.CaseData.Diverse.CaseFuncData.Diverse.AFunctorData.Diverse.Many.InternalData.Diverse.CasesData.Diverse.Which.Internal ReiterateData.Diverse.Many./nilafmapData.Diverse.WhichpickWhichswitch Data.TypeableTypeablenulafoldrforMany Data.DiverseCase Control.LensconssnocPreludelastinitcasescasesNswitchNpickNCasesNDataDynamicCases AFoldableafoldl'ReducereduceReducedZipImplReplacesIndexImplReplaceIfIndex ReplacesImpl ReplaceImplReplaceIndexImplRemoveIndexImplSameLengthImplKindAtLabelImplKindAtIndexImplUniqueLabelImpl UniqueImplIsDistinctImplIsUniqueLabelImpl IsUniqueImplNubImpl IndexOfImplPositionOfImplC6C5C4C3C2C0AllConstrained CaseResults CaseResultZipInitAppend Complement SameLengthLastHeadTail ReplacesIndex ReplaceIndex RemoveIndexReplacesReplaceRemove KindsAtLabelsKindsAtIndicesKindAtPositionIs KindAtLabel KindAtIndex PositionOfIndexOf UniqueLabels UniqueLabelUniqueNub IsDistinctUniqueIfExists AppendUnique SnocUnique MaybeMemberAtMemberAtMaybeUniqueMemberUniqueLabelMember UniqueMembers UniqueMemberNatToIntnatToInt $fNatToIntn $fNatToInt0$fC0ka $fC2kc1c2a $fC3kc1c2c3a$fC4kc1c2c3c4a$fC5kc1c2c3c4c5a$fC6kc1c2c3c4c5c6a ReiterateN reiterateN reiteratecase' CaseFunc1' CaseFunc1 CaseFunc'CaseFunc$fCaseCaseFunc:$fReiterateCaseFuncxs$fCaseCaseFunc':$fReiterateCaseFunc'xs$fCaseCaseFunc1:$fReiterateCaseFunc1xs$fCaseCaseFunc1':$fReiterateCaseFunc1'xsAFunctorAmendNAmendN'AmendAmend'SelectNSelectCollectN CollectorNCollect CollectorIsManytoManyfromManyManytoMany' fromMany'singleconsManysnocMany snocMany'\././appendviewfviewbfrontbackaftforegrabgrabLgrabTaggrabNreplace'replace replaceL'replaceL replaceTag' replaceTag replaceN'replaceNcollectforManyNcollectNselectselectLselectNamend'amendL'amendamendLamendN'amendN $fNFDataMany $fNFDataMany0 $fGenericMany$fGenericMany0 $fReadMany $fReadMany_ $fReadMany_0 $fShowMany $fShowMany_ $fShowMany_0 $fMonoidMany $fMonoidMany_$fMonoidMany_0$fSemigroupMany$fSemigroupMany_$fSemigroupMany_0 $fOrdMany $fOrdMany_ $fOrdMany_0$fEqMany $fEqMany_ $fEqMany_0$fAFunctorManycas$fAFunctorMany_c:$fAFunctorMany_c[]#$fIsManyTYPETagged:(,,,,,,,,,,,,,,)"$fIsManyTYPETagged:(,,,,,,,,,,,,,)!$fIsManyTYPETagged:(,,,,,,,,,,,,) $fIsManyTYPETagged:(,,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,,)$fIsManyTYPETagged:(,,,,,,,)$fIsManyTYPETagged:(,,,,,,)$fIsManyTYPETagged:(,,,,,)$fIsManyTYPETagged:(,,,,)$fIsManyTYPETagged:(,,,)$fIsManyTYPETagged:(,,)$fIsManyTYPETagged:(,)$fIsManyTYPETagged:a$fIsManyTYPETagged[]()$fAFoldableCollectorAnyr$fAFoldableCollectorAnyr0$fAFoldableCollectorAnyNr$fAFoldableCollectorAnyNr0$fAFoldableCollectorr$fAFoldableCollectorr0$fAFoldableCollectorNr$fAFoldableCollectorNr0$fReiterateCaseSelect:$fReiterateNCaseSelectNn:$fReiterateCaseAmend':$fReiterateCaseAmend:$fReiterateNCaseAmendN'n:$fReiterateNCaseAmendNn:$fCaseAnyCaseAmendN:$fCaseAnyCaseAmendN':$fCaseAnyCaseAmend:$fCaseAnyCaseAmend':$fCaseAnyCaseSelectN:$fCaseAnyCaseSelect:cases'casesN' $fCaseCasesxs$fReiterateCasesxs$fCaseCasesNxs$fReiterateNCasesNnxsSwitchN SwitcherNSwitchSwitcher ReinterpretN' ReinterpretL' ReinterpretL Reinterpret' Reinterpret DiversifyN DiversifyL Diversify impossible impossible'totallypickLpickTagpickOnlypick0obvioustrialNtrialtrialLtrialTagtrialN'trial'trialL' trialTag'trial0trial0' diversify diversify0 diversify' diversifyL diversifyN reinterpret reinterpret' reinterpretL reinterpretL' reinterpretN'whichwhichN$fAFunctorWhichc:$fAFunctorWhichc[] $fNFDataWhich $fShowWhich $fOrdWhich $fEqWhich$fSemigroupWhich$fGenericWhich$fGenericWhich0$fGenericWhich1$fCaseCaseDiversify:$fReiterateCaseDiversifybranch'$fCaseCaseDiversifyN:"$fReiterateNCaseDiversifyNnbranch'$fCaseCaseReinterpret:$fReiterateCaseReinterprettree'$fCaseCaseReinterpret': $fReiterateCaseReinterpret'tree'$fCaseCaseReinterpretN':#$fReiterateNCaseReinterpretN'ntree'$fNFDataWhich0$fReduceWhichSwitcher$fReduceVoidSwitcher$fReduceWhichSwitcher0$fReduceWhichSwitcher1$fReduceWhichSwitcher2$fReduceWhichSwitcherN$fReduceWhichSwitcherN0$fSwitchN[]Whichcrnxs$fCaseCaseEqWhich:$fReiterateCaseEqWhich: $fEqWhich0$fCaseCaseOrdWhich:$fReiterateCaseOrdWhich: $fOrdWhich0$fCaseCaseShowWhich:$fReiterateCaseShowWhich: $fShowWhich0 $fReadWhich$fWhichReadWhich$fWhichReadWhich0ghc-prim GHC.TypesIntNatbase GHC.TypeNatsKnownNat integer-gmpGHC.Integer.TypeIntegerGHC.BaseFunctorGHC.NumNum WrappedAny CaseSelect CollectorAnyNCaseAny CollectorAnycaseAnyMany_#tagged-0.8.5-9esiG5iSDt67hASxvO39xh Data.TaggedTaggedcontainers-0.5.11.0Data.Sequence.Internal singletonviewlviewrGHC.Listheadtail fromList' GHC.GenericsGeneric:*:C1S1 GHC.Classescompare CaseOrdWhich CaseEqWhich Data.Voidabsurd Data.EitherLeftVoidEitherRightcoerceReadWhich WhichRead readWhich:+:GHC.ReadRead