Copyright | (c) 2012-2015 diagrams-core team (see LICENSE) |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | Safe |
Language | Haskell2010 |
The Cut
monoid transformer introduces "cut points" such that
all values between any two cut points are thrown away. That is,
a b c | d e | f g h i | j k == a b c | j k
Documentation
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.
Functor Cut # | |
Foldable Cut # | |
Traversable Cut # | |
Data m => Data (Cut m) # | |
Read m => Read (Cut m) # | |
Show m => Show (Cut m) # | |
Semigroup m => Semigroup (Cut m) # | If |
(Semigroup m, Monoid m) => Monoid (Cut m) # | |