~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ `abcdefghijklmnopqrstuvwxyz{|}~ !!!!!"""""##########$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%&&''())))))))))))))***+,.-portable experimentalekmett@gmail.comnon-portable (MPTCs) experimentalekmett@gmail.com$This type may be best read infix. A c  m is a ./ m that maps  values of type c through unit to values of type m. A c- may also ) supply operations which tack-on another c to an existing ./ m on the left P or right. These specialized reductions may be more efficient in some scenarios $ and are used when appropriate by a  Generator . The names  and  work = by analogy to the synonymous operations in the list monoid. LThis class deliberately avoids functional-dependencies, so that () can be a c -Reducer  for all cJ, and so many common reducers can work over multiple types, for instance,  First and Last may reduce both a and .0 a . Since a  Generator has a fixed element Z type, the input to the reducer is generally known and extracting from the monoid usually Z is sufficient to fix the result type. Combinators are available for most scenarios where X this is not the case, and the few remaining cases can be handled by using an explicit  type annotation. Minimal definition:  or  Convert a value into a ./ Append a value to a ./$ for use in left-to-right reduction Prepend a value onto a ./( for use during right-to-left reduction Apply a  to a .1K container, after mapping the contents into a suitable form for reduction. Apply a  to a .1 mapping each element through  '         non-portable (MPTCs) experimentalekmett@gmail.com "Provides a mechanism for the UTF8 ./6 to report invalid characters to one or more monoids. *         non-portable (MPTCs) experimentalekmett@gmail.com,      non-portable (MPTCs) experimentalekmett@gmail.comIf m is a c-Reducer , then m is (c  m)-Reducer ( This can be used to quickly select a Reducer for use as a 23  23. *      The ./ ('unionWith mappend',)! for containers full of monoids. MPolymorphic containers that we can supply an operation to handle unions with The ./ (,) A Container suitable for the  ./ 3        portable experimentalekmett@gmail.coma ( transformer that treats .4 as 56  This lets you use a  ByteString as a 56 source without going through a ./ transformer like UTF8 "a (M transformer that asks only for the values contained in an indexed container %a (A transformer that asks only for the keys of an indexed container (minimal definition * or + -Apply a  directly to the elements of a ( 8       !"#$%&'()*+,-./()*+,%&'"#$ !-./ ! !"#$#$%&'&'()*+,)*+,-./'non-portable (MPTCs, OverloadedStrings) experimentalekmett@gmail.com 0A ./: of partial information about locations in a source file. _ This is polymorphic in the kind of information you want to maintain about each source file. 1'We have an unhandled tab to deal with. 2We've only seen part of a line. 3We've seen some carriage returns. 4:An absolute position in a file is known, or an overriding #line directive has been seen 7?Compute the location of the next standard 8-column aligned tab 85lift information about a source file into a starting 0 for that file 9jextract partial information about the current column, even in the absence of knowledge of the source file :Fextract partial information about the current line number if possible ;<extract the standard format for an absolute source position 6      0123456789:; 70432165:98; 04321123456789:;'non-portable (MPTCs, OverloadedStrings) experimentalekmett@gmail.com<A  & transformer that strips out newlines >A  6 transformer that strips out any character matched by .7 @A   transformer that breaks a 56 ( into distinct lines, feeding a 56  each line in turn. AA   transformer that breaks a 56 ( into distinct words, feeding a 56  each line in turn B#Extract the matched words from the A ./ C#Extract the matched lines from the @ ./ D^Utility function to extract words using accumulator, inside-word, and until-next-word monoids E^Utility function to extract lines using accumulator, inside-line, and until-next-line monoids 4      <=>?@ABCDE AB>?D@C<=E <==>??@ABCDE portable experimentalekmett@gmail.com*      FGHFGHFGHGH portable experimentalekmett@gmail.comAn LZ78 compressing (, which supports efficient * operations Ja type-constrained - operation Kcontruct an LZ78-compressed ( using a 89* internally, requires an instance of Ord. Lcontruct an LZ78-compressed (6 using a list internally, requires an instance of Eq. M*QuickCheck property: decode . encode = id N,QuickCheck property: decode . encodeEq = id >       !"#$%&'()*+,-./IJKLMNIJKLMNIJKLMN (non-portable (overloaded strings, MPTCs) experimentalekmett@gmail.com*      OPQOPQOPQPQ #non-portable (type families, MPTCs) experimentalekmett@gmail.comRA generalization of Data.List.cycle to an arbitrary ./9. May fail to terminate for some values in some monoids. SA generalization of Data.List.repeat to an arbitrary ./9. May fail to terminate for some values in some monoids. TA generalization of Data.List.replicate to an arbitrary ./. Adapted from   Jhttp://augustss.blogspot.com/2008/07/lost-and-found-if-i-write-108-in.html RSTUSTRURSTU portable experimentalekmett@gmail.comVA ( which supports efficient ** operations over run-length encoded data. Y#A single run with a strict length. \<naive left to right encoder, which can handle infinite data ]*QuickCheck property: decode . encode = id B       !"#$%&'()*+,-./VWXYZ[\]^_ VWXYZ[^\_] VWXWXYZZ[\]^_portable experimentalekmett@gmail.com`A ./ is just a .:. with one object. This fakes that with a GADT aThe ./7 of the endomorphisms over some object in an arbitrary .:. d Extract the ./ from its representation as a .: eConvert a value in a ./ into an arrow in a .:. 2      !" `abcdeabc`de`abcbcdeportable experimentalekmett@gmail.com     fgfgfgportable experimentalekmett@gmail.com     fghhh"portable (but instances use MPTCs) experimentalekmett@gmail.comi Convert a ./ into a o . Mnemonic: Exp a * Exp b = Exp (a + b) l Convert a o into a ./ . Mnemonic: Log a + Log b = Log (a * b) '     fgijklmnopq opqlmnijk ijkjklmnmnopqpqportable experimentalekmett@gmail.com)     fghijklmnopqrrrportable (instances use MPTCs) experimentalekmett@gmail.coms (a + b) * c = (a * c) + (b * c)t a * (b + c) = (a * b) + (a * c))     fgijklmnopqsttsstnon-portable (MPTCs) experimentalekmett@gmail.comuA u is an instance of both o and ./ where  q distributes over f. *     fgijklmnopqstuuuvThe ./ (#.;,$.0) over .0 a where $.0 is the top element yThe ./ (%.;,$.0) over .0 a where $.0 is the bottom element |The ./ given by (#.;,&.<) The ./ (%.;,'.<) vwxyz{|}~|}~yz{vwxvwxwxyz{z{|}~}~ experimentalekmett@gmail.comA u which adds '.< and &.< to a pre-existing type. A u using a type's built-in Bounded instance. 1     fgijklmnopqstuThe u (#.;,(.<) over a extended with .  When aH has a Num instance with an addition that respects order, then this is S transformed into a tropical semiring. It is assumed that 0 is the least element  of a.  Ahttp://hal.archives-ouvertes.fr/docs/00/11/37/79/PDF/Tropical.pdf 0     fgijklmnopqstu1     fgijklmnopqst=portable experimentalekmett@gmail.com+     fghijklmnopqrstportable experimentalEdward Kmett <ekmett@gmail.com>Minimal complete definition:  or  "     fgportable experimentalekmett@gmail.com$     fgportable experimentalekmett@gmail.com"Minimal definition over or grecip x / y x  y/     fgijklmnopqportable experimentalekmett@gmail.com&     fghportable experimentalekmett@gmail.com7     fghijklmnopqrportable (instances use MPTCs) experimentalekmett@gmail.com/     fgijklmnopqstunon-portable (MPTCs) experimentalekmett@gmail.com2     fgijklmnopqstu non-portable (MPTCs) experimentalekmett@gmail.com2     fgijklmnopqstu!?non-portable (MPTCs, scoped types, empty decls, type operators) experimentalEdward Kmett <ekmett@gmail.com>4     fgijklmnopqstu"non-portable (MPTCs) experimentalekmett@gmail.com  (x *. m) .* y = x *. (m .* y)  (m .* x) * y = m .* (x * y)  (x * y) *. m = x * (y *. m)4     fgijklmnopqstu#non-portable (MPTCs) experimentalekmett@gmail.comif m is a " over r and f is a ).> then f ## m is a " over r as well A ## turns any *.> instance into a ./.  It also provides a o instance for an ).> functor wrapped around a ./  and asserts that any *.> applied to a ./ forms a s  under these operations. A ## uses an glues together ).> actions with (*>)  in the manner of  traverse_ from  Data.Foldable. Any values returned by " reduced actions are discarded. 2Efficiently avoid needlessly rebinding when using & on an action that already returns () ; A rewrite rule automatically applies this when possible I      fgijklmnopqstu $non-portable (MPTCs) experimentalekmett@gmail.comif m is a " over r and f is a +.? then f $$ m is a " as well A $$ turns any ,.? instance into a ./.  It also provides a o instance for a +.? wrapped around a ./  and asserts that any ,.? applied to a ./ forms a s  under these operations. An $$ uses glues together +.? actions with (>>)  in the manner of -.? from  Data.Foldable. Any values returned by " reduced actions are discarded. 2Efficiently avoid needlessly rebinding when using & on an action that already returns () ; A rewrite rule automatically applies this when possible >      fgijklmnopqst %#non-portable (type families, MPTCs) experimentalekmett@gmail.com Efficiently * a ( using the ##4 monoid. A specialized version of its namesake from  Data.Foldable   * # !Convenience function as found in  Data.Foldable   ..< % 1The sum of a collection of actions, generalizing /.@   / #  Efficiently * a ( using the $$4 monoid. A specialized version of its namesake from  Data.Foldable and  Control.Monad   . $ !Convenience function as found in  Data.Foldable and  Control.Monad   ..< % 1The sum of a collection of actions, generalizing /.@   / $  Efficiently * a ( using the G F 4 monoid. A specialized version of its namesake from  Data.Foldable   . H  Type specialization of foldMap above  Efficiently - a ( using the G F 4 monoid. A specialized version of its namesake from  Data.Foldable   / H   Convert any (. to a list of its contents. Specialization of -  Efficiently - a ( that contains values of type 05A   / ./  Efficiently - a ( that contains values of type 05A   / ./  Efficiently * any (C checking to see if any of its values match the supplied predicate   . ./  Efficiently * any (C checking to see if all of its values match the supplied predicate   . ./ (Efficiently sum over the members of any (   /  ./ 2Efficiently take the product of every member of a (   / ./ Check to see if % member of the ( matches the supplied value BCheck to make sure that the supplied value is not a member of the (  Efficiently * a subset of the elements in a ( jAllows idiomatic specialization of filter by proving a function that will be used to transform the output A specialization of % using the ././ ./, analogous to Data.List.find   % ./ M       !"#$%&'()*+,-./&non-portable (MPTCs) experimentalekmett@gmail.com:       !"#$%&'()*+,-./'#non-portable (type families, MPTCs) experimentalekmett@gmail.com,     fgijklmnopqstu( *r *. (x * y) = (r *. x) * y = x * (r *. y) *(x * y) .* r = y * (x .* r) = (y .* r) * x5     fgijklmnopqstu)10a conservative upper bound on the element count 20a conservative lower bound on the element count 3Athe actual element count (lazy) used when the above two disagree 4low water mark 5high water mark 66the set of bits. TODO: negative mantissa = complement 7invariant: mantissa   0 =2 universe = (fromEnum minBound,fromEnum maxBound) 8Finternal smart constructor: makes sure the count is forced when known 9O(d) where dF is absolute deviation in fromEnum from the least element in the set. The empty bit set. VIs the bit set empty? Asymptotically faster than checking if size == 0 in some cases. O(d * n) Make a BitSet from a list of items. O(d)" Insert an item into the bit set. O(d)" Delete an item from the bit set. O(testBit on Integer)) Ask whether the item is in the bit set. O(1) or O(d)( The number of elements in the bit set. O(d)B convert to an Integer representation. Discards negative elements 5      *portable (instances use MPTCs) experimentalekmett@gmail.com7     fgijklmnopqstu+portable experimentalekmett@gmail.com4     fgijklmnopqstu,:     fgijklmnopqstu:BCDEFGHIJKLMNOPQRRSTTUVWXYYZ[\]^^_``abbcdefghijklmnopqrstuvwxyz{o|}~          \   !!!!!"""""##########$$$$$$$$$$%%%%%%%%%%%%%%%%%%%%%&&''())\)))))))) ) ) ) )* **+,./.0.1././././././././././././././././ ./!./!./"./#./#./$./%./%./&./'./'23(23).*+56,.-. /890.:1.:2.:3.:4.:5.67.08.69.:;.:<.=.>>.>?.@A.?B.?.@C.DE5AF)G)H)I)J)K)L)M)N)Omonoids-0.1.28Data.Monoid.ReducerData.Monoid.Reducer.Char Data.Monoid.Lexical.UTF8.DecoderData.Monoid.Reducer.WithData.Monoid.UnionData.Generator"Data.Monoid.Lexical.SourcePositionData.Monoid.Lexical.WordsData.Monoid.SelfData.Generator.Compressive.LZ78Data.Monoid.FromStringData.Monoid.CombinatorsData.Generator.Compressive.RLEData.Monoid.CategoricalData.Monoid.AdditiveData.Monoid.Additive.SugarData.Monoid.Multiplicative Data.Monoid.Multiplicative.SugarData.Ring.Semi.NearData.Ring.SemiData.Monoid.OrdData.Ring.Semi.OrdData.Ring.Semi.TropicalData.Ring.Semi.Near.Trie Data.GroupData.Group.CombinatorsData.Group.MultiplicativeData.Group.SugarData.Group.Multiplicative.Sugar Data.RingData.Ring.BooleanData.Ring.FromNumData.Ring.ModularArithmeticData.Ring.ModuleData.Monoid.ApplicativeData.Monoid.MonadData.Generator.CombinatorsData.Generator.FreeData.Ring.Semi.NaturalData.Ring.AlgebraData.Ring.Semi.BitSet)Data.Ring.Module.AutomaticDifferentiation Data.FieldData.Field.VectorSpaceData.Monoid.Instancesbase Data.Monoid Data.Maybe Data.Foldablefingertree-0.0Data.FingerTree Data.Wordghc-prim GHC.Types Data.Charcontainers-0.2.0.1Data.MapControl.CategoryData.OrdPreludeData.Ring.SugarControl.Applicative Control.Monad Data.ListGHC.Bool ReducedBy Reduction getReductionReducerunitsnoccons foldMapReduce foldReduce returnUnitpureUnit CharReducerfromChar invalidCharUTF8runUTF8 WithReducerwithoutReducer UnionWith getUnionWith HasUnionWith unionWith emptyWithUniongetUnionHasUnionemptyunionChar8getChar8Values getValuesKeysgetKeys GeneratorElem mapReducemapTomapFromreduce mapReduceWith reduceWithSourcePositionTabColumnsLinesPos SourceColumn SourceLinenextTab startOfFile sourceColumn sourceLineshowSourcePositionUnlined runUnlinedUnspaced runUnspacedWordsrunWordsrunLines wordsFrom linesFromSelfgetSelfLZ78decodeencodeencodeEqprop_decode_encodeprop_decode_encodeEq FromString getFromStringcyclerepeat replicate!prop_replicate_right_distributiveRLEgetRLERun encodeListprop_decode_encodeListCMonoidGEndogetGEndocategoryToMonoidmonoidToCategorypluszero+ExpgetExpLoggetLogMultiplicativeonetimes*RightSemiNearRingLeftSemiNearRingSemiRing MinPrioritygetMinPriority MaxPrioritygetMaxPriorityMingetMinMaxgetMax minfinityinfinityPriorityMaxBoundMinBoundOrdergetOrderTropical getTropicalTrietotallabelchildren singletonnullGroupgnegateminus gsubtractMultiplicativeGroupoverundergrecip-negatesubtract/\\recipRingBoolRing getBoolRingFromNum getFromNumModularmodulusModgetModwithIntegralModulusModule RightModule.* LeftModule*.AppgetAppAltgetAlt Traversal getTraversal snocTraversalMongetMonMonadSum getMonadSumAction getAction snocAction traverse_for_asummapM_forM_msumfoldMap concatMapfoldtoListandoranyallsumproductelemnotElemfilter filterWithfindFree AnyGeneratorNaturalnaturalAlgebraBitSetfull complementfromListfromDistinctAscListinsertdeletemembersize toIntegerDliftdField VectorSpaceMonoidMaybeFoldablemappendmconcatmemptygetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductgetFirstFirstgetLastLast FingerTreemeasureGHC.WordWord8Char GHC.UnicodeisSpaceTokenMapCategory>>><<<.id GHC.ClassesminNothingmaxGHC.EnummaxBoundminBoundGHC.Num Applicative AlternativeGHC.BaseMonad MonadPlusflipGHC.ListconcatBool _countAtLeast _countAtMost_countexponent_hwmmantissa _universebs