úÎH~F¼     Clinton Mead, 2017BSD3clintonmead@gmail.com experimentalGHCSafe+,DR! on polykinded type level tuples..Note this currently is only defined on tuples.None*+,9;<=DQRThe version of 0 for homogenous tuples (i.e. all the same type).|GHC does not allow you to partially apply type families (or any type declaration for that matter). So if you have a type of * -> Constraint you can't pass TupleConstraint 2 , because . is partially applied and this is not allowed.$But you can partially apply classes.So  is basically the same as - except that it's a class, not a type family. simply further constrains ' so that all the elements are the same.So HomoTupleConstraint 3 t basically says  t ~ (u,u,u) for some u,G("Homo" is short for "Homogeneous". As in, all the same. Or like milk.)Type level version of None*,DR Much like   and  ,  IsData m t asserts that t is a data constructor with n variables.  !IndexC i n (f a_0 a_1 .. a_(n-1))Jthe ith (zero based) parameter of the constructor with n parameters, i.e. a_i !    ! Clinton Mead, 2017MITclintonmead@gmail.com experimentalGHCSafe,DR  ) is the core type family of this module.  IndexT n a' gets the type of the "nth" element of a. In this module,  7 is defined on tuples and functions, and is zero based.So IndexT 0 (a, b, c) == aand IndexT 0 (a -> b -> c) == aNote the following: 3IndexT 1 (a -> b -> c) == b IndexT 2 (a, b, c) == cbut... :IndexT 2 (a -> b -> c) /= c -- (it's actually not defined)VThis is because the way functions are defined. Consider a function of three arguments: f :: a -> b -> c -> dFor this function, we want:  IndexT 2 (a -> b -> c -> d) == cBut if we defined   like the following: IndexT 2 (a -> b -> c) = cThen we would find that: HIndexT 2 (a -> b -> c -> d) == IndexT 2 (a -> b -> (c -> d)) == (c -> d)%Which is not right. For this reason,  @ can not get the "result" type of functions, you'll need to use ResultT for that.    None *,9;<=DR A classed based constraint for . Like  , but for functions.Like  , but for functions.Like L, but only constrains all the arguments to be the same type, not the result.Like  J, but for functions, where all arguments and the result type are the same.Like , but for functions.Like  , but for functions.4 is used to get the result type of functions, which  8 can not be used for as discussed in it's documentation. ResultT n t gets the result of t treated as an n argument function. For example: ResultT 2 (a -> b -> c) == c note that: &ResultT 2 (a -> b -> c -> d) == c -> dOwhich makes sense, as the result of applying two arguments to this function is (c -> d).   None *,9;<=DRThe version of 0 for homogenous tuples (i.e. all the same type).|GHC does not allow you to partially apply type families (or any type declaration for that matter). So if you have a type of * -> Constraint you can't pass TupleConstraint 2 , because . is partially applied and this is not allowed.$But you can partially apply classes.So  is basically the same as - except that it's a class, not a type family. simply further constrains ' so that all the elements are the same.So HomoTupleConstraint 3 t basically says  t ~ (u,u,u) for some u,G("Homo" is short for "Homogeneous". As in, all the same. Or like milk.);To best explain this, lets consider the particular example TupleConstraint 2.As %TupleN 2 t = (IndexT 0 t, IndexT 1 t) we get: 2TupleConstraint 2 t = t ~ (IndexT 0 t, IndexT 1 t)&What does this say? Well, firstly, as t ~ (IndexT 0 t, IndexT 1 t), it must be a pair at least.>What are the elements of the pair? Well, the first element of t is  IndexT 0 t. And what's  IndexT 0 t" defined as? The first element of t.%So we know that the first element of t is well, the first element of t.Which tells us nothing at all.?We can go through the same argument with the second element of t."So all we know after this is that t is a pair. TupleConstraint 2 t is the same as saying t is a pair.So TupleConstraint n t basically says t is a n-tuple.^ seems a bit weird, but it's an important part of defining constraints that allow one to say "t is a pair" in ."        !"#$(indextype-0.2.2.0-1YzDfc94w489yIXeM9XZA6Control.IndexT.TypeLevelControl.IndexT.TypeLevel.TupleControl.IndexT.ConstructorControl.IndexTControl.IndexT.FunctionControl.IndexT.TupleIndexTTupleConstraintIsTuple IsFunction IsHomoTupleHomoTupleConstraintTupleN$fIsHomoTuplena $fIsTupleknaIsDataGetConstructor2GetConstructor1IndexC IsHomoArgFunc IsHomoFuncIsFuncHomoArgFuncConstraintHomoFuncConstraintFuncConstraintFuncNResultT$fIsHomoArgFuncna$fIsHomoFuncna $fIsFuncna $fIsTuplenaIsData2Data2IsData1Data1