úÎ!ô虸      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·Safe A¸foldl A strict ¹ºfoldl A strict »¼foldlConvert º to »½foldlConvert » to º¾foldlConvert ¸ to » ¿À¸ÁºÃļ½¾ Trustworthy<CQV“1Lfoldl$A Handler for the upstream input of  3Any lens, traversal, or prism will type-check as a  foldl xinstance 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 ÅM 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 Convert a  into a prescan for any Æ typeA"Prescan" means that the last element of the scan is not includedfoldl Convert a  into a postscan for any Æ typeC"Postscan" means that the first element of the scan is not includedfoldl)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 emptyfoldl[Get 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<Compute a numerically stable arithmetic mean of all elements%foldlDCompute a numerically stable (population) variance over all elements&foldlRCompute a numerically stable (population) standard deviation over all elements'foldlComputes the maximum element(foldlNComputes the maximum element with respect to the given comparison function)foldlComputes the minimum element*foldlNComputes the minimum element with respect to the given comparison function+foldl(elem a) returns Ê* if the container has an element equal to a, Ë otherwise,foldl (notElem a) returns Ë* if the container has an element equal to a, Ê otherwise-foldl(find predicate)? returns the first element that satisfies the predicate or É& if no element satisfies the predicate.foldl (index n) returns the n th element of the container, or É< if the container has an insufficient number of elements/foldl (elemIndex a)4 returns the index of the first element that equals a , or É if no element matches0foldl(findIndex predicate)M returns the index of the first element that satisfies the predicate, or É& if no element satisfies the predicate1foldl (lookup a)A returns the element paired with the first matching item, or É if none matches2foldl/Pick a random element, using reservoir sampling3foldl6Pick several random elements, using reservoir sampling4foldlAConverts an effectful function to a fold. Specialized version of 5.5foldl(Converts an effectful function to a fold Qsink (f <> 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.?foldlFold pairs into a hash-map.@foldlFold all values into a vectorAfoldlFold all values into a vectorThis is more efficient than @ but is impureBfoldlUpgrade a fold to accept the  typeCfoldl.Upgrade a more traditional fold to accept the  typeDfoldl%Upgrade a monadic fold to accept the   typeEfoldl6Upgrade a more traditional monadic fold to accept the   typeFfoldl Generalize a  to a  Rgeneralize (pure r) = pure r generalize (f <*> x) = generalize f <*> generalize xGfoldlSimplify a pure   to a  Jsimplify (pure r) = pure r simplify (f <*> x) = simplify f <*> simplify xHfoldlShift a  3 from one monad to another with a morphism such as lift or liftIO!; the effect is the same as .IfoldlAllows to continue feeding a  4 even after passing it to a function that closes it. For pure s, this is provided by the Î instance.Jfoldl _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.Kfoldl(premap f folder) returns a new  where f is applied at each step 6fold (premap f folder) list = fold folder (map f list)!fold (premap Sum mconcat) [1..10]Sum {getSum = 55}fold mconcat (map Sum [1..10])Sum {getSum = 55} 4premap id = id premap (f . g) = premap g . premap f Jpremap k (pure r) = pure r premap k (f <*> x) = premap k f <*> premap k xLfoldl(premapM f folder) returns a new  - where f is applied to each input element <premapM return = id premapM (f <=< g) = premap g . premap f NpremapM k (pure r) = pure r premapM k (f <*> x) = premapM k f <*> premapM k xMfoldl(prefilter f folder) returns a new O where the folder's input is used only when the input satisfies a predicate fThis can also be done with O (handles (filtered f)) but  prefilter1 does not need you to depend on a lens library. <fold (prefilter p folder) list = fold folder (filter p list)/fold (prefilter (>5) Control.Foldl.sum) [1..10]40,fold Control.Foldl.sum (filter (>5) [1..10])40Nfoldl(prefilterM f folder) returns a new X 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)Ofoldl(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]]55^fold (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 mconcat) [(1,"Hello "),(2,"World"),(3,"!")]"Hello World!" 8handles id = id handles (f . g) = handles f . handles g Nhandles t (pure r) = pure r handles t (f <*> x) = handles t f <*> handles t xPfoldl(foldOver f folder xs)M 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.foldQfoldl(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) rQ obeys these laws: <handlesM id = id handlesM (f . g) = handlesM f . handlesM g RhandlesM t (pure r) = pure r handlesM t (f <*> x) = handlesM t f <*> handlesM t xRfoldl(foldOverM f folder xs)Y folds all values from a Lens, Traversal, Prism or Fold monadically with the given folder <L.foldOverM (folded.f) folder == L.foldM (handlesM f folder) L.foldOverM folded == L.foldMSfoldl ^folded :: Foldable t => Fold (t a) a handles folded :: Foldable t => Fold a r -> Fold (t a) rTfoldl*fold (handles (filtered even) sum) [1..10]306foldM (handlesM (filtered even) (mapM_ print)) [1..10]246810Ufoldl 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.S  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUS  !"#$%&'()*+,-.1/023456789:;<=>?@ABCDEFGHIJKLMN OP QRSTUNone¬7kfoldlApply a strict left  to a lazy bytestringlfoldlApply a strict monadic left   to a lazy bytestringmfoldl.Get the first byte of a byte stream or return É if the stream is emptynfoldl-Get the last byte of a byte stream or return É if the byte stream is emptyofoldlReturns Ê if the byte stream is empty, Ë otherwisepfoldl-Return the length of the byte stream in bytesqfoldl(all predicate) returns Ê% if all bytes satisfy the predicate, Ë otherwiserfoldl(any predicate) returns Ê* if any byte satisfies the predicate, Ë otherwisesfoldlComputes the maximum bytetfoldlComputes the minimum byteufoldl (elem w8) returns Ê( if the byte stream has a byte equal to w8, Ë otherwisevfoldl (notElem w8) returns Ë( if the byte stream has a byte equal to w8, Ê otherwisewfoldl(find predicate)< returns the first byte that satisfies the predicate or É# if no byte satisfies the predicatexfoldl (index n) returns the nth byte of the byte stream, or É6 if the stream has an insufficient number of bytesyfoldl(elemIndex w8)1 returns the index of the first byte that equals w8 , or É if no byte matcheszfoldl(findIndex predicate)J returns the index of the first byte that satisfies the predicate, or É# if no byte satisfies the predicate{foldlcount w8 returns the number of times w8 appears|foldlCombine all the strict  chunks to build a lazy  klmnopqrstuvwxyz{|klmnoprqstuvwxyz{| SafeÄi}foldlApply a strict left  to lazy text~foldlApply a strict monadic left   to lazy textfoldl3Get the first character of a text stream or return É if the stream is empty€foldl2Get the last character of a text stream or return É if the text stream is emptyfoldlReturns Ê if the text stream is empty, Ë otherwise‚foldl2Return 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 character‡foldl(elem c) returns Ê- if the text stream has a character equal to c, Ë otherwiseˆfoldl (notElem c) returns Ë1 if the text stream has a character equal to c, Ê otherwise‰foldl(find predicate)A returns the first character that satisfies the predicate or É( if no character satisfies the predicateŠfoldl (index n) returns the n$th character of the text stream, or É; if the stream has an insufficient number of characters‹foldl (elemIndex c)6 returns the index of the first character that equals c , or É if no character matchesŒfoldl(findIndex predicate)O 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 appearsŽfoldlCombine all the strict  chunks to build a lazy  }~€‚ƒ„…†‡ˆ‰Š‹ŒŽ}~€‚„ƒ…†‡ˆ‰Š‹ŒŽ None<CNQVçêfoldlLike ‘, but monadic.A '# m a b' processes elements of type a, and results in a monadic value of type m b.foldlScanM   step   initial   extract‘foldl|Efficient representation of a left map-with-accumulator that preserves the scan's step function and initial accumulator.This allows the ÅM 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 Æ container”foldlLike “" but start scanning from the right•foldlLike “ but monadic–foldl Convert a  into a prescanA"Prescan" means that the last element of the scan is not included—foldl Convert a  into a postscanC"Postscan" means that the first element of the scan is not included™foldlUpgrade a scan to accept the ‘ typešfoldl.Upgrade a more traditional scan to accept the ‘ type›foldl%Upgrade a monadic scan to accept the  typeœfoldl6Upgrade a more traditional monadic scan to accept the  typefoldl Generalize a ‘ to a  Rgeneralize (pure r) = pure r generalize (f <*> x) = generalize f <*> generalize xžfoldlSimplify a pure  to a ‘ Jsimplify (pure r) = pure r simplify (f <*> x) = simplify f <*> simplify xŸfoldlShift 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 Jpremap k (pure r) = pure r premap k (f <*> x) = premap k f <*> premap k x¡foldl(premapM f scaner) returns a new - where f is applied to each input element <premapM return = id premapM (f <=< g) = premap g . premap f NpremapM k (pure r) = pure r premapM k (f <*> x) = premapM k f <*> premapM k xÐfoldllThis is same as normal function composition, except slightly more efficient. The same trick is used in base  Vhttp://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{|#$*+./239;=>?@AB}~#$*+./239;=>?@AB}~€€%‚&'ƒTUVWXYZ]^„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ~ ¡¢¢£¤¥¦ž§¨©žªž«ž¬ ­® ­¯°±²³´µ¶·¸¹º»"foldl-1.4.4-FvlFtmEY4YJD1w8fLrXZ0J Control.FoldlControl.Foldl.ByteStringControl.Foldl.Text Control.ScanlControl.Foldl.InternalControl.Monad.Morphhoistbase Data.FoldableFoldableghc-primGHC.Prim RealWorldGHC.WordWord8bytestring-0.10.8.2Data.ByteString.Internal ByteString(primitive-0.6.4.0-39Pwmm1zkQX6bM7xFUT3JcControl.Monad.Primitive PrimMonad text-1.2.3.0Data.Text.InternalText&vector-0.12.0.1-GC2xzdMF0QQGz7ZCcRBJRLData.Vector.Generic.BaseMutableVectorHandlerMEndoMappEndoMHandlerFoldMFoldfoldfoldMscanprescanpostscanmconcatfoldMapheadlastlastDeflastNnulllengthandorallanysumproductmeanvariancestdmaximum maximumByminimum minimumByelemnotElemfindindex elemIndex findIndexlookuprandomrandomNmapM_sink genericLength genericIndexlistrevListnubeqNubsethashSetmaphashMapvectorvectorMpurelypurely_impurely impurely_ generalizesimplifyhoists duplicateM_Fold1premappremapM prefilter prefilterMhandlesfoldOverhandlesM foldOverMfoldedfilteredgroupBy$fFloatingFold$fFractionalFold $fNumFold $fMonoidFold$fSemigroupoidTYPEFold$fSemigroupFold$fApplicativeFold $fComonadFold $fChoiceFold$fProfunctorFold $fFunctorFold$fFloatingFoldM$fFractionalFoldM $fNumFoldM $fMonoidFoldM$fSemigroupFoldM$fProfunctorFoldM$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.BaseMaybestricthushPairLeft'Right'Just'Nothing' ApplicativeData.Traversable TraversablemappendmemptyNothing GHC.TypesTrueFalseGHC.NumNumGHC.RealIntegral$comonad-5.0.4-KLUOQaUA2d039YzSJ6Z0pEControl.ComonadComonadtransformers-0.5.5.0Control.Monad.Trans.Classlift#.