h&7.)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                       Safe-Inferred  non-emptyThe default implementation causes quadratic runtime on nested index tuple types. This affects the  function, too. non-emptyA custom implementation of this function allows for an even more efficient implementation of ! on nested NonEmpty constructors. non-emptyWe need to distinguish between  and , since there is an instance Sort Set but there cannot be an instance SortBy Set. non-emptyCreate a container with as many copies as possible of a given value. That is, for a container with fixed size n, the call repeat x will generate a container with n copies of x. non-empty It must hold: fmap f xs = zipWith (\x _ -> f x) xs xs = zipWith (\_ x -> f x) xs xs4 non-emptyDefault implementation for  based on .6  !"#$%&'()*+,-./0123456+,)*'(-%&#$". !/012345 5*5 Safe-Inferred +uvwuvw Safe-Inferred W  Safe-Inferred  non-empty It holds: )foldMap f . Mapped g = foldMap f . fmap g but use of  avoids  constraint. Safe-Inferred  non-empty#Make a list as long as another one  non-emptyCheck whether two lists with different element types have equal length. It is equivalent to length xs == length ys but more efficient. non-emptyCompare the length of two lists over different types. It is equivalent to !(compare (length xs) (length ys)) but more efficient. non-empty the same as ($>)  Safe-Inferred non-emptyInsert an element into an ordered list while preserving the order. non-empty The type  can be used for many kinds of list-like structures with restrictions on the size. T [] a0 is a lazy list containing at least one element. T (T []) a1 is a lazy list containing at least two elements. T Vector a is a vector with at least one element. You may also use unboxed vectors but the first element will be stored in a box and you will not be able to use many functions from this module. T Maybe a- is a list that contains one or two elements.Maybe is isomorphic to Optional Empty. T Empty a- is a list that contains exactly one element. T (T Empty) a. is a list that contains exactly two elements.Optional (T Empty) a. is a list that contains zero or two elements.You can create a list type for every finite set of allowed list length by nesting Optional and NonEmpty constructors. If list length n is allowed, then place Optional at depth n#, if it is disallowed then place NonEmpty$. The maximum length is marked by Empty. non-empty#Force immediate generation of Cons. non-emptyImplementation of  without the + constraint that is needed for . non-emptyImplementation of  without the + constraint that is needed for . non-empty Synonym for . For symmetry to . non-emptyFor  faster than . non-empty It holds: !foldl1Map f g = foldl1 f . fmap gbut  does not need a  instance. non-empty)Fold a non-empty list in a balanced way. Balanced means that each element has approximately the same depth in the operator tree. Approximately the same depth means that the difference between maximum and minimum depth is at most 1. The accumulation operation must be associative and commutative in order to get the same result as  or foldr1. non-emptymaximum is a total function non-emptyminimum is a total function non-emptymaximumBy is a total function non-emptyminimumBy is a total function non-emptymaximumKey is a total function non-emptyminimumKey is a total function non-emptymaximumKey is a total function non-emptyminimumKey is a total function non-empty+sum does not need a zero for initialization non-empty.product does not need a one for initialization non-emptygeneric variants:  or better Semigroup.cycle non-emptyDefault implementation for  based on . non-emptyOnly advised for structures with efficient appending of single elements like Sequence!. Alternatively you may consider . non-empty\xs -> mapMaybe EitherHT.maybeLeft (NonEmpty.flatten xs) == either NonEmpty.flatten fst (NonEmpty.partitionEithersLeft (xs::NonEmpty.T[](Either Char Int)))\xs -> mapMaybe EitherHT.maybeRight (NonEmpty.flatten xs) == either (const []) (NonEmpty.flatten . snd) (NonEmpty.partitionEithersLeft (xs::NonEmpty.T[](Either Char Int)))\xs -> NonEmpty.partitionEithersRight (fmap EitherHT.swap xs) == EitherHT.mapLeft swap (EitherHT.swap (NonEmpty.partitionEithersLeft (xs::NonEmpty.T[](Either Char Int)))) non-empty\xs -> NonEmpty.partitionEithersLeft (fmap EitherHT.swap xs) == EitherHT.mapRight swap (EitherHT.swap (NonEmpty.partitionEithersRight (xs::NonEmpty.T[](Either Char Int)))) non-emptyforRange $ \b0 -> forRange $ \b1 -> forRange $ \b2 -> let b = FuncHT.unzip $ b0!:b1!:b2!:Empty.Cons in map (Ix.index b) (Ix.range b) == take (Ix.rangeSize b) [0..] non-empty Caution: $viewL (NonEmpty.Cons x []) = Nothing8 because the tail is empty, and thus cannot be NonEmpty!=This instance mainly exist to allow cascaded applications of . non-emptyIf you nest too many non-empty lists then the efficient merge-sort (linear-logarithmic runtime) will degenerate to an inefficient insert-sort (quadratic runtime).5555 Safe-Inferred55 Safe-Inferred! non-emptyWe cannot have a reasonable instance Insert Set , since the instance Insert (NonEmpty Set)4 would preserve duplicate leading elements, whereas  does not. However, the instance Insert NonEmpty( is not the problem. A general type like :insertSet :: (Insert f, Ord a) => a -> f a -> NonEmpty f a,cannot work, since it can be instantiated to insertSet :: (Ord a) => a -> NonEmpty Set a -> NonEmpty (NonEmpty Set) aand this is obviously wrong: insertSet x (singleton x) has only one element, not two. Safe-Inferred#d non-empty#Select tuples of list elements: choose "abc" == [a!:b!:empty,a!:c!:empty,b!:c!:empty] non-empty8This implementation is more efficient for Sequence than . Safe-Inferred+8  non-empty\k a -> forAllMap $ \m -> Map.insert k a m == NonEmptyMap.flatten (NonEmptyMap.insert k a m) non-empty\k a -> forAllMap $ \m -> Map.insertWith (++) k a m == NonEmptyMap.flatten (NonEmptyMap.insertWith (++) k a m) non-empty\k -> forAllNonEmptyMap $ \m -> Map.delete k (NonEmptyMap.flatten m) == NonEmptyMap.delete k m non-empty\xs -> Map.fromList (NonEmpty.flatten xs) == NonEmptyMap.flatten (NonEmptyMap.fromList (xs::NonEmpty.T [] (Int,Char))) non-empty\xs -> Map.fromListWith (++) (NonEmpty.flatten xs) == NonEmptyMap.flatten (NonEmptyMap.fromListWith (++) (xs::NonEmpty.T [] (Int,String))) non-emptyforAllNonEmptyMap $ \m -> NonEmptyMap.fromAscList (NonEmptyMap.toAscList m) == m non-emptyforAllNonEmptyMap $ \m -> NonEmpty.flatten (NonEmptyMap.toAscList m) == Map.toAscList (NonEmptyMap.flatten m) non-emptyforAllNonEmptyMap $ \xs -> forAllNonEmptyMap $ \ys -> Map.union (NonEmptyMap.flatten xs) (NonEmptyMap.flatten ys) == NonEmptyMap.flatten (NonEmptyMap.union xs ys) non-emptyforAllMap $ \xm -> forAllNonEmptyMap $ \ym -> Map.union xm (NonEmptyMap.flatten ym) == NonEmptyMap.flatten (NonEmptyMap.unionLeft xm ym) non-emptyforAllNonEmptyMap $ \xm -> forAllMap $ \ym -> Map.union (NonEmptyMap.flatten xm) ym == NonEmptyMap.flatten (NonEmptyMap.unionRight xm ym) non-emptyforAllNonEmptyMap $ \xs -> forAllNonEmptyMap $ \ys -> Map.unionWith (++) (NonEmptyMap.flatten xs) (NonEmptyMap.flatten ys) == NonEmptyMap.flatten (NonEmptyMap.unionWith (++) xs ys) non-emptyforAllMap $ \xm -> forAllNonEmptyMap $ \ym -> Map.unionWith (++) xm (NonEmptyMap.flatten ym) == NonEmptyMap.flatten (NonEmptyMap.unionLeftWith (++) xm ym) non-emptyforAllNonEmptyMap $ \xm -> forAllMap $ \ym -> Map.unionWith (++) (NonEmptyMap.flatten xm) ym == NonEmptyMap.flatten (NonEmptyMap.unionRightWith (++) xm ym)  Safe-Inferred+22 Safe-Inferred,  Safe-Inferred,5  Safe-Inferred. non-emptyWrap a container such that its Applicative instance is based on zip. non-emptyAlways returns a rectangular list by clipping all dimensions to the shortest slice. Be aware that transpose [] == repeat []. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~@@      @          A ? 8 = ;                  6    4 (          8;08                                                     @                           @                    >    # $               &non-empty-0.3.4-IXeJ2dAV0D1Jq3EJT1osD6Data.NonEmpty.Class Data.Empty Data.AppendData.NonEmpty.Match Data.NonEmptyData.NonEmpty.SetData.NonEmpty.MixedData.NonEmpty.MapData.FixedLengthList Data.OptionalData.ZipData.NonEmpty.FoldableData.NonEmptyPrivate Applicative<*>pureMonad>>=returnData.Monoid.HTcycleData.NonEmptyTestIxrangeindexinRange rangeSizerangeSizeIndex indexHornerNFDatarnfGengenOf Arbitrary arbitraryshrinkShow showsPrecReversereverseSortKeysortKeySortBysortBySortsortIterateiterateRepeatrepeatZipzipWithAppendappend Singleton singletonViewViewRviewRViewLviewLSnocsnocConsconsEmptyempty snocDefault viewRDefaultzipWith3zipWith4zipzip3zip4 sortDefault sortKeyGen $fEmptySeq $fEmptyMap $fEmptySet $fEmptyMaybe $fEmpty[] $fConsSeq$fCons[] $fSnocSeq$fSnoc[] $fViewLSeq $fViewLSet $fViewLMaybe $fViewL[] $fViewRSeq $fViewRSet $fViewRMaybe $fViewR[] $fViewSeq $fViewSet $fViewMaybe$fView[]$fSingletonSeq$fSingletonSet$fSingletonMaybe $fSingleton[] $fAppendSeq $fAppend[]$fZipSeq $fZipMaybe$fZip[] $fRepeatMaybe $fRepeat[]$fIterateMaybe $fIterate[] $fSortSet $fSortSeq $fSortMaybe$fSort[] $fSortBySeq $fSortByMaybe $fSortBy[] $fSortKeySeq$fSortKeyMaybe $fSortKey[] $fReverseSeq$fReverseMaybe $fReverse[] $fShowSet $fShowSeq $fShowMaybe$fShow[]$fArbitraryMap$fArbitraryMaybe$fArbitrarySeq $fArbitrary[]$fGenMap $fGenMaybe$fGenSeq$fGen[] $fNFDataMap $fNFDataSet $fNFData[] $fNFDataMaybeTswitch$fIxT$fIxT0 $fNFDataT $fNFDataT0 $fIterateT $fRepeatT $fSortByT$fSortT $fReverseT$fZipT$fEmptyT$fGenT $fArbitraryT $fArbitraryT0$fViewT$fViewRT$fViewLT$fTraversableT $fFoldableT $fFunctorT$fShowT$fShowT0$fEqT$fOrdTfstsndtake replicateInsertByinsertByInsertinsertheadtail!:forceapplybindtoListflattenfetchmapHeadmapTailinitlastfoldl1 foldl1Map foldBalancedfoldBalancedStrictmaximumminimum maximumBy minimumBy maximumKey minimumKeysumproductchop appendRight appendLeft insertDefault removeEachtailsinitsinitsRevscanlscanr mapAdjacentpartitionEithersLeftpartitionEithersRightmembersizefindMinfindMaxdelete deleteMin deleteMax deleteFindMin deleteFindMaxminViewmaxViewfromList fromAscList toAscListunion unionLeft unionRightChoosechoosegroupBy groupPairsgroupKey groupEithers segmentAfter segmentBeforefilterToInfixessplitAt sliceVertical $fChoose[] $fChooseT $fChooseT0 insertWithelemskeyskeysSetlookupminViewWithKeymaxViewWithKey fromListWith unionWith unionLeftWithunionRightWithmap mapWithKeyFunc9Func8Func7Func6Func5Func4Func3Func2Func1Func0T9T8T7T6T5T4T3T2T1T0uncurry0uncurry1uncurry2uncurry3uncurry4uncurry5uncurry6uncurry7uncurry8uncurry9curry0curry1curry2curry3curry4curry5curry6curry7curry8curry9consAll0consAll1consAll2consAll3consAll4consAll5consAll6consAll7consAll8consAll9Nil fromEmpty fromNonEmpty?: $fInsertByT $fInsertT$fConsTdecons transposeClip$fApplicativeTMappedbaseGHC.BaseFunctor _equalLength_compareLength snocGenericcontainers-0.6.5.1Data.Sequence.InternalSeq _maximumKey _minimumKeyTransposeInner zipHeadTailtransposeStartTransposeOuter transposesnocFastAuxsnocAltswitchL uncurriercurrierfoldBalancedGen attachKeyinsertByTraversable mapWithIndexremoveAt takeUntil takeUntilAlttransposePrelude propTransposepropTransposePrelude mapAdjacent1Data.Set.InternalSetfilterToInfixesAlt