۷1      !"#$%&'()*+,-./0123456789:;<=>? @ A B C D E F G H I J K L M N O P Q R STUVWXYZ[\]^_`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 %' 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 %(K container, after mapping the contents into a suitable form for reduction. Apply a  to a %( 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.com If m is a c-Reducer , then m is (c   m)-Reducer ( This can be used to quickly select a Reducer for use as a )*  )*. '  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  %&  portable experimentalekmett@gmail.coma % transformer that treats %+ as ,-  This lets you use a  ByteString as a ,- 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 % 5 !"#$%&'()*+,%&'()"#$ !*+,'non-portable (MPTCs, OverloadedStrings) experimentalekmett@gmail.com -A %&: 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. 'We have an unhandled tab to deal with. We've only seen part of a line. We've seen some carriage returns. :An absolute position in a file is known, or an overriding #line directive has been seen 0?Compute the location of the next standard 8-column aligned tab 15lift information about a source file into a starting - for that file 2jextract partial information about the current column, even in the absence of knowledge of the source file 3Fextract partial information about the current line number if possible 4<extract the standard format for an absolute source position / -./012340-/.3214'non-portable (MPTCs, OverloadedStrings) experimentalekmett@gmail.com5A & transformer that strips out newlines 7A 6 transformer that strips out any character matched by %. 9A  transformer that breaks a ,- % into distinct lines, feeding a ,-  each line in turn. :A  transformer that breaks a ,- % into distinct words, feeding a ,-  each line in turn ;#Extract the matched words from the : %& <#Extract the matched lines from the 9 %& =^Utility function to extract words using accumulator, inside-word, and until-next-word monoids >^Utility function to extract lines using accumulator, inside-line, and until-next-line monoids 1 56789:;<=> :;78=9<56> portable experimentalekmett@gmail.com'?@A?@A portable experimentalekmett@gmail.comAn LZ78 compressing %, which supports efficient ' operations Ca type-constrained * operation Dcontruct an LZ78-compressed % using a /0* internally, requires an instance of Ord. Econtruct an LZ78-compressed %6 using a list internally, requires an instance of Eq. F*QuickCheck property: decode . encode = id G,QuickCheck property: decode . encodeEq = id ; !"#$%&'()*+,BCDEFGBCDEFG (non-portable (overloaded strings, MPTCs) experimentalekmett@gmail.com'HIJHIJ portable experimentalekmett@gmail.comKA %& is just a %1. with one object. This fakes that with a GADT LThe %&7 of the endomorphisms over some object in an arbitrary %1. O Extract the %& from its representation as a %1 PConvert a value in a %& into an arrow in a %1. /KLMNOPLMNKOP portable experimentalekmett@gmail.comQRQRportable experimentalekmett@gmail.comQRSS"portable (but instances use MPTCs) experimentalekmett@gmail.comT Convert a %& into a Z . Mnemonic: Exp a * Exp b = Exp (a + b) W Convert a Z into a %& . Mnemonic: Log a + Log b = Log (a * b) 'QRTUVWXYZ[\ Z[\WXYTUVportable experimentalekmett@gmail.com)QRSTUVWXYZ[\]]portable (instances use MPTCs) experimentalekmett@gmail.com^ a * (b + c) = (a * b) + (a * c)_ (a + b) * c = (a * c) + (b * c))QRTUVWXYZ[\^_^_non-portable (MPTCs) experimentalekmett@gmail.com`A ` is an instance of both Z and %& where  \ distributes over Q . *QRTUVWXYZ[\^_``aThe %& (%2,%') over %' a where %' is the top element dThe %& (%2,%') over %' a where %' is the bottom element gThe %& given by (%2,%3) jThe %& (%2,%3) abcdefghijklmnjklghidefmabcn experimentalekmett@gmail.comoA ` which adds %3 and %3 to a pre-existing type. sA ` using a type's built-in Bounded instance. 1QRTUVWXYZ[\^_`opqrstustuorqpvThe ` (%2,%3) over a extended with y.  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 0QRTUVWXYZ[\^_`vwxyyvwx4portable experimentalekmett@gmail.com+QRSTUVWXYZ[\]^_portable experimentalEdward Kmett <ekmett@gmail.com>zMinimal complete definition: { or | "QRz{|}z{}|portable experimentalekmett@gmail.com$QRz{|}~~portable experimentalekmett@gmail.com&QRSz{|}/QRTUVWXYZ[\^_`z{|}non-portable (MPTCs) experimentalekmett@gmail.com2QRTUVWXYZ[\^_`z{|}non-portable (MPTCs) experimentalekmett@gmail.com2QRTUVWXYZ[\^_`z{|}?non-portable (MPTCs, scoped types, empty decls, type operators) experimentalEdward Kmett <ekmett@gmail.com>4QRTUVWXYZ[\^_`z{|}non-portable (MPTCs) experimentalekmett@gmail.com  (x *. m) .* y = x *. (m .* y)  (m .* x) * y = m .* (x * y)  (x * y) *. m = x * (y *. m)4QRTUVWXYZ[\^_`z{|}non-portable (MPTCs) experimentalekmett@gmail.comif m is a  over r and f is a %5 then f  m is a  over r as well A  turns any %5 instance into a %&.  It also provides a Z instance for an %5 functor wrapped around a %&  and asserts that any %5 applied to a %& forms a ^  under these operations. A  uses an glues together %5 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 FQRTUVWXYZ[\^_`z{|} non-portable (MPTCs) experimentalekmett@gmail.comif m is a  over r and f is a %6 then f  m is a  as well A  turns any %6 instance into a %&.  It also provides a Z instance for a %6 wrapped around a %&  and asserts that any %6 applied to a %& forms a ^  under these operations. An  uses glues together %6 actions with (>>)  in the manner of %6 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 ;QRTUVWXYZ[\^_ #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   %3   1The sum of a collection of actions, generalizing %7   ,   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   %3   1The sum of a collection of actions, generalizing %7   ,   Efficiently ' a % using the @ ? 4 monoid. A specialized version of its namesake from  Data.Foldable   + A  Type specialization of foldMap above  Efficiently * a % using the @ ? 4 monoid. A specialized version of its namesake from  Data.Foldable   , A   Convert any %. to a list of its contents. Specialization of *  Efficiently * a % that contains values of type  ,8   , %&  Efficiently * a % that contains values of type  ,8   , %&  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     %& A 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 A generalization of Data.List.cycle to an arbitrary %&9. May fail to terminate for some values in some monoids. A generalization of Data.List.repeat to an arbitrary %&9. May fail to terminate for some values in some monoids. N !"#$%&'()*+,!non-portable (MPTCs) experimentalekmett@gmail.com7 !"#$%&'()*+,"portable experimentalekmett@gmail.comA % which supports efficient '* operations over run-length encoded data. #A single run with a strict length. naive left to right encoder *QuickCheck property: decode . encode = id ? !"#$%&'()*+, #5QRTUVWXYZ[\^_`z{|} 9:;<=>?@ABCDEFFGHHIJKLMMNOPQRRSTTUVVWXYZ[\]^_`abcdefghijklmnopq r r s t u v w x y z z { | } } ~   !!""""""u"""v"x#%&%'%(%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&)*)*%,-l%. /0%1%1%1%1 %1 %  %' % %%%%5%5%%6%6%%,8monoids-0.1.17Data.Monoid.ReducerData.Monoid.Reducer.Char Data.Monoid.Lexical.UTF8.DecoderData.Monoid.Reducer.WithData.Monoid.UnionData.Monoid.Generator"Data.Monoid.Lexical.SourcePositionData.Monoid.Lexical.WordsData.Monoid.SelfData.Monoid.Generator.LZ78Data.Monoid.FromStringData.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.Tropical Data.GroupData.Group.CombinatorsData.Group.Sugar Data.RingData.Ring.BooleanData.Ring.FromNumData.Ring.ModularArithmeticData.Ring.ModuleData.Monoid.ApplicativeData.Monoid.MonadData.Monoid.CombinatorsData.Monoid.Generator.FreeData.Monoid.Generator.RLE)Data.Ring.Module.AutomaticDifferentiationData.Monoid.Instancesbase Data.Monoid Data.Maybe Data.Foldablefingertree-0.0Data.FingerTree Data.Wordghc-prim GHC.Types GHC.Unicodecontainers-0.2.0.0Data.MapControl.CategoryData.OrdPreludeData.Ring.SugarControl.Applicative Control.Monad Data.ListGHC.BoolReducerunitsnoccons foldMapReduce foldReduce returnUnitpureUnit CharReducerfromChar invalidCharUTF8runUTF8 WithReducerwithoutReducer UnionWith getUnionWith HasUnionWith unionWith emptyWithUniongetUnionHasUnionemptyunionChar8getChar8Values getValuesKeysgetKeys GeneratorElem mapReducemapTomapFromreduce mapReduceWith reduceWithSourcePosition SourceColumn SourceLinenextTab startOfFile sourceColumn sourceLineshowSourcePositionUnlined runUnlinedUnspaced runUnspacedLinesWordsrunWordsrunLines wordsFrom linesFromSelfgetSelfLZ78decodeencodeencodeEqprop_decode_encodeprop_decode_encodeEq FromString getFromStringCMonoidGEndogetGEndocategoryToMonoidmonoidToCategorypluszero+ExpgetExpLoggetLogMultiplicativeonetimes*LeftSemiNearRingRightSemiNearRingSemiRing MinPrioritygetMinPriority MaxPrioritygetMaxPriorityMingetMinMaxgetMax minfinityinfinityPriorityMaxBoundMinBoundOrdergetOrderTropical getTropicalGroupgnegateminus gsubtract replicate!prop_replicate_right_distributive-negatesubtractRingBoolRing getBoolRingFromNum getFromNumModularmodulusModgetModwithIntegralModulusModule RightModule.* LeftModule*.AppgetAppAltgetAlt Traversal getTraversal snocTraversalMongetMonMonadSum getMonadSumAction getAction snocAction traverse_for_asummapM_forM_msumfoldMap concatMapfoldtoListandoranyallsumproductelemnotElemfilter filterWithfindcyclerepeatFree AnyGeneratorRLEgetRLERun encodeListprop_decode_encodeListDMonoidMaybeFoldablemappendmconcatmemptygetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductgetFirstFirstgetLastLast FingerTreemeasureGHC.WordWord8CharTabColumnsPosisSpaceTokenMapCategory>>><<<.id GHC.ClassesminNothingmaxGHC.EnummaxBoundminBoundGHC.Num Applicative AlternativeGHC.BaseMonad MonadPlusflipGHC.ListconcatBool