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.

## Instances

Functor Cut # | |

Foldable Cut # | |

Defined in Data.Monoid.Cut fold :: Monoid m => Cut m -> m # foldMap :: Monoid m => (a -> m) -> Cut a -> m # foldr :: (a -> b -> b) -> b -> Cut a -> b # foldr' :: (a -> b -> b) -> b -> Cut a -> b # foldl :: (b -> a -> b) -> b -> Cut a -> b # foldl' :: (b -> a -> b) -> b -> Cut a -> b # foldr1 :: (a -> a -> a) -> Cut a -> a # foldl1 :: (a -> a -> a) -> Cut a -> a # elem :: Eq a => a -> Cut a -> Bool # maximum :: Ord a => Cut a -> a # | |

Traversable Cut # | |

Data m => Data (Cut m) # | |

Defined in Data.Monoid.Cut gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Cut m -> c (Cut m) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Cut m) # dataTypeOf :: Cut m -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Cut m)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Cut m)) # gmapT :: (forall b. Data b => b -> b) -> Cut m -> Cut m # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Cut m -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Cut m -> r # gmapQ :: (forall d. Data d => d -> u) -> Cut m -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Cut m -> u # gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> Cut m -> m0 (Cut m) # gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> Cut m -> m0 (Cut m) # gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> Cut m -> m0 (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) # | |