úÎ&ƒ$è     ;Composition of functors with a type index tracking nesting. Copyright (c) 2014 Kenneth Fonerkenneth.foner@gmail.com experimental non-portable Safe-Inferred!"&'*246=HJKM*This type family calculates the type of a Nested value if one more Nest constructor is applied to it.<This type family calculates the result type of applying the Nestedn constructors to its first argument a number of times equal to the depth of nesting in its second argument.%Given some nested structure which is not wrapped in NestedI constructors, and one which is, wrap the first in the same number of Nested3 constructors so that they are equivalently nested. G[['a']] `asNestedAs` Nest (Flat (Just (Just 0))) == Nest (Flat [['a']])The UnNest: type family describes what happens when you peel off one Nested constructor from a Nested value.A  Nested fs a3 is the composition of all the layers mentioned in fs, applied to an a. Specifically, the fsG parameter is a sort of snoc-list holding type constructors of kind (* -> *)5. The outermost layer appears as the parameter to FlatI; the innermost layer appears as the rightmost argument to the outermost Nest. For instance: ÿ [Just ['a']] :: [Maybe [Char]] Flat [Just ['a']] :: Nested (Flat []) (Maybe [Char]) Nest (Flat [Just ['a']]) :: Nested (Nest (Flat []) Maybe) [Char] Nest (Nest (Flat [Just ['a']])) :: Nested (Nest (Nest (Flat []) Maybe) []) CharNest o i4 is the type index used for the recursive case of a  value: the o= parameter is the type constructors corresponding to the outside levels, and the iB parameter is the single type constructor corresponding to the  inner-most level. Thus, a #(Nested (Nest (Flat Maybe) []) Int) is isomorphic to a  (Maybe [Int]). Flat x/ is the type index used for the base case of a  value. Thus, a (Nested (Flat []) Int is isomorphic to a [Int].  Removes one Nested constructor (either Nest or Flat ) from a Nested value. 'unNest . Nest == id unNest . Flat == id QunNest (Nest (Flat [['x']])) == Flat [['x']] unNest (Flat (Just 'x')) == Just 'x'              NestedFunctor-0.2.0.2Data.Functor.NestedAddNest AsNestedAsNestedAs asNestedAsUnNestNestedNestFlatunNest$fNestedAsfNested$fNestedAsfNested0$fDistributiveNested$fDistributiveNested0$fAlternativeNested$fAlternativeNested0$fTraversableNested$fTraversableNested0$fFoldableNested$fFoldableNested0$fComonadNested$fComonadNested0$fComonadApplyNested$fComonadApplyNested0$fApplicativeNested$fApplicativeNested0$fFunctorNested$fFunctorNested0 $fShowNested $fShowNested0