!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Copyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred2468 vThis is the primary class for structures that are to be considered foldable. A minimum complete definition provides  and . Instances of + can be folded, and can be many and varied.$These functions are used heavily in  Data.ListLike. Left-associative fold Strict version of .  A variant of 7 with no base case. Requires at least 1 list element.Right-associative fold Strict version of Like , but with no starting value9Combine the elements of a structure using a monoid.  =  id 7Map each element to a monoid, then combine the results )Monadic version of left fold, similar to  . *A map in monad space, discarding results. 7Evaluate each action, ignoring the results. Same as   .     Copyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred23468MP An extension to M for those data types that are capable of dealing with infinite lists. Some  functions are capable of working with finite or infinite lists. The functions here require infinite list capability in order to work at all. ;An infinite list of repeated calls of the function to args 0An infinite list where each element is the same +Converts a finite list into a circular one +The class implementing list-like functions.&It is worth noting that types such as    can be instances of r. Due to their specific ways of operating, they may not behave in the expected way in some cases. For instance,  may not increase the size of a map if the key you have given is already in the map; it will just replace the value already there.$Implementators must define at least: singletonheadtailnull or genericLengthThe empty list 0Creates a single-element list out of an element ?Like (:) for lists: adds an element to the beginning of a list "Adds an element to the *end* of a .  Combines two lists. Like (++).  Extracts the first element of a . Extracts the last element of a . #Gives all elements after the head. 8All elements of the list except the last one. See also 1. !Tests whether the list is empty. Length of the list. See also U. EApply a function to each element, returning any other valid .  will always be at least as fast, if not faster, than this function and is recommended if it will work for your purposes. See also A. Like , but without the possibility of changing the type of the item. This can have performance benefits for things such as ByteStrings, since it will let the ByteString use its native low-level map implementation.  Reverse the elements in a list. 2Add an item between each element in the structure Flatten the structure. !MMap a function over the items and concatenate the results. See also "."Like !, but without the possibility of changing the type of the item. This can have performance benefits for some things such as ByteString. #'True if any items satisfy the function $'True if all items satisfy the function %The maximum value of the list &The minimum value of the list 'kGenerate a structure with the specified length with every element set to the item passed in. See also Y (2Takes the first n elements of the list. See also V. )2Drops the first n elements of the list. See also W *Equivalent to (( n xs, ) n xs) . See also X. +AReturns all elements at start of list that satisfy the function. ,PDrops all elements from the start of the list that satisfy the function. -NDrops all elements from the end of the list that satisfy the function. .The equivalent of (+ f xs, , f xs) /The equivalent of . ( . f) 0Split a list into sublists, each which contains equal arguments. For order-preserving types, concatenating these sublists will produce the original list. See also R. 11All initial segments of the list, shortest first 2"All final segnemts, longest first 3<True when the first list is at the beginning of the second. 4<True when the first list is at the beginning of the second. 5@True when the first list is wholly containted within the second 6$True if the item occurs in the list 7,True if the item does not occur in the list 8fTake a function and return the first matching element, or Nothing if there is no such element. 95Returns only the elements that satisfy the function. :JReturns the lists that do and do not satisfy the function. Same as (9 p xs, 9 ( . p) xs) ;kThe element at 0-based index i. Raises an exception if i is out of bounds. Like (!!) for lists. <0Returns the index of the element, if it exists. =@Returns the indices of the matching elements. See also ? >nTake a function and return the index of the first matching element, or Nothing if no element matches ?<Returns the indices of all elements satisfying the function @=Evaluate each action in the sequence and collect the results AA map in monad space. Same as @ .   See also B BLike A~, but without the possibility of changing the type of the item. This can have performance benefits with some types. C4Removes duplicate elements from the list. See also M DIRemoves the first instance of the element from the list. See also N E{List difference. Removes from the first list the first instance of each element of the second list. See '(\)' and O FList union: the set of elements that occur in either list. Duplicate elements in the first list will remain duplicate. See also P. GSList intersection: the set of elements that occur in both lists. See also Q HSorts the list. On data types that do not preserve ordering, or enforce their own ordering, the result may not be what you expect. See also S. IIInserts the element at the last place where it is still less than or equal to the next element. On data types that do not preserve ordering, or enforce their own ordering, the result may not be what you expect. On types such as maps, this may result in changing an existing item. See also T. JLConverts the structure to a list. This is logically equivolent to L0, but may have a more optimized implementation. K%Generates the structure from a list. L,Converts one ListLike to another. See also J%. Default implementation is fromListLike = map id MGeneric version of C NGeneric version of N OGeneric version of E PGeneric version of F QGeneric version of G RGeneric version of 0. S2Sort function taking a custom comparison function TLike I(, but with a custom comparison function ULength of the list VGeneric version of ( WGeneric version of ) XGeneric version of * YGeneric version of ' Z;Takes two lists and returns a list of corresponding pairs. [CTakes two lists and combines them with a custom combining function Q  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Q  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Q !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY Z[   I !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[Copyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred\An extension to , for those data types that are similar to a ". Minimal complete definition is ] and ^. ]Converts the structure to a  ^ Converts a  to a list _'Breaks a string into a list of strings `%Breaks a string into a list of words a Joins lines b Joins words \]^_`ab\]^_`ab\]^_`ab\]^_`abCopyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred3c%Returns True if all elements are Trued#Returns True if any element is TrueeThe sum of the listfThe product of the listg=Converts a list of pairs into two separate lists of elements h Converts to a MonadPlus instancei,List-like destructor (like Data.Maybe.maybe)cdefghi Z[cdefghi cdefZ[g hicdefghiCopyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred68jAn extension to I for those data types that support I/O. These functions mirror those in  System.IOI for the most part. They also share the same names; see the comments in  Data.ListLike for help importing them.fNote that some types may not be capable of lazy reading or writing. Therefore, the usual semantics of  System.IO[ functions regarding laziness may or may not be available from a particular implementation.Minimal complete definition:hGetLine hGetContentshGethGetNonBlockinghPutStrk'Reads a line from the specified handle l7Read entire handle contents. May be done lazily like  .m%Read specified number of bytes. See   for particular semantics.nNon-blocking read. See   for more.oWriting entire data.p"Write data plus newline character.q Read one liner%Read entire content from stdin. See l.sWrite data to stdout.t,Write data plus newline character to stdout.ueInteract with stdin and stdout by using a function to transform input to output. May be lazy. See   for more.vRead file. May be lazy.wWrite data to file.xAppend data to file.jklmnopqrstuvwxjklmnopqrstuvwxjklmnopqrstuvwxjklmnopqrstuvwxCopyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportable Safe-Inferred246ywNewtype wrapper around Data.ByteString.Lazy.Char8.ByteString, this allows for ListLike instances with Char elements.|rNewtype wrapper around Data.ByteString.Char8.ByteString, this allows for ListLike instances with Char elements.yz{|}~yz{|}~|}~yz{yz{|}~None246 Safe-Inferred246 Safe-Inferred246 Safe-Inferred246 Safe-InferredNone246None246None246NoneCopyright (C) 2007 John GoerzenBSD3John Lato <jwlato@gmail.com> provisionalportableNone246None2346Copyright (C) 2007 John GoerzenBSD3$John Goerzen <jgoerzen@complete.org> provisionalportableNonez  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`cdefgjklmnopqrstuvwxyz{|}~zcdefZ[g jklmnopqrstuvwx|}~yz{ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY\]^_`  !"#$ %&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ListLike-4.2.0Data.ListLike.FoldableLLData.ListLike.BaseData.ListLike.StringData.ListLike.UtilsData.ListLike.IOData.ListLike.CharStringData.ListLike.Text.TextData.ListLike.Text.TextLazy Control.MonadfoldMData.MapMap System.IO hGetContentshGethGetNonBlockinginteractData.ListLike.DListData.ListLike.FMListData.ListLike.TextData.ListLike.Vector.StorableData.ListLike.Vector.UnboxedData.ListLike.Vector.VectorData.ListLike.VectorData.ListLike.InstancesData.ListLike.Vector.Generic Data.ListLike FoldableLLfoldlfoldl'foldl1foldrfoldr'foldr1foldfoldMapmapM_ sequence_InfiniteListLikeiteraterepeatcycleListLikeempty singletonconssnocappendheadlasttailinitnulllengthmaprigidMapreverse intersperseconcat concatMaprigidConcatMapanyallmaximumminimum replicatetakedropsplitAt takeWhile dropWhile dropWhileEndspanbreakgroupinitstails isPrefixOf isSuffixOf isInfixOfelemnotElemfindfilter partitionindex elemIndex elemIndices findIndex findIndicessequencemapM rigidMapMnubdelete deleteFirstsunion intersectsortinserttoListfromList fromListLikenubBydeleteBydeleteFirstsByunionBy intersectBygroupBysortByinsertBy genericLength genericTake genericDropgenericSplitAtgenericReplicatezipzipWith StringLiketoString fromStringlineswordsunlinesunwordsandorsumproductunzip toMonadPluslist ListLikeIOhGetLinehPutStr hPutStrLngetLine getContentsputStrputStrLnreadFile writeFile appendFileCharStringLazyCSLunCSL CharStringCSunCS$fStringLikeText$fListLikeIOTextChar$fListLikeTextChar$fFoldableLLTextCharbaseGHC.Baseid$fFoldableLL[]aghc-prim GHC.Classesnot $fListLike[]aStringmyLinesmyWords myUnlines myUnwordsmi64toi strict2lazy$fStringLikeCharStringLazy$fListLikeIOCharStringLazyChar$fListLikeCharStringLazyChar$fFoldableLLCharStringLazyChar$fMonoidCharStringLazy$fStringLikeCharString$fListLikeIOCharStringChar$fListLikeCharStringChar$fFoldableLLCharStringChar$fMonoidCharString$fStringLikeDList$fListLikeDLista$fFoldableLLDLista$fMonadZipFMList$fStringLikeFMList$fIsStringFMList$fInfiniteListLikeFMLista$fListLikeFMLista$fFoldableLLFMLista isPrefixOf' isSuffixOf'$fStringLikeVector$fListLikeVectora$fFoldableLLVectora$fListLikeSeqa$fFoldableLLSeqa$fStringLikeSeq$fListLikeIOSeqChar$fListLikeIOArrayChar$fStringLikeArray$fListLikeArraye $fMonoidArray$fFoldableLLArraye$fStringLikeByteString$fListLikeIOByteStringWord8$fListLikeByteStringWord8$fFoldableLLByteStringWord8$fStringLikeByteString0$fListLikeIOByteStringWord80$fListLikeByteStringWord80$fFoldableLLByteStringWord80$fInfiniteListLike[]a$fStringLike[]$fListLikeIO[]Char $fStringLikev $fListLikeva$fFoldableLLva