h$NJ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred$foldl A strict foldl A strict foldlConvert  to foldlConvert  to foldlConvert  to   Safe-InferredeNoneNonefoldl4fromReverseListN 3 [1,2,3] :: Data.Vector.Vector Int[3,2,1] Trustworthy?1foldl$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 scanL.scan L.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 includedL.prescan L.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 includedL.postscan L.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 L.mconcat) [1..10]Sum {getSum = 55}%fold L.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)-L.fold (L.drop 3 L.sum) [10, 20, 30, 1, 2, 3]6.L.fold (L.drop 10 L.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)>L.foldM (L.dropM 3 (L.generalize L.sum)) [10, 20, 30, 1, 2, 3]6?L.foldM (L.dropM 10 (L.generalize L.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]30>fold (handles _2 L.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) L.sum (Just (2, 3))5%foldOver (_Just . both) L.sum Nothing0 0L.foldOver f folder xs == L.fold folder (xs^..f) 9L.foldOver (folded.f) folder == L.fold (handles f folder) L.foldOver folded == L.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  Fold (t a) a handles folded :: Foldable t => Fold a r -> Fold (t a) rYfoldl*fold (handles (filtered even) sum) [1..10]308foldM (handlesM (filtered even) (L.mapM_ print)) [1..10]246810Zfoldl Perform a  while grouping the data according to a specified group projection function. Returns the folded result grouped as a map keyed by the group.[foldl=Combine two folds into a fold over inputs for either of them.\foldlCombine two monadic folds into a fold over inputs for either of them.]foldlNest a fold in an applicative.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]  !"#$%&'()*+,-.1/023456789:;<=>?@ABCDEFGHIJKLMNOPQRS TU VWXYZ[\] Safe-Inferred9ufoldlApply 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|{}~ None@foldlApply 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   None?IfoldlLike , 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 x9     !!"#$$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&'-.1256<>@ABCDE&'-.1256<>@ABCDE()*YZ[\]^_bc         #foldl-1.4.12-B2is5IkBgQE2vfQ7SKcBj6 Control.FoldlControl.Foldl.ByteStringControl.Foldl.Text Control.ScanlControl.Foldl.InternalControl.Foldl.OpticsControl.Foldl.Util.MVectorControl.Foldl.Util.VectorControl.Monad.Morphhoistbase Data.FoldableFoldableghc-primGHC.Prim RealWorldGHC.WordWord8bytestring-0.10.10.0Data.ByteString.Internal ByteString'primitive-0.7.1.0-Jxsyd70oUttYiCXCa0HqVControl.Monad.Primitive PrimMonad text-1.2.3.2Data.Text.InternalText&vector-0.12.3.0-Iq8W8y7X87B1xSQfAcXis3Data.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$fSemigroupEndoMcountlazyScanMScanscanrscanMarrM$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.2.1Data.Map.InternalMap4unordered-containers-0.2.14.0-7xegloYXKrQFs2wz1wk2kBData.HashMap.InternalHashMap$comonad-5.0.8-EA0Scey7jOW6LX5RvNTIb8Control.ComonadComonadtransformers-0.5.6.2Control.Monad.Trans.Classlift#.