y~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesSafe'>KLSafeCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ The empty .   Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(357>IKLNUZ Each instance of  D provides a canonical construction of a type at a particular index..Useful for working with singleton-esque GADTs.     Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*134579>IKLNUZ "$A general eliminator for entailment.Given a term of type t with an instance  Witness p q t and a term of type r that depends on  q#, we can reduce the Constraint to p.If p is C, i.e. the empty  (), then a Witness t) can completely discharge the Constraint q.%Reified evidence of  entailment.Given a term of p :- q, the Constraint q holds if p holds.Entailment of  s form a : id :: p :- p((.) :: (q :- r) -> (p :-> q) -> (p :- r)* A reified .- Convert a " to a canonical reified .. Convert a "# to a canonical reified entailment.7Constraint chaining under Maybe.AIf the constraint c> holds, there is a canonical construction for a term of type * c, viz. the constructor Wit.BA type equality a  b is a Witness that (a ~ b).CAn entailment p :- q is a Witness of q, given p.< !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI@ !"#$%&'()*+,-./0123456789:;<=>?<*+()%&'I"#$,-. !/HGF0123456EDCBA@789:;<=>?, !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI  $%,78<=Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ;A type-level pair is a Monoid over its pairwise components.JKLMNOPQRSTUVWXJKLMNOPQRSTUVWXRQSPTOUNVMWLXKJJKLMNOPQRSTUVWXJKLRCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ^Map over a type-level Maybe.aTake a Maybe Constraint to a  Constraint.YZ[\]^_`abcdefghijYZ[\]^_`abcdefghija`_bcd^e]f\g[hZYijYZ[\]^_`abcdefghij[\]^Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZrMap a list of (fs :: [k -> l]) over a single (a :: k), giving a list  (bs :: [l]).sMap an  (f :: k -> l) over a type-level list  (as :: [k]), giving a list  (bs :: [l]).tTakes a type-level list of s to a single , where ListC cs holds iff all elements of cs hold.|Type-level list snoc.~Appends two type-level lists.Type-level singleton list.#klmnopqrstuvwxyz{|}~!klmnopqrstuvwxyz{|}~!~}|{zyxwvutsrqponmlk#klmnopqrstuvwxyz{|}~qrs|~ Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ/Convenient aliases for low-value Peano numbers."!!  Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZMap over a type-level Maybe.Take a Maybe Constraint to a  Constraint.Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(35>IKLNUZAn eliminator for a  type.Consider this function akin to a Monadic bind, except instead of binding into a Monad with a sequent function, we're binding into the existential quantification with a universal eliminator function.|It serves as an explicit delimiter in a program of where the type index may be used and depended on, and where it may not.hNB: the result type of the eliminating function may not refer to the universally quantified type index a.""" Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(13579>IKLNUZATake a natural transformation to a lifted natural transformation.F      !"#$%&'()F      !"#$%&'()F      !"#$%&'()       !"#$%&'()     Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ$*+,-./0123456789:;<=>?@ABCDEFGHIJKLM*+,-./0123456789$,-MLK./0123JIHGFED*+CBA4567@?>=<89;:"*+,-./0123456789:;<=>?@ABCDEFGHIJKLM*+,-0Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*357>IKLNUZQEliminator for N f.W(We can take a natural transformation of (forall x. f x -> g x)! to a natural transformation of  (forall mx. N f mx -> N g mx). NOPQRSTUVWNOPQ NOPQWVUTSRNOPQRSTUVWCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*357>IKLNUZ XYZ[\]^_`aXYZ XYa`_^]\[Z XYZ[\]^_`aCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*-./1357>IKLNUZEbcdefghijklmnopqrstuvwxyz{|}~#bcdefghijklmnopqrstuvwxyz{|}~Ez{|wxytuv}qrs~nopklmhijefgbcd3bcdefghijklmnopqrstuvwxyz{|}~Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*357>IKLNUZCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ A proof that : is also a right identity for the addition of type-level s.A Nat n is a "- that there is a canonical construction for Nat n.If n is a canonical construction of Nat n,  n" is the canonical construction of  Nat (S n).$ is the canonical construction of a  Z.Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3457>IKLNUZ8Gives the list of all members of the finite set of size n.There are no members of Fin Z.CMap a finite set to a lower finite set without one of its members.Take a  to an existentially quantified .A Fin n is a " that n >= 1. That is,  n is well defined.  None!"'(*3457>IKLNU  Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3457>IKLNUZAn IFin x y is a " that x >= 1. That is,  x is well defined.                Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ   Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(357>IKLNUZ$~Construct a two element FProd. Since the precedence of (:>>) is higher than (:<<), we can conveniently write lists like: a :<< b :>> cWhich is identical to:a :<< b :<< c :<< %Build a singleton FProd.&9snoc function. insert an element at the end of the FProd.)2Get all but the last element of a non-empty FProd.**Get the last element of a non-empty FProd.+!Reverse the elements of an FProd.,Append two FProds.-'Map over the head of a non-empty FProd..'Map over the tail of a non-empty FProd.2EMap over all elements of an FProd with access to the element's index.3FFold over all elements of an FProd with access to the element's index.4JTraverse over all elements of an FProd with access to the element's index.5GA non-empty FProd is a Witness if both its head and tail are Witnesses.6"An empty FProd is a no-op Witness.9If all f in fs are  Traversables, then FProd fs is a  Traversable.:If all f in fs are Foldables, then FProd fs is a Foldable.;If all f in fs are Functors, then FProd fs is a Functor.!"#$%&'()*+,-./0123456789:;!"#$%&'()*+,-./01234!"#$%&'()*+,-./01;:92348765!"#$%&'()*+,-./0123456789:;#$&Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(35>IKLNUZ ?)There are no possible values of the type FSum a.@<Decompose a non-empty FSum into either its head or its tail.AInject an element into an FSum.B)Project an implicit index out of an FSum.CEInject an element into an FSum with an explicitly specified Index.D)Project an explicit index out of an FSum.EMap over the single element in an FSum with a function that can handle any possible element, along with the element's index.FNFun fact: Since there is exactly one element in an FSum, we don't need the Monoid instance!GVAnother fun fact: Since there is exactly one element in an FSum, we require only a Functor instance on g, rather than  Applicative.<=>?@ABCDEFGHIJ <=>?@ABCDEFG<=>?@ABCDJIHEFG <=>?@ABCDEFGHIJCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ KLMNOPQRSTUVKLMNOP KLMVUTSRQNOP KLMNOPQRSTUVCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3457>IKLNUZ WA Prod of simple Haskell types.[{Construct a two element Prod. Since the precedence of (:>) is higher than (:<), we can conveniently write lists like: a :< b :> cWhich is identical to:a :< b :< c :< \Cons onto a Tuple.]Build a singleton Prod.^8snoc function. insert an element at the end of the list.a1Get all but the last element of a non-empty Prod.b)Get the last element of a non-empty Prod.iSingleton Tuple.jSnoc onto a Tuple.*WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~WXYZ[\]^_`abcdefghijklmnopq*XYZ~}|[]^_`abcdefghWi\jklmnopq{zyxwvutsr(WXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Z[\^jCopyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*13457>IKLNUZ9195Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*357>IKLNUZ)There are no possible values of the type Sum f . Copyright (C) 2015 Kyle CarterBSD3"Kyle Carter <kylcarte@indiana.edu> experimental RankNTypesNone!"&'(*3579>IKLNUZ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKKLLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|klm}~klm                         | k l m                                                         ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : : ; ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [\]^_`abcdeffghijklmnoopqqrsstuuvwwxyyz{{|}}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~`aqq""""""#"""#"#"#"#"#"#"#"#"#"#   typec_1ruBHm0givd0aW99WMZnUyType.Family.ConstraintType.Family.BoolType.Family.MonoidType.Class.KnownType.Class.WitnessType.Family.TupleType.Family.EitherType.Family.ListType.Family.NatType.Family.MaybeData.Type.QuantifierType.Class.HigherData.Type.ConjunctionData.Type.Option Data.Type.SymData.Type.CombinatorData.Type.Disjunction Data.Type.Nat Data.Type.FinData.Type.Nat.InequalityData.Type.Fin.IndexedData.Type.IndexData.Type.Product.LiftedData.Type.Sum.LiftedData.Type.LengthData.Type.ProductData.Type.Vector Data.Type.SumData.Type.BooleanType.Family.Symbolghc-primGHC.Prim ConstraintbaseData.Type.Equality==<>MemptyIffIffCFailØC $fIffFalsetf $fIffTruetfKnownKnownCknown $fKnownk:~:b DecEqualitydecideEqualityDecProvenRefuted TestEquality1 testEquality1HoldsForallforall∨disjC∧conjC∘compCConstconstCFailsfailCWitnessWitnessC\\:-SubgetSubWit1Wit// witnessedentailedabsurdCeitherCpureCcontraCcommutefalsotopbottom//?//?+witMaybeqed impossible=?==??=decCaseabsurd $fKnownkWit1a$fKnownConstraintWitc$fWitness()~:~: $fWitnesspq:-$fWitness()cWit1$fWitness()cWit $f∧kfga $f∘kkfga $fConstkcd$fCategoryConstraint:-<*><&><$>Thd3Snd3Fst3SndFst#fstCongsndCongfst3Congsnd3Congthd3Cong pairMapCong FromRightFromLeft<|>IsRightIsLeftEitherCleftCong rightCong leftNotRighteitherFmapCongeitherPamfCong eitherApCong eitherAltCong fromLeftCong fromRightCongThds3Snds3Fsts3ZipSndsFstsListCLast'LastInit'InitTailHeadReverse>:Concat++NullOnly:<ØnullCong nilNotCons appendCong concatCongsnocCong reverseConginitConglastCong listMapCongN10N9N8N7N6N5N4N3N2N1N0IxLen^*+PredIotaNatEqIsZeroNZSfromIntzeroCongzNotSiotaCongpredCongaddCongmulCongexpConglenCongixCongFromJust IsNothingMaybeC nothingCongnothingNotJust maybeFmapCong maybePamfCong maybeApCong maybeAltCong fromJustCong^^<==>==>Not&&||BoolCEvery3 instEvery3Every2 instEvery2Every instEverySomeCSome3Some2Somesome>>->->withSomeonSomesome2>>-->--> withSome2onSome2some3>>--->---> withSome3onSome3someC>>~ IxBifunctor1ibimap1 Bifunctor1bimap1IxTraversable1 itraverse1 Traversable1 traverse1 IxFoldable1 ifoldMap1 Foldable1foldMap1 IxFunctor1imap1Functor1map1Read3 readsPrec3Read2 readsPrec2Read1 readsPrec1Show3 showsPrec3show3Show2 showsPrec2show2Show1 showsPrec1show1Ord3compare3<###>###<=###>=###Ord2compare2<##>##<=##>=##Ord1compare1<#>#<=#>=#Eq3eq3neq3Eq2eq2neq2Eq1eq1neq1=#==##==###=shows1shows2shows3reads1 readMaybe1reads2 readMaybe2reads3 readMaybe3:*::&:fanFstfanSnd.&.fanFirst uncurryFancurryFanparFstparSnd uncurryParcurryPar_fst_snd$fWitness(,)(,):*:$fDecEquality(,):*:$fBifunctor1kk(,):*:$fTraversable1k(,):*:$fFoldable1k(,):*:$fFunctor1k(,):*:$fKnown(,):*:p $fShow1(,):*: $fOrd1(,):*: $fEq1(,):*:$fWitness(,)(,):&:$fBifunctor1kkk:&:$fTraversable1kk:&:$fFoldable1kk:&:$fFunctor1kk:&: $fKnownk:&:a$fDecEqualityk:&: $fShow1k:&: $fOrd1k:&: $fEq1k:&:OptionNothing_Just_option$fWitnesspqOption$fKnownMaybeOptionJust$fKnownMaybeOptionNothing$fTraversable1kMaybeOption$fFoldable1kMaybeOption$fFunctor1kMaybeOptionSymsymbol$fWitness()KnownSymbolSym$fKnownSymbolSymx$fTestEqualitySymbolSym$fShow1SymbolSym$fOrd1SymbolSym$fEq1SymbolSym $fShowSymJoingetJoinUncur3 getUncur3Cur3getCur3UncurgetUncurCurgetCurFlipgetFlipCgetCIgetI:.:CompgetCompmapCflipTestEquality1mapFlipmapCurmapUncurmapCur3 mapUncur3mapJoin$fWitnesspqJoin $fKnownkJoina $fShow1kJoin $fOrd1kJoin $fEq1kJoin$fWitnessrsUncur3$fKnown(,,)Uncur3q$fRead1(,,)Uncur3$fWitnessqrCur3 $fKnownkCur3c$fWitnessrsUncur$fKnown(,)Uncurq$fRead1(,)Uncur$fWitnessqrCur $fKnownkCurb $fKnownkFlipa$fWitnesspqFlip$fTestEqualitykFlip$fNumC $fWitnesspqC $fRead1kC $fShow1kC$fOrd1kC$fEq1kC$fNumI $fWitnesspqI$fMonadI$fApplicativeI$fTestEquality1(->)k:.:$fTestEqualityk:.:$fWitnesspq:.: $fShow1k:.: $fOrd1k:.: $fEq1k:.::+:L'R':|:LR>|<>+<$fWitnesspq:+:$fWitnesspq:+:0$fBifunctor1kkEither:+:$fTraversable1kEither:+:$fFoldable1kEither:+:$fFunctor1kEither:+:$fKnownEither:+:Right$fKnownEither:+:Left$fRead1Either:+:$fShow1Either:+:$fOrd1Either:+:$fEq1Either:+:$fWitnesspq:|:$fBifunctor1kkk:|:$fTraversable1kk:|:$fFoldable1kk:|:$fFunctor1kk:|: $fRead1k:|: $fShow1k:|: $fOrd1k:|: $fEq1k:|:NatZ_S_pred' onNatPred_Z_S_s_ZneSaddZaddS.+.*.^elimNatnatVal$fTestEqualityNNat$fWitness()KnownNat $fKnownNNatS $fKnownNNatZ $fRead1NNat $fShow1NNat $fOrd1NNat $fEq1NNatFinFZFSelimFinfinsfinfinZweakenwithoutfinNat$fWitness()~Fin $fRead1NFin $fShow1NFin $fOrd1NFin $fEq1NFinNatGTGTZGTSNatEQEQZEQSNatLTLTZLTS>< natCompare$fWitness()(,,,,)NatGT$fWitness()(,,,,)NatEQ$fWitness()(,,,,)NatLTLessEqLTCliftIFinIFinIFZIFSifinZifinNatifinVal onIFinPred$fWitness()~IFin $fLessEqSy $fLessEqZy $fRead2NNIFin $fShow2NNIFin $fOrd2NNIFin $fEq2NNIFin $fShow1NIFin $fOrd1NIFin $fEq1NIFinElem elemIndex∈IndexIZIS elimIndexixNilonIxPred$fKnownkIndexa$fKnownkIndexa0 $fElemk:a $fElemk:a0$fTestEqualitykIndex$fRead2[]kIndex $fShow1kIndex $fOrd1kIndex $fEq1kIndexFProdØF:<<:>>onlyF>>:headFtailFinitFlastFreverseFappendFonHeadFonTailFuncurryFcurryFindexFimapF ifoldMapF itraverseF$fWitness(,)(,)FProd$fWitness()()FProd$fKnownkFProda$fKnownkFProda0$fTraversableFProd$fFoldableFProd$fFunctorFProdFSumFInLFInRnilFSumfdecompfinjfprj injectFSumfindeximapFSum ifoldMapFSum itraverseFSum$fTraversableFSum$fFoldableFSum $fFunctorFSumLengthLZLS elimLengthlOddlEven$fKnown[]Length:$fKnown[]Length[]$fRead1[]Length$fShow1[]Length$fOrd1[]Length $fEq1[]LengthTupleProd:>::<onlyhead'tail'init'last'reverse'append'lookup' lookupParpermutepermute'only_>::elimProdonHead'onTail'uncurry'curry'indexselect$fWitness(,)(,)Prod$fWitness()()Prod$fKnown[]Prod:$fKnown[]Prod[]$fIxTraversable1[]kIndexProd$fTraversable1k[]Prod$fIxFoldable1[]kIndexProd$fFoldable1k[]Prod$fIxFunctor1[]kIndexProd$fFunctor1k[]Prod$fTestEquality[]Prod $fRead1[]Prod $fShow1[]Prod $fOrd1[]Prod $fEq1[]ProdMatrixM getMatrixVVTØV:*:+elimVTelimV.++vreponTailvDelimapifoldMap itraversevmapvapvfoldr vfoldMap'vfoldMapwithVTwithVfindVfindVTvgen_vgenmgen_mgenonMatrixdiagonal vtranspose transposem0m1m2m3m4ppVecppMatrix ppMatrix'mzipWithzipLinescompose$fNumM$fNumVT$fWitness()KnownVT$fTraversableVT $fFoldableVT $fMonadVT$fApplicativeVT $fFunctorVTSumInLInRnilSumdecomp injectSuminjprjelimSum$fWitnesspqSum$fWitnesspqSum0$fIxTraversable1[]kIndexSum$fTraversable1k[]Sum$fIxFoldable1[]kIndexSum$fFoldable1k[]Sum$fIxFunctor1[]kIndexSum$fFunctor1k[]Sum $fRead1[]Sum $fShow1[]Sum $fOrd1[]Sum $fEq1[]SumBoolEq.==BooleanFalse_True_not'.||.&&.^^$fKnownBoolBooleanFalse$fKnownBoolBooleanTrue$fBoolEqBoolBoolean$fRead1BoolBoolean$fShow1BoolBoolean$fOrd1BoolBoolean$fEq1BoolBoolean GHC.TypeLits KnownSymbolSymbol sameSymbol symbolValControl.CategoryCategory:~: Data.VoidvacuousVoidouterinnerapply gcastWithcastWithtranssymRefl testEquality TestEqualityTFCo:R:Mempty(,)TFCo:R:<>(,,)(,,)(,,)TFCo:R:Mempty(,,)TFCo:R:<>(,)(,)(,)TFCo:R:<>EitherabTFCo:R:MemptyEither TFCo:R:<>[]abTFCo:R:Mempty[] TFCo:R:==NxyTFCo:R:<>MaybeabTFCo:R:MemptyMaybe