A value of type Cut m is either a single m, or a pair of
m'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. Split keeps only the
rightmost split and combines everything on the left; Cut keeps
the outermost splits and throws away everything in between.
Instances8Functor, Foldable, Traversable, Data, Read, Show, …
Functor CutDefined in monoid-extras-0.6.2 · Data.Monoid.CutFoldable CutDefined in monoid-extras-0.6.2 · Data.Monoid.CutTraversable CutDefined in monoid-extras-0.6.2 · Data.Monoid.CutData m => Data (Cut m)Defined in monoid-extras-0.6.2 · Data.Monoid.CutRead m => Read (Cut m)Defined in monoid-extras-0.6.2 · Data.Monoid.CutShow m => Show (Cut m)Defined in monoid-extras-0.6.2 · Data.Monoid.CutSemigroup m => Semigroup (Cut m)Defined in monoid-extras-0.6.2 · Data.Monoid.CutIf
mis aSemigroup, thenCut mis a semigroup which containsmas a sub-semigroup, but also contains elements of the formm1 :||: m2. When elements ofmcombine with such "cut" elements they are combined with the value on the corresponding side of the cut (e.g.(Uncut m1) <> (m1' :||: m2) = (m1 <> m1') :||: m2). When two "cut" elements meet, the two inside values are thrown away and only the outside values are kept.(Semigroup m, Monoid m) => Monoid (Cut m)Defined in monoid-extras-0.6.2 · Data.Monoid.Cut