h&TOH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferredfoldl A strict foldl A strict foldlConvert  to foldlConvert  to foldlConvert  to   Safe-Inferred Safe-Inferred  Safe-Inferredmfoldl4fromReverseListN 3 [1,2,3] :: Data.Vector.Vector Int[3,2,1] Trustworthy2foldl$A Handler for the upstream input of  3Any lens, traversal, or prism will type-check as a  foldl instance Monad m => Monoid (EndoM m a) where mempty = EndoM return mappend (EndoM f) (EndoM g) = EndoM (f <=< g) foldl&A handler for the upstream input of a 3Any lens, traversal, or prism will type-check as a  foldlLike , but monadic.A ' # m a b' processes elements of type a, and results in a monadic value of type m b.foldlFoldM   step   initial   extractfoldlEfficient representation of a left fold that preserves the fold's step function, initial accumulator, and extraction functionThis allows the  instance to assemble derived folds that traverse the container only onceA '! a b' processes elements of type a$ and results in a value of type b.foldlFold   step   initial   extractfoldlApply a strict left  to a  containerfoldlLike  , but monadicfoldlConvert a strict left  into a scanFoldl.scan Foldl.length [1..5] [0,1,2,3,4,5]foldl Convert a  into a prescan for any  type"Prescan" means that the last element of the scan is not included!Foldl.prescan Foldl.length [1..5] [0,1,2,3,4]foldl Convert a  into a postscan for any  type"Postscan" means that the first element of the scan is not included"Foldl.postscan Foldl.length [1..5] [1,2,3,4,5]foldl)Fold all values within a container using  and foldl Convert a "foldMap" to a foldl/Get the first element of a container or return  if the container is emptyfoldl.Get the last element of a container or return  if the container is emptyfoldlGet the last element of a container or return a default value if the container is emptyfoldlReturn the last N elementsfoldlReturns  if the container is empty,  otherwisefoldl"Return the length of the containerfoldlReturns  if all elements are ,  otherwisefoldlReturns  if any element is ,  otherwise foldl(all predicate) returns , if all elements satisfy the predicate,  otherwise!foldl(any predicate) returns - if any element satisfies the predicate,  otherwise"foldl Computes the sum of all elements#foldl$Computes the product of all elements$foldl g) = sink f <> sink g -- if `(<>)` is commutative sink mempty = mempty6foldlLike , except with a more general  return value7foldlLike ., except with a more general  argument8foldlFold all values into a list9foldl-Fold all values into a list, in reverse order:foldl O(n log n). Fold values into a list with duplicates removed, while preserving their first occurrences;foldlO(n^2). Fold values into a list with duplicates removed, while preserving their first occurrences<foldlFold values into a set=foldlFold values into a hash-set>foldlFold pairs into a map.?foldlGiven a  , produces a ! which applies that fold to each a separated by key k.fold (foldByKeyMap Control.Foldl.sum) [("a",1), ("b",2), ("b",20), ("a",10)]fromList [("a",11),("b",22)]@foldlFold pairs into a hash-map.AfoldlGiven a  , produces a ! which applies that fold to each a separated by key k.List.sort (HashMap.toList (fold (foldByKeyHashMap Control.Foldl.sum) [("a",1), ("b",2), ("b",20), ("a",10)]))[("a",11),("b",22)]BfoldlFold all values into a vectorCfoldlFold all values into a vectorThis is more efficient than B but is impureDfoldlUpgrade a fold to accept the  typeEfoldl.Upgrade a more traditional fold to accept the  typeFfoldl%Upgrade a monadic fold to accept the   typeGfoldl6Upgrade a more traditional monadic fold to accept the   typeHfoldl Generalize a  to a  generalize (pure r) = pure r generalize (f <*> x) = generalize f <*> generalize xIfoldlSimplify a pure   to a  simplify (pure r) = pure r simplify (f <*> x) = simplify f <*> simplify xJfoldlShift a  3 from one monad to another with a morphism such as lift or liftIO!; the effect is the same as  .KfoldlAllows to continue feeding a  4 even after passing it to a function that closes it. For pure s, this is provided by the  instance.Lfoldl _Fold1 step returns a new  using just a step function that has the same type for the accumulator and the element. The result type is the accumulator type wrapped in 0. The initial accumulator is retrieved from the , the result is None for empty containers.Mfoldl(premap f folder) returns a new  where f is applied at each step ;fold (premap f folder) list = fold folder (List.map f list)'fold (premap Sum Foldl.mconcat) [1..10]Sum {getSum = 55})fold Foldl.mconcat (List.map Sum [1..10])Sum {getSum = 55} 4premap id = id premap (f . g) = premap g . premap f premap k (pure r) = pure r premap k (f <*> x) = premap k f <*> premap k xNfoldl(premapM f folder) returns a new  - where f is applied to each input element  x) = premapM k f <*> premapM k xOfoldl(prefilter f folder) returns a new  where the folder's input is used only when the input satisfies a predicate fThis can also be done with T (handles (filtered f)) but  prefilter1 does not need you to depend on a lens library. 5) Control.Foldl.sum) [1..10]40,fold Control.Foldl.sum (filter (>5) [1..10])40Pfoldl(prefilterM f folder) returns a new   where the folder's input is used only when the input satisfies a monadic predicate f. ?foldM (prefilterM p folder) list = foldM folder (filter p list)Qfoldl Transforms a  into one which ignores elements until they stop satisfying a predicate fold (predropWhile p folder) list = fold folder (dropWhile p list)5fold (predropWhile (>5) Control.Foldl.sum) [10,9,5,9]14Rfoldl(drop n folder) returns a new  that ignores the first n< inputs but otherwise behaves the same as the original fold. fold (drop n folder) list = fold folder (Data.List.genericDrop n list)9Foldl.fold (Foldl.drop 3 Foldl.sum) [10, 20, 30, 1, 2, 3]6:Foldl.fold (Foldl.drop 10 Foldl.sum) [10, 20, 30, 1, 2, 3]0Sfoldl(dropM n folder) returns a new   that ignores the first n< inputs but otherwise behaves the same as the original fold. foldM (dropM n folder) list = foldM folder (Data.List.genericDrop n list)Foldl.foldM (Foldl.dropM 3 (Foldl.generalize Foldl.sum)) [10, 20, 30, 1, 2, 3]6Foldl.foldM (Foldl.dropM 10 (Foldl.generalize Foldl.sum)) [10, 20, 30, 1, 2, 3]0Tfoldl(handles t folder) transforms the input of a ' using a lens, traversal, or prism: handles _1 :: Fold a r -> Fold (a, b) r handles _Left :: Fold a r -> Fold (Either a b) r handles traverse :: Traversable t => Fold a r -> Fold (t a) r handles folded :: Foldable t => Fold a r -> Fold (t a) r,fold (handles traverse sum) [[1..5],[6..10]]55fold (handles (traverse.traverse) sum) [[Nothing, Just 2, Just 7],[Just 13, Nothing, Just 20]]42*fold (handles (filtered even) sum) [1..10]30fold (handles _2 Foldl.mconcat) [(1,"Hello "),(2,"World"),(3,"!")]"Hello World!" 8handles id = id handles (f . g) = handles f . handles g handles t (pure r) = pure r handles t (f <*> x) = handles t f <*> handles t xUfoldl(foldOver f folder xs) folds all values from a Lens, Traversal, Prism or Fold with the given folder/foldOver (_Just . both) Foldl.sum (Just (2, 3))5)foldOver (_Just . both) Foldl.sum Nothing0 8Foldl.foldOver f folder xs == Foldl.fold folder (xs^..f) Foldl.foldOver (folded.f) folder == Foldl.fold (handles f folder) #Foldl.foldOver folded == Foldl.foldVfoldl(handlesM t folder) transforms the input of a  ' using a lens, traversal, or prism: handlesM _1 :: FoldM m a r -> FoldM (a, b) r handlesM _Left :: FoldM m a r -> FoldM (Either a b) r handlesM traverse :: Traversable t => FoldM m a r -> FoldM m (t a) r handlesM folded :: Foldable t => FoldM m a r -> FoldM m (t a) rV obeys these laws:  x) = handlesM t f <*> handlesM t xWfoldl(foldOverM f folder xs) folds all values from a Lens, Traversal, Prism or Fold monadically with the given folder Foldl.foldOverM (folded.f) folder == Foldl.foldM (handlesM f folder) %Foldl.foldOverM folded == Foldl.foldMXfoldl folded :: Foldable t => Fold (t a) a handles folded :: Foldable t => Fold a r -> Fold (t a) rYfoldl*fold (handles (filtered even) sum) [1..10]30?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]  !"#$%&'()*+,-.1/023456789:;<=>?@ABCDEFGHIJKLMNOPQRS TU VWXYZ[\] Safe-Inferred:ufoldlApply a strict left  to lazy textvfoldlApply a strict monadic left   to lazy textwfoldl3Get the first character of a text stream or return  if the stream is emptyxfoldl2Get the last character of a text stream or return  if the text stream is emptyyfoldlReturns  if the text stream is empty,  otherwisezfoldl2Return the length of the text stream in characters{foldl(all predicate) returns . if all characters satisfy the predicate,  otherwise|foldl(any predicate) returns / if any character satisfies the predicate,  otherwise}foldlComputes the maximum character~foldlComputes the minimum characterfoldl(elem c) returns - if the text stream has a character equal to c,  otherwisefoldl (notElem c) returns 1 if the text stream has a character equal to c,  otherwisefoldl(find predicate) returns the first character that satisfies the predicate or ( if no character satisfies the predicatefoldl (index n) returns the n$th character of the text stream, or ; if the stream has an insufficient number of charactersfoldl (elemIndex c)6 returns the index of the first character that equals c , or  if no character matchesfoldl(findIndex predicate) returns the index of the first character that satisfies the predicate, or , if no character satisfies the predicatefoldl (count c) returns the number of times c appearsfoldlCombine all the strict  chunks to build a lazy  uvwxyz{|}~uvwxyz|{}~  Safe-Inferred= foldlA  is like a 7 except that it consumes at least one input elementfoldlApply a strict left  to a  listfoldl Promote any  to an equivalent foldl4Fold all values within a non-empty container using ()foldl.Get the first element of a non-empty containerfoldl-Get the last element of a non-empty containerfoldlComputes the maximum elementfoldlComputes the maximum element with respect to the given comparison functionfoldlComputes the minimum elementfoldlComputes the minimum element with respect to the given comparison function   Safe-InferredDzfoldlApply a strict left  to a lazy bytestringfoldlApply a strict monadic left   to a lazy bytestringfoldl.Get the first byte of a byte stream or return  if the stream is emptyfoldl-Get the last byte of a byte stream or return  if the byte stream is emptyfoldlReturns  if the byte stream is empty,  otherwisefoldl-Return the length of the byte stream in bytesfoldl(all predicate) returns % if all bytes satisfy the predicate,  otherwisefoldl(any predicate) returns * if any byte satisfies the predicate,  otherwisefoldlComputes the maximum bytefoldlComputes the minimum bytefoldl (elem w8) returns ( if the byte stream has a byte equal to w8,  otherwisefoldl (notElem w8) returns ( if the byte stream has a byte equal to w8,  otherwisefoldl(find predicate)< returns the first byte that satisfies the predicate or # if no byte satisfies the predicatefoldl (index n) returns the nth byte of the byte stream, or 6 if the stream has an insufficient number of bytesfoldl(elemIndex w8)1 returns the index of the first byte that equals w8 , or  if no byte matchesfoldl(findIndex predicate) returns the index of the first byte that satisfies the predicate, or # if no byte satisfies the predicatefoldlcount w8 returns the number of times w8 appearsfoldlCombine all the strict  chunks to build a lazy    Safe-InferredNfoldlLike , but monadic.A '# m a b' processes elements of type a, and results in a monadic value of type m b.foldlScanM   step   initial   extractfoldlEfficient representation of a left map-with-accumulator that preserves the scan's step function and initial accumulator.This allows the  instance to assemble derived scans that traverse the container only onceA '! a b' processes elements of type a) replacing each with a value of type b.foldlScan   step   initial foldlApply a strict left  to a  containerfoldlLike " but start scanning from the rightfoldlLike  but monadicfoldl Convert a  into a prescan"Prescan" means that the last element of the scan is not includedfoldl Convert a  into a postscan"Postscan" means that the first element of the scan is not includedfoldlUpgrade a scan to accept the  typefoldl.Upgrade a more traditional scan to accept the  typefoldl%Upgrade a monadic scan to accept the  typefoldl6Upgrade a more traditional monadic scan to accept the  typefoldl Generalize a  to a  generalize (pure r) = pure r generalize (f <*> x) = generalize f <*> generalize xfoldlSimplify a pure  to a  simplify (pure r) = pure r simplify (f <*> x) = simplify f <*> simplify xfoldlShift a 3 from one monad to another with a morphism such as  or liftIO!; the effect is the same as  .foldl(premap f scaner) returns a new  where f is applied at each step 6scan (premap f scaner) list = scan scaner (map f list) 4premap id = id premap (f . g) = premap g . premap f premap k (pure r) = pure r premap k (f <*> x) = premap k f <*> premap k xfoldl(premapM f scaner) returns a new - where f is applied to each input element  x) = premapM k f <*> premapM k xfoldlThis is same as normal function composition, except slightly more efficient. The same trick is used in base  http://hackage.haskell.org/package/base-4.11.1.0/docs/src/Data.Functor.Utils.html#%23. and lens http://hackage.haskell.org/package/lens-4.17/docs/Control-Lens-Internal-Coerce.html#v:-35-..9    !""#$%%&&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~'(./2367=?ABCDEF./=>?@'(./2367=?ABCDEF)*+Z[\]^_`cd             #foldl-1.4.13-Jb2CvEJLdJ5BuW4IsIjZGa Control.FoldlControl.Foldl.ByteStringControl.Foldl.TextControl.Foldl.NonEmpty Control.ScanlControl.Foldl.InternalControl.Foldl.OpticsControl.Foldl.Util.MVectorControl.Foldl.Util.VectorControl.Monad.Morphhoistbase Data.FoldableFoldableghc-primGHC.Prim RealWorldGHC.WordWord8bytestring-0.11.3.1Data.ByteString.Internal ByteString'primitive-0.7.4.0-5Mou7sRsTgfjuEOfjOZOzControl.Monad.Primitive PrimMonad text-1.2.5.0Data.Text.InternalText&vector-0.13.0.0-7U8pFThXyYFEKl1vrDAyiEData.Vector.Generic.BaseMutableVectorHandlerMEndoMappEndoMHandlerFoldMFoldfoldfoldMscanprescanpostscanmconcatfoldMapheadlastlastDeflastNnulllengthandorallanysumproductmeanvariancestdmaximum maximumByminimum minimumByelemnotElemfindindex elemIndex findIndexlookuprandomrandomNmapM_sink genericLength genericIndexlistrevListnubeqNubsethashSetmap foldByKeyMaphashMapfoldByKeyHashMapvectorvectorMpurelypurely_impurely impurely_ generalizesimplifyhoists duplicateM_Fold1premappremapM prefilter prefilterM predropWhiledropdropMhandlesfoldOverhandlesM foldOverMfoldedfilteredgroupByeithereitherMnest$fFloatingFold$fFractionalFold $fNumFold $fMonoidFold$fSemigroupoidTYPEFold$fSemigroupFold $fExtendFold$fApplicativeFold $fComonadFold $fChoiceFold$fProfunctorFold $fFunctorFold$fFloatingFoldM$fFractionalFoldM $fNumFoldM $fMonoidFoldM$fSemigroupFoldM$fProfunctorFoldM $fExtendFoldM$fApplicativeFoldM$fFunctorFoldM $fMonoidEndoM$fSemigroupEndoMcountlazyFold1fold1fromFoldsconcat$fFloatingFold1$fFractionalFold1 $fNumFold1 $fMonoidFold1$fSemigroupFold1$fApplicativeFold1$fProfunctorFold1$fFunctorFold1ScanMScanscanrscanMarrM$fFloatingScan$fFractionalScan $fNumScan $fMonoidScan$fSemigroupScan $fArrowScan$fCategoryTYPEScan$fProfunctorScan$fApplicativeScan $fFunctorScan$fFloatingScanM$fFractionalScanM $fNumScanM $fMonoidScanM$fSemigroupScanM $fArrowScanM$fCategoryTYPEScanM$fProfunctorScanM$fApplicativeScanM$fFunctorScanM$fApplicativeReverseState$fFunctorReverseStateEither' Data.EitherEitherMaybe' GHC.MaybeMaybestricthushPairLeft'Right'Just'Nothing'Prism'Prismprism_Left_Right#writeListInReverseOrderStartingFromfromReverseListN initializedGHC.Base ApplicativeData.Traversable TraversablemappendmemptyNothing GHC.TypesTrueFalseGHC.NumNumGHC.RealIntegralcontainers-0.6.5.1Data.Map.InternalMap4unordered-containers-0.2.19.1-3MGG7b01IYxFpF6Tpk5LG1Data.HashMap.InternalHashMap$comonad-5.0.8-DcIGwJ56Veo5wx2LipBnJtControl.ComonadComonadNonEmpty<>transformers-0.5.6.2Control.Monad.Trans.Classlift#.