h*tf8      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                     1.0  Safe-Inferred/0 t_variant"Bottom-up traversal (catamorphism)`variant6Bottom-up traversal with original value (paramorphism)avariantPerform a top-down traversalRight: stop the traversal ("right" value obtained) Left: continue the traversal recursively on the new value^_]`\a  !"#$%&'()*+,-./0123456789:;<=>?@[ZYXWVUTSRQPONMKLIJGHDEFABCbcdefghijk^_]`\a  !"#$%&'()*+,-./0123456789:;<=>?@[ZYXWVUTSRQPONMKLIJGHDEFABCbcdefghijk Safe-Inferred /01ulvariantBuild a list of constraints e.g., ConstraintAll1 Eq '[A,B,C] ==> (Eq A, Eq B, Eq C)mvariantTail of a listnvariant*Remove a type at index (0 == don't remove)ovariantRemove a type at indexpvariantComplement xs ysqvariant replace types at offsets ns in lrvariantreplace a type at offset n in lvariantGet the first index of a typesvariantGet all the indexes of a typetvariantreplace l[n] with l2 (folded)uvariantInsert a list at nvariant(Constraint: all the xs are members of ysvvariantConstraint: x member of xsvariantHelper for MaybeIndexOfwvariant m (V [a,b,c]) f = joinVariant @mvariantxs is liftable in ysvariantxs is liftable in ysvariantUseful to specify a "Type -> Constraint" function returning an empty constraintvariantA value of type "x" **might** be extracted from (V xs). We don't check that "x" is in "xs".variantForall x in xs , `x :< ys`variant0A value of type "x" can be extracted from (V xs)variantRemove a type from a variantvariant&Put a value into a variant if possible.toVariantMaybe "Test" :: Maybe (V [Int,Float])Nothing5toVariantMaybe "Test" :: Maybe (V [Int,Float,String]) Just "Test"variantPut a value into a Variant, when the Variant's row contains that type.variantA variant contains a value whose type is at the given position in the type listvariant*Statically unchecked matching on a Variantvariant"Silent pattern synonym for VariantUsage: case v of VSilent (x :: Int) -> ... VSilent (x :: String) -> ...variantPattern synonym for VariantUsage: case v of V (x :: Int) -> ... V (x :: String) -> ...variant'Haskell code corresponding to a Variant:showsVariant 0 (V @Double 5.0 :: V [Int,String,Double]) ""+"V @Double 5.0 :: V '[Int, [Char], Double]"variantShow a list of ShowSvariantGet Variant index)let x = V "Test" :: V [Int,String,Double]variantIndex x12let y = toVariantAt @0 10 :: V [Int,String,Double]variantIndex y0variantGet variant size*let x = V "Test" :: V '[Int,String,Double] variantSize x36let y = toVariantAt @0 10 :: V [Int,String,Double,Int] variantSize y4variant)Set the value with the given indexed type(toVariantAt @1 10 :: V [Word,Int,Double]10variantSet the first value&toVariantHead 10 :: V [Int,Float,Word]10variant Set the tail)let x = V @Int 10 :: V [Int,String,Float]let y = toVariantTail @Double x:t y#y :: V [Double, Int, String, Float]variant.Try to get a value by index into the type list(let x = V "Test" :: V [Int,String,Float]fromVariantAt @0 xNothingfromVariantAt @1 x Just "Test"fromVariantAt @2 xNothingvariant"Try to get the first variant value(let x = V "Test" :: V [Int,String,Float]fromVariantHead xNothing)let y = V @Int 10 :: V [Int,String,Float]fromVariantHead yJust 10variantPop a variant value by index, return either the value or the remaining variant(let x = V @Word 10 :: V [Int,Word,Float]popVariantAt @0 xLeft 10popVariantAt @1 xRight 10popVariantAt @2 xLeft 10variantPop the head of a variant value(let x = V @Word 10 :: V [Int,Word,Float]popVariantHead xLeft 10'let y = V @Int 10 :: V [Int,Word,Float]popVariantHead yRight 10variant&Update a single variant value by indeximport Data.Char (toUpper)0let x = V @String "Test" :: V [Int,String,Float] mapVariantAt @1 (fmap toUpper) x"TEST"mapVariantAt @0 (+1) x"Test"variant5Applicative update of a single variant value by index Example with :>=) for a VariantvariantConst bind (>>) for a VariantvariantList-like catamorphismlet f = variantHeadTail (\i -> "Found Int: " ++ show i) (const "Something else"),f (V @String "Test" :: V [Int,String,Float])"Something else"%f (V @Int 10 :: V [Int,String,Float])"Found Int: 10"variantBimap Variant head and tail ?let f = mapVariantHeadTail (+5) (appendVariant @'[Double,Char])#f (V @Int 10 :: V [Int,Word,Float])15$f (V @Word 20 :: V [Int,Word,Float])20variantPut a value into a Variant"Use the first matching type index.variant#Put a value into a Variant (silent)"Use the first matching type index.variantSplit a variant in twovariantExtract a type from a variant. Return either the value of this type or the remaining variantvariantExtract a type from a variant. Return either the value of this type or the remaining variantvariant)Pick the first matching type of a Variant0let x = toVariantAt @2 10 :: V '[Int,String,Int]fromVariantFirst @Int xNothingvariant3Try to a get a value of a given type from a VariantEquivalent to pattern ./let x = toVariantAt @2 10 :: V [Int,String,Int]fromVariant @Int xJust 10 fromVariant @Double x<... error: Double not found in list: [Int, String, Int] ...variant OrdNum a instance (Ord a, Num a) => OrdNum a alterVariant @OrdNum foo vvariantTraverse a variant. You need to specify the constraints required by the modifying function.variantTraverse a variant. You need to specify the constraints required by the modifying function.variantReduce a variant to a single value by using a class function. You need to specify the constraints required by the modifying function.'let v = V "Yes" :: V [String,Bool,Char]reduceVariant @Show show v "\"Yes\""-let n = V (10 :: Int) :: V [Int,Word,Integer]-reduceVariant @Integral fromIntegral n :: Int10variant3Extend a variant by appending other possible valuesvariant4Extend a variant by prepending other possible valuesvariantLift a variant into another%Set values to the first matching typevariantNub the type listvariantProduct of two variantsvariantFlatten variants in a variantvariant#Join on a variant in an unsafe way.-Works with IO for example but not with Maybe.variantRetrieve a single valuevariant$Create a variant from a single valuevariant+Convert a variant of two values in a Eithervariant Safe-Inferred(/16HfvariantVariant biased towards one typevariant Right value)VRight True :: VEither '[String,Int] Bool VRight Truevariant Left valueVLeft (V "failed" :: V '[String,Int]) :: VEither '[String,Int] BoolVLeft "failed"variant Convert a Variant into a VEither*let x = V "Test" :: V '[Int,String,Double]veitherFromVariant x VLeft "Test"variant Convert a VEither into a Variant0let x = VRight True :: VEither '[Int,Float] BoolveitherToVariant xTruevariant Convert a VEither into an Either0let x = VRight True :: VEither '[Int,Float] BoolveitherToEither x Right Truevariant)Extract from a VEither without left types'let x = VRight True :: VEither '[] BoolveitherToValue xTruevariantBimap for VEither0let x = VRight True :: VEither '[Int,Float] BoolveitherBimap id not x VRight FalsevariantLift a VEither into anothervariantPrepend errors to VEithervariantAppend errors to VEithervariantVEither continuationsvariantProduct of two VEithervariantFoldable instance for VEither5let x = VRight True :: VEither '[Int,Float] Boollet y = VLeft (V "failed" :: V '[String,Int]) :: VEither '[String,Int] Bool forM_ x printTrue forM_ y printvariantMonad instance for VEither5let x = VRight True :: VEither '[Int,Float] Bool5let f v = VRight (not v) :: VEither '[Int,Float] Boolx >>= f VRight Falsevariant Applicative instance for VEither1let x = VRight True :: VEither '[Int,Float] Bool1let y = VRight False :: VEither '[Int,Float] Bool(&&) <$> x <*> y VRight False(||) <$> x <*> y VRight TruevariantFunctor instance for VEither0let x = VRight True :: VEither '[Int,Float] Bool1fmap (\b -> if b then "Success" else "Failure") xVRight "Success"variantCompare VEithers4let a = VRight "Foo" :: VEither '[Int,Double] String4let b = VRight "Bar" :: VEither '[Int,Double] Stringa < bFalsea > bTruevariantCheck VEithers for equality4let a = VRight "Foo" :: VEither '[Int,Double] String4let b = VRight "Foo" :: VEither '[Int,Double] String4let c = VRight "Bar" :: VEither '[Int,Double] Stringlet d = VLeft (V (1::Int) :: V '[Int, Double]) :: VEither '[Int,Double] Stringa == bTruea == cFalsea == dFalsev{ Safe-Inferred-16PvariantRun an Exceptsvariant(Run an Excepts, discard the result valuevariant)Convert a flow without error into a valuevariantLift a Excepts into anothervariantAppend errors to an ExceptsvariantPrepend errors to an ExceptsvariantSignal an exception value e.variantThrow some exceptionvariantSignal an exception value e.variantSignal a successvariantHandle an exception. Lift both normal and exceptional flows into the result flowvariantHandle an exception. Lift both normal and exceptional flows into the result flowvariant7Handle an exception. Assume it is in the first positionvariantHandle an exception. Lift the remaining errors into the resulting flowvariant=Handle an exception. Lift the handler into the resulting flowvariantDo something in case of errorvariantEvaluate a Excepts. Use the provided function to handle error cases.variantCatch and die in case of errorvariantDo something in case of errorvariantDo something in case of errorvariantFinally for Exceptsvariant Convert a Variant into a Exceptsvariant Convert a VEither into a Exceptsvariant'Product of the execution of two Excepts0You can use a generic monad combinator such as 3 (in "async" package) to get concurrent execution. %> concurrentE = runBothE concurrentlyvariant2Product of the sequential execution of two Excepts3The second one is run even if the first one failed!variant'Catches exceptions from the base monad.variant&Throws exceptions into the base monad.v{  Safe-Inferred/016Y&variantxs is liftable in ysvariant=Apply its first argument to every element of the 2nd arg list (ApplyAll e '[f,g,h] ==> '[f e, g e, h e]variantRecursive Functor-like VariantvariantPattern-match in a VariantF>FV (NilF :: NilF String) :: VariantF '[ConsF Char,NilF] StringNilFvariantRetrieve a single valuevariantSet the first valuevariant Set the tailvariantPop VariantF headvariant Pop VariantFvariant#Map the matching types of a variantvariantLift a VariantF into anothervariantSplit a VariantF in twovariant,Convert a VariantF into a multi-continuationvariant,Convert a VariantF into a multi-continuationvariant,Convert a multi-continuation into a VariantFvariant,Convert a multi-continuation into a VariantFvariantShow instance for VariantFlet a = FV (ConsF 'a' "Test") :: VariantF '[ConsF Char,NilF] Stringlet b = FV (NilF :: NilF String) :: VariantF '[ConsF Char,NilF] Stringprint aConsF 'a' "Test"print bNilFvariantOrd instance for VariantFlet a = FV (ConsF 'a' "Test") :: VariantF '[ConsF Char,NilF] Stringlet a' = FV (ConsF 'a' "XXX") :: VariantF '[ConsF Char,NilF] Stringlet b = FV (ConsF 'b' "Test") :: VariantF '[ConsF Char,NilF] String compare a aEQ compare a a'LT compare a bLTvariantEq instance for VariantFlet a = FV (ConsF 'a' "Test") :: VariantF '[ConsF Char,NilF] Stringlet a' = FV (ConsF 'a' "XXX") :: VariantF '[ConsF Char,NilF] Stringlet b = FV (ConsF 'b' "Test") :: VariantF '[ConsF Char,NilF] Stringa == aTruea == a'Falsea == bFalselet c = FV (ConsF 'c' b) :: VariantF '[ConsF Char,NilF] (VariantF '[ConsF Char, NilF] String)c == cTrue?let n1 = FV (NilF :: NilF ()) :: VariantF '[ConsF Char,NilF] ()?let n2 = FV (NilF :: NilF ()) :: VariantF '[ConsF Char,NilF] ()n1 == n2True'   Safe-Inferred(/01Z]variant)An EADT with an additional type parametervariant#Pattern-match in an extensible GADT    Safe-Inferred/16] variantForall x in xs , `x :<: ys`variant Constructor f is in xsvariantAn extensible ADTvariant"Pattern-match in an extensible ADTvariant%Append new "constructors" to the EADTvariantLift an EADT into anothervariantPop an EADT valuevariant)Convert a multi-continuation into an EADTvariant)Convert a multi-continuation into an EADTvariant Show an EADTvariantMultiCont instancelet f x = toCont x >::> (const "[]", \(ConsF u us) -> u ++ ":" ++ f us)f a"Hello:World:[]" ^]\[ZYXWVUTSRQPONMKLIJGHDEFABC !"#$%&'()*+,-./0123456789:;<=>?@_`abcdefghijk   Safe-Inferredf$variant0Create a pattern synonym for an EADT constructorE.g. data ConsF a e = ConsF a e deriving (Functor) $(eadtPattern 'ConsF "Cons") ====> pattern Cons :: ConsF a :<: xs => a -> EADT xs -> EADT xs pattern Cons a l = VF (ConsF a l)variant7Create an infix pattern synonym for an EADT constructorE.g. data ConsF a e = ConsF a e deriving (Functor) $(eadtInfixPattern 'ConsF ":->") ====> pattern (:->) :: ConsF a :<: xs => a -> EADT xs -> EADT xs pattern a :-> l = VF (ConsF a l)variantCreate a pattern synonym for an EADT constructor that is part of a specified EADT.This can be useful to help the type inference because instead of using a generic "EADT xs" type, the pattern uses the provided type.E.g. data ConsF a e = ConsF a e deriving (Functor) data NilF e = NilF deriving (Functor) type List a = EADT '[ConsF a, NilF] $(eadtPatternT 'ConsF "ConsList" [t|forall a. List a|]) ====> pattern ConsList :: ( List a ~ EADT xs , ConsF a :<: xs ) => a -> List a -> List a pattern ConsList a l = VF (ConsF a l)>Note that you have to quantify free variables explicitly with forallvariantLike ( but generating an infix pattern synonymvariant0Create a pattern synonym for an EADT constructorvariant Actual constructor (e.g., ConsF)variant Name of the pattern (e.g., Cons)variant Actual constructor (e.g., ConsF)variant Name of the pattern (e.g., Cons)variant Actual constructor (e.g., ConsF)variant Name of the pattern (e.g., Cons)variant.Type of the EADT (e.g., [t|forall a. List a|])variant Actual constructor (e.g., ConsF)variant Name of the pattern (e.g., Cons)variant.Type of the EADT (e.g., [t|forall a. List a|])variant Actual constructor (e.g., ConsF)variant Name of the pattern (e.g., Cons)variant EADT typevariantDeclare infix pattern !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                      "variant-1.0-HUcrfQ7hWB4GTplzsiz4NzData.Variant.TypesData.Variant.TupleData.Variant.FunctorData.Variant.ContFlow Data.VariantData.Variant.SyntaxData.Variant.VEitherData.Variant.ExceptsData.Variant.VariantFData.Variant.EGADTData.Variant.EADTData.Variant.EADT.THvariantControl.Concurrent.Async concurrentlyghc-prim GHC.Types ConstraintGHC.Tuple.PrimSoloMkSolo GHC.Tuple.recursion-schemes-5.2.3-6eBF5NqJTcy4NueHzl55qPData.Functor.Foldable Corecursiveembedanaapopostprogpostpro RecursiveprojectcataparagparapreprogpreproBasedistPara distParaThylofoldunfoldrefoldgcatagfolddistCataganagunfolddistAnaghylogrefoldfutugfutudistFutu distGFutuhoistrefixzygodistZygogzygo distZygoTgapodistApodistGApo distGApoThistoghisto distHisto distGHistochronogchronomcatamparamzygomhistomanamapomfutuelgotcoelgotzygoHistoPreprocataA transverse cotransverse HCorecursivehembedhana HRecursivehprojecthcata HTraversable htraverse HFoldablehfoldMapHFunctorhfmap HGCoalgebraM HGCoalgebra HCoalgebraM HCoalgebra HGAlgebraM HGAlgebra HAlgebraMHAlgebraHBaseNatM~> RCoAlgebraRAlgebra CoAlgebraAlgebra TopDownStopT BottomUpOrigT BottomUpTbottomUp bottomUpOrig topDownStophhylohcataMhlambekhparahparaMhanaM hcolambekhapohapoMhhyloMConstraintAll1Tail RemoveAt1RemoveAt Complement ReplaceNSReplaceN IndexesOf ReplaceAtInsertAtMember MaybeIndexOfIndexOfReverseNubRemoveProductLengthConcatIndexnatValue natValue'Tuple#TypeRepsTupleTupleContupleCon ReorderTuple tupleReorder TupleCons tupleCons TupleTail tupleTail ExtractTupletupleNuncurry3uncurry4uncurry5uncurry6uncurry7take4 fromTuple4 tupleHead$fTupleTail(,,,,,)(,,,,)$fTupleTail(,,,,)(,,,)$fTupleTail(,,,)(,,)$fTupleTail(,,)(,)$fTupleTail(,)Solo$fTupleConsa(,,,,)(,,,,,)$fTupleConsa(,,,)(,,,,)$fTupleConsa(,,)(,,,)$fTupleConsa(,)(,,)$fTupleConsaSolo(,)$fReorderTuple(,,,,,,)(,,,,,,)$fReorderTuple(,,,,,,)(,,,,,,)0$fReorderTuple(,,,,,,)(,,,,,,)1$fReorderTuple(,,,,,,)(,,,,,,)2$fReorderTuple(,,,,,,)(,,,,,,)3$fReorderTuple(,,,,,,)(,,,,,,)4$fReorderTuple(,,,,,,)(,,,,,,)5$fReorderTuple(,,,,,)(,,,,,)$fReorderTuple(,,,,,)(,,,,,)0$fReorderTuple(,,,,,)(,,,,,)1$fReorderTuple(,,,,,)(,,,,,)2$fReorderTuple(,,,,,)(,,,,,)3$fReorderTuple(,,,,,)(,,,,,)4$fReorderTuple(,,,,)(,,,,)$fReorderTuple(,,,,)(,,,,)0$fReorderTuple(,,,,)(,,,,)1$fReorderTuple(,,,,)(,,,,)2$fReorderTuple(,,,,)(,,,,)3$fReorderTuple(,,,)(,,,)$fReorderTuple(,,,)(,,,)0$fReorderTuple(,,,)(,,,)1$fReorderTuple(,,,)(,,,)2$fReorderTuple(,,)(,,)$fReorderTuple(,,)(,,)0$fReorderTuple(,,)(,,)1$fReorderTuple(,,)(,,)2$fReorderTuple(,,)(,,)3$fReorderTuple(,)(,)$$fReorderTuple(,,,,,,,,,)(,,,,,,,,,)"$fReorderTuple(,,,,,,,,)(,,,,,,,,) $fReorderTuple(,,,,,,,)(,,,,,,,)$fReorderTuple(,,,,,,)(,,,,,,)6$fReorderTuple(,,,,,)(,,,,,)5$fReorderTuple(,,,,)(,,,,)4$fReorderTuple(,,,)(,,,)3$fReorderTuple(,,)(,,)4$fReorderTuple(,)(,)0$fReorderTupleSoloSolo $fTupleCon: $fTupleCon:0 $fTupleCon:1 $fTupleCon:2 $fTupleCon:3 $fTupleCon:4 $fTupleCon[]$fExtractTuple7:$fExtractTuple6:$fExtractTuple5:$fExtractTuple4:$fExtractTuple3:$fExtractTuple2:$fExtractTuple1:$fExtractTuple0:$fExtractTuple6:0$fExtractTuple5:0$fExtractTuple4:0$fExtractTuple3:0$fExtractTuple2:0$fExtractTuple1:0$fExtractTuple0:0$fExtractTuple5:1$fExtractTuple4:1$fExtractTuple3:1$fExtractTuple2:1$fExtractTuple1:1$fExtractTuple0:1$fExtractTuple4:2$fExtractTuple3:2$fExtractTuple2:2$fExtractTuple1:2$fExtractTuple0:2$fExtractTuple3:3$fExtractTuple2:3$fExtractTuple1:3$fExtractTuple0:3$fExtractTuple2:4$fExtractTuple1:4$fExtractTuple0:4$fExtractTuple1:5$fExtractTuple0:5$fExtractTuple0:6 MultiContMultiContTypestoConttoContM ToMultiCont ContTupleContFlow>:>>-:>>%:>>::>>:-:>>:%:> ContVariant variantToContvariantToContM contToVariantcontToVariantM JoinVariant joinVariantExtractM FlattenableFlattenVariant LiftVariant' liftVariant' LiftVariant ReduceVariantTraverseVariant AlterVariant NoConstraint ReplaceAll MapVariant:>=>>return VEitherLiftVEitherVRightVLeftveitherFromVariantveitherToVariantveitherToEitherveitherToValue veitherBimap veitherLiftveitherPrepend veitherAppend veitherContveitherProduct$fTraversableVEither$fFoldableVEither$fMonadVEither$fApplicativeVEither$fFunctorVEither $fShowVEither $fOrdVEither $fEqVEitherExceptsrunErunE_ injectExcepts withExcepts_ withExceptsevalE mapExceptsliftEappendEprependEthrowE throwSomeEfailureEsuccessEcatchE catchLiftBoth catchRemove catchLiftLeftcatchLiftRight catchAllE catchEvalE catchDieEonE_onEfinallyEvariantToExceptsveitherToExceptsrunBothE sequenceE$fMonadUnliftIOExcepts$fMonadReaderrExcepts$fMonadMaskExcepts$fMonadCatchExcepts$fMonadThrowExcepts$fMonadIOExcepts$fMonadTransExcepts$fMonadFailExcepts$fMonadExcepts$fApplicativeExcepts$fTraversableExcepts$fFoldableExcepts$fFunctorExcepts $fShowExcepts TopDownStop toTopDownStop TopDownStopF BottomUpOrigtoBottomUpOrig BottomUpOrigFBottomUp toBottomUp BottomUpF SplitVariantF LiftVariantF MapVariantF PopVariantFApplyAllVariantFFVvariantFToValueappendVariantFprependVariantFtoVariantFHeadtoVariantFTailpopVariantFHead popVariantF mapVariantF liftVariantF splitVariantFvariantFToContvariantFToContMcontToVariantFcontToVariantFM$fMultiContVariantF$fFunctorVariantF$fFunctorVariantF0$fShowVariantF$fShow1VariantF$fShow1VariantF0$fOrd1VariantF$fOrd1VariantF0 $fEq1VariantF$fEq1VariantF0 $fOrdVariantF $fEqVariantF $fBottomUptc:$fBottomUptc[]$fBottomUpOrigc:$fBottomUpOrigc[]$fTopDownStopc:$fTopDownStopc[]$fNFDataVariantF:<<&>$>void eadtPattern'