śĪļOꇓ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ )(c) 2011 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe;=>?'ęPType class for monoid (and semigroup) actions, where monoidal values of type m! "act" on values of another type s/. Instances are required to satisfy the laws act mempty = id 'act (m1 `mappend` m2) = act m1 . act m2HSemigroup instances are required to satisfy the second law but with (“ ) instead of ”. Additionally, if the type s! has any algebraic structure, act m/ should be a homomorphism. For example, if s! is also a monoid we should have act m mempty = mempty and <act m (s1 `mappend` s2) = (act m s1) `mappend` (act m s2). By default, act = const id, so for a type MA which should have no action on anything, it suffices to write instance Action M swith no method implementations..It is a bit awkward dealing with instances of Action’, since it is a multi-parameter type class but we can't add any functional dependencies---the relationship between monoids and the types on which they act is truly many-to-many. In practice, this library has chosen to have instance selection for Action driven by the firstM type parameter. That is, you should never write an instance of the form Action m SomeType5 since it will overlap with instances of the form Action SomeMonoid tB. Newtype wrappers can be used to (awkwardly) get around this.Convert a value of type m to an action on s values.Endo acts by application.4Note that in order for this instance to satisfy the Action laws, whenever the type a3 has some sort of algebraic structure, the type Endo a! must be considered to represent  homomorphisms# (structure-preserving maps) on aV, even though there is no way to enforce this in the type system. For example, if a is an instance of Monoid, then one should only use Endo a values f with the property that f mempty = mempty and f (a <> b) = f a <> f b.Nothing acts as the identity; Just m acts as m.() acts as the identity..(c) 2011-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1;=>?ST<ž m :+: n is the coproduct of monoids m and n. Values of type m :+: n! consist of alternating lists of m and n˜ values. The empty list is the identity, and composition is list concatenation, with appropriate combining of adjacent elements when possible.0Injection from the left monoid into a coproduct.1Injection from the right monoid into a coproduct.%Prepend a value from the left monoid. &Prepend a value from the right monoid. killRg takes a value in a coproduct monoid and sends all the values from the right monoid to the identity. killLf takes a value in a coproduct monoid and sends all the values from the left monoid to the identity. •Take a value from a coproduct monoid where the left monoid has an action on the right, and "untangle" it into a pair of values. In particular, 'm1 <> n1 <> m2 <> n2 <> m3 <> n3 <> ... is sent to _(m1 <> m2 <> m3 <> ..., (act m1 n1) <> (act (m1 <> m2) n2) <> (act (m1 <> m2 <> m3) n3) <> ...)That is, before combining n values, every n! value is acted on by all the m values to its left. TCoproducts act on other things by having each of the components act individually.0The coproduct of two monoids is itself a monoid.  •–.(c) 2012-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1345S×A value of type Cut m is either a single m, or a pair of mD's separated by a divider. The divider represents a "cut point".Cut is similar to Data.Monoid.SplitŁ, but split keeps only the rightmost divider and accumulates all values, whereas cut always keeps the leftmost and rightmost divider, coalescing them into one and throwing away all the information in between.Split! uses the asymmetric constructor :|, and Cut the symmetric constructor :||:,, to emphasize the inherent asymmetry of Split and symmetry of Cut. SplitH keeps only the rightmost split and combines everything on the left; CutE keeps the outermost splits and throws away everything in between.A convenient name for mempty :||: mempty, so composing with cut' introduces a cut point. For example, &Uncut a <> cut <> Uncut b == a :||: b.If m is a  Semigroup, then Cut m" is a semigroup which contains m? as a sub-semigroup, but also contains elements of the form  m1 :||: m2. When elements of mo combine with such "cut" elements they are combined with the value on the corresponding side of the cut (e.g. 4(Uncut m1) <> (m1' :||: m2) = (m1 <> m1') :||: m2s). When two "cut" elements meet, the two inside values are thrown away and only the outside values are kept.5.(c) 2011-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1345lIf m is a —, then  Deletable m? (intuitively speaking) adds two distinguished new elements [ and ]], such that an occurrence of [ "deletes" everything from it to the next ]. For example, abc[def]gh == abcgh'This is all you really need to know to use  Deletable m= values; to understand the actual implementation, read on.hTo properly deal with nesting and associativity we need to be able to assign meanings to things like [[, ][-, and so on. (We cannot just define, say, [[ == [ , since then ([[)] == [] == id but [([]) == [id == [.) Formally, elements of Deletable m6 are triples of the form (r, m, l) representing words  ]^r m [^lU. When combining two triples (r1, m1, l1) and (r2, m2, l2) there are three cases:yIf l1 == r2 then the [s from the left and ]s from the right exactly cancel, and we are left with (r1, m1 <> m2, l2).›If l1 < r2 then all of the [s cancel with some of the ]s, but m1 is still inside the remaining ]s and is deleted, yielding (r1 + r2 - l1, m2, l2)0The remaining case is symmetric with the second.#Project the wrapped value out of a  value. Inject a value into a $ wrapper. Satisfies the property unDelete . toDeletable === id!aA "left bracket", which causes everything between it and the next right bracket to be deleted."MA "right bracket", denoting the end of the section that should be deleted. !" !".(c) 2013-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comNone0<qŅ+An + in a given ˜Ó is a morphism from some object to itself. The set of endomorphisms for a particular object form a monoid, with composition as the combining operation and the identity morphism as the identity element.+,-+,-+,-.(c) 2012-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1345;=ˆq2 The type a! extended with negative infinity.3 The type a! extended with positive infinity.4Inf p a represents the type a‚ extended with a new "infinite" value, which is treated as either positive or negative infinity depending on the type index p&. This type exists mostly for its ™, š, and — instances.7(Type index indicating negative infinity.8(Type index indicating positive infinity.9ZFind the minimum of a list of values. Returns positive infinity iff the list is empty.:ZFind the maximum of a list of values. Returns negative infinity iff the list is empty.;Positive infinity.<Negative infinity.=VEmbed a finite value into the space of such values extended with positive infinity.>VEmbed a finite value into the space of such values extended with negative infinity.AEAn ordered type extended with negative infinity is a monoid under ›1, with negative infinity as the identity element.BEAn ordered type extended with positive infinity is a monoid under œ1, with positive infinity as the identity element.CHAn ordered type extended with negative infinity is a semigroup under ›.DHAn ordered type extended with positive infinity is a semigroup under œ.E0Negative infinity is less than any finite value.F3Positive infinity is greater than any finite value. 23456789:;<=> 45687329:;<=>456)(c) 2011 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comNone ;<=>?FKST—śPSMą, an abbreviation for "single monoid" (as opposed to a heterogeneous list of monoids), is only used internally to help guide instance selection when defining the action of heterogeneous monoidal lists on each other.R The relation l :>: a holds when a! is the type of an element in l. For example, '(Char ::: Int ::: Bool ::: Nil) :>: Int.S:Inject a value into an otherwise empty heterogeneous list.TGet the value of type a/ from a heterogeneous list, if there is one.UAlter the value of type a& by applying the given function to it.VlType class for heterogeneous monoidal lists, with a single method allowing construction of an empty list.WThe empty heterogeneous list of type l . Of course,  empty ==  , but unlike , empty does not require —$ constraints on all the elements of l. PQRTSUVWXY XYVWRSTUPQPQRSTUVWX5Y5.(c) 2012-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1345¤bA value of type  Recommend a consists of a value of type a0 wrapped up in one of two constructors. The  Recommend™ constructor indicates a "non-committal recommendation"---that is, the given value should be used if no other/better values are available. The Commitf constructor indicates a "commitment"---a value which should definitely be used, overriding any  Recommend ed values.eExtract the value of type a wrapped in  Recommend a.gd overrides b6. Two values wrapped in the same constructor (both b or both d.) are combined according to the underlying  Semigroup instance.bcdebcdebcd Safe;=>?Nø§p#The semi-direct product of monoids s and m, which is a monoid when m acts on s:. Structurally, the semi-direct product is just a pair (s,m)G. However, the monoid instance is different. In particular, we have 4(s1,m1) <> (s2,m2) = (s1 <> (m1 `act` s2), m1 <> m2)We think of the m" values as a "tag" decorating the s* values, which also affect the way the s values combine.We call the monoid m$ the quotient monoid and the monoid sJ the sub-monoid of the semi-direct product. The semi-direct product Semi s m is an extension of the monoid s with m being the quotient.rTag an s value with an m: value to create an element of the semi-direct product.sThe injection map, i.e. give an s value a trivial tag.t%Forget the monoidal tag. Of course, untag . inject = id , and untag (tag s m) = s.u'Embed a "tag" value as a value of type Semi s m . Note that inject s <> embed m = tag s mandembed m <> inject s = tag (act m s) m@3The semi-direct product gives a split extension of s by m. This allows us to embed mx into the semi-direct product. This is the embedding map. The quotient and embed maps should satisfy the equation quotient . embed = id.vThe quotient map, i.e.! retrieve the monoidal tag value.pqrstuvpqqrstuvpžq Safe;=>?NĖvy#The semi-direct product of monoids s and m, which is a monoid when m acts on s:. Structurally, the semi-direct product is just a pair (s,m)G. However, the monoid instance is different. In particular, we have 4(s1,m1) <> (s2,m2) = (s1 <> (m1 `act` s2), m1 <> m2)We call the monoid m$ the quotient monoid and the monoid sJ the sub-monoid of the semi-direct product. The semi-direct product Semi s m is an extension of the monoid s with m being the quotient.{Tag an s value with an m: value to create an element of the semi-direct product.|The injection map, i.e. give an s value a trivial tag.}%Forget the monoidal tag. Of course, untag . inject = id , and untag (tag s m) = s.~'Embed a "tag" value as a value of type Semi s m . Note that inject s <> embed m = tag s mandembed m <> inject s = tag (act m s) m@3The semi-direct product gives a split extension of s by m. This allows us to embed mx into the semi-direct product. This is the embedding map. The quotient and embed maps should satisfy the equation quotient . embed = id.The quotient map, i.e.! retrieve the monoidal tag value.yz{|}~yz{|}~yŸ .(c) 2011-2015 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe1345;=>?į[‚A value of type Split m is either a single m, or a pair of m#'s separated by a divider. Single m's combine as usual; single m÷'s combine with split values by combining with the value on the appropriate side; when two split values meet only the rightmost split is kept, with both the values from the left split combining with the left-hand value of the right split.Data.Monoid.Cut> is similar, but uses a different scheme for composition. Split! uses the asymmetric constructor :| , and Cut the symmetric constructor :||:,, to emphasize the inherent asymmetry of Split and symmetry of Cut. SplitH keeps only the rightmost split and combines everything on the left; CutE keeps the outermost splits and throws away everything in between.…A convenient name for mempty :| mempty, so  M a <> split <> M b == a :| b.†z"Unsplit" a split monoid value, combining the two values into one (or returning the single value if there is no split).‡sBy default, the action of a split monoid is the same as for the underlying monoid, as if the split were removed.‰If m is a  Semigroup, then Split mh is a semigroup which combines values on either side of a split, keeping only the rightmost split.‚„ƒ…†‚ƒ„…†‚ƒ„„5 )(c) 2011 diagrams-core team (see LICENSE)BSD-style (see LICENSE)!diagrams-discuss@googlegroups.comSafe;=ęy‘The Monoid'> class is a synonym for things which are instances of both š and —. Ideally, the —+ class itself will eventually include a š* superclass and we can get rid of this.‘‘   !"#$%&'()**+,-./01234567789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[[\]^_`abcdefghijkllmnopqrstuvwx y z { | } ~  €  y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’“”•“–—˜™“–š“›œžŸ“” ž”ž¢“–£ y y¤*monoid-extras-0.4.4-EtQDHQ92pCgJpRrFgauY7JData.Monoid.ActionData.Monoid.CoproductData.Monoid.CutData.Monoid.DeletableData.Monoid.EndomorphismData.Monoid.InfData.Monoid.MListData.Monoid.RecommendData.Monoid.SemiDirectProduct$Data.Monoid.SemiDirectProduct.StrictData.Monoid.SplitData.Monoid.WithSemigroupActionact $fActionEndoa$fActionOptions $fAction()l:+:inLinRmappendLmappendRkillRkillLuntangle $fAction:+:r $fMonoid:+:$fSemigroup:+: $fShow:+:CutUncut:||:cut $fMonoidCut$fSemigroupCut $fDataCut $fShowCut $fReadCut $fFunctorCut $fFoldableCut$fTraversableCut DeletableunDelete toDeletabledeleteLdeleteR$fMonoidDeletable$fSemigroupDeletable$fDataDeletable$fShowDeletable$fReadDeletable$fFunctorDeletable$fFoldableDeletable$fTraversableDeletable EndomorphismgetEndomorphism$fGroupEndomorphism$fMonoidEndomorphism$fSemigroupEndomorphism$fShowEndomorphismNegInfPosInfInfInfinityFiniteNegPosminimummaximumposInftynegInfty posFinite negFinite $fMonadInf$fApplicativeInf $fMonoidInf $fMonoidInf0$fSemigroupInf$fSemigroupInf0$fOrdInf $fOrdInf0 $fBoundedInf $fBoundedInf0 $fDataInf $fShowInf $fReadInf$fEqInf $fFunctorInf $fFoldableInf$fTraversableInfSM:>:injgetaltMListempty:::*: $fMList(,) $fMList() $f:>:(,)a $f:>:(,)a0 $fActionSM(,) $fActionSM() $fAction(,)l2$fShowSM RecommendCommit getRecommend$fMonoidRecommend$fSemigroupRecommend$fShowRecommend$fReadRecommend$fFunctorRecommend $fEqRecommend$fOrdRecommend$fDataRecommend$fFoldableRecommend$fTraversableRecommendSemiunSemitaginjectuntagembedquotient $fMonoidSemi$fSemigroupSemiSplitM:|splitunsplit$fActionSplitn $fMonoidSplit$fSemigroupSplit $fDataSplit $fShowSplit $fReadSplit $fEqSplit$fFunctorSplit$fFoldableSplit$fTraversableSplitMonoid' $fMonoid'mbaseData.Semigroup<>GHC.BasemappendMCounMCoMonoidControl.CategoryCategoryghc-prim GHC.ClassesOrd Semigroupmaxminmempty