Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Seqn.Internal.MTree
Description
This is an internal module. You probably don't need to import this. Use Data.Seqn.MSeq instead.
WARNING
Definitions in this module allow violating invariants that would otherwise be guaranteed by Data.Seqn.MSeq. Use at your own risk!
Synopsis
- class Semigroup (Measure a) => Measured a where
- data MTree a
- singleton :: Measured a => a -> MTree a
- size :: MTree a -> Int
- (<>>) :: Measured a => MTree a -> Measure a -> Measure a
- (<<>) :: Measured a => Measure a -> MTree a -> Measure a
- bin :: Measured a => a -> MTree a -> MTree a -> MTree a
- binn :: Measured a => Int -> a -> MTree a -> MTree a -> MTree a
- foldMap :: forall a m. Monoid m => (a -> m) -> MTree a -> m
- foldl' :: (b -> a -> b) -> b -> MTree a -> b
- foldr' :: (a -> b -> b) -> b -> MTree a -> b
- ifoldl' :: (Int -> b -> a -> b) -> b -> Int -> MTree a -> b
- ifoldr' :: (Int -> a -> b -> b) -> b -> Int -> MTree a -> b
- traverse :: (Measured b, Applicative f) => (a -> f b) -> MTree a -> f (MTree b)
- ifoldMap :: Monoid m => (Int -> a -> m) -> Int -> MTree a -> m
- itraverse :: (Measured b, Applicative f) => (Int -> a -> f b) -> Int -> MTree a -> f (MTree b)
- generateA :: (Measured a, Applicative f) => (Int -> f a) -> Int -> Int -> f (MTree a)
- index :: Int -> MTree a -> a
- adjustF :: (Measured a, Functor f) => (a -> f a) -> Int -> MTree a -> f (MTree a)
- insertAt :: Measured a => Int -> a -> MTree a -> MTree a
- deleteAt :: Measured a => Int -> MTree a -> MTree a
- cons :: Measured a => a -> MTree a -> MTree a
- snoc :: Measured a => MTree a -> a -> MTree a
- uncons :: Measured a => MTree a -> SMaybe (S2 a (MTree a))
- unconsSure :: Measured a => a -> MTree a -> MTree a -> S2 a (MTree a)
- unsnoc :: Measured a => MTree a -> SMaybe (S2 (MTree a) a)
- unsnocSure :: Measured a => a -> MTree a -> MTree a -> S2 (MTree a) a
- splitAtF :: (Measured a, Biapplicative f) => Int -> MTree a -> f (MTree a) (S2 a (MTree a))
- mapMaybeA :: (Applicative f, Measured b) => (a -> f (Maybe b)) -> MTree a -> f (MTree b)
- mapEitherA :: (Applicative f, Measured b, Measured c) => (a -> f (Either b c)) -> MTree a -> f (S2 (MTree b) (MTree c))
- liftRnf2 :: (Measure a -> ()) -> (a -> ()) -> MTree a -> ()
- zipWithStreamM :: (Measured c, Monad m) => (a -> b -> m c) -> MTree a -> Stream b -> m (MTree c)
- unzipWithA :: (Measured b, Measured c, Applicative f) => (a -> f (b, c)) -> MTree a -> f (S2 (MTree b) (MTree c))
- unzipWith3A :: (Measured b, Measured c, Measured d, Applicative f) => (a -> f (b, c, d)) -> MTree a -> f (S3 (MTree b) (MTree c) (MTree d))
- fold :: b -> (Int -> a -> b -> b -> b) -> (Int -> a -> b -> b) -> (Int -> a -> b -> b) -> (a -> b) -> MTree a -> b
- foldSimple :: b -> (Int -> a -> b -> b -> b) -> MTree a -> b
- link :: Measured a => a -> MTree a -> MTree a -> MTree a
- merge :: Measured a => MTree a -> MTree a -> MTree a
- glue :: Measured a => MTree a -> MTree a -> MTree a
- balanceL :: Measured a => a -> MTree a -> MTree a -> MTree a
- balanceR :: Measured a => a -> MTree a -> MTree a -> MTree a
- valid :: (Measured a, Eq (Measure a)) => MTree a -> Bool
- debugShowsPrec :: (Show a, Show (Measure a)) => Int -> MTree a -> ShowS
Measured
class Semigroup (Measure a) => Measured a where Source #
Types that have a combinable property, called the measure.
MTree
Basic
Folds
itraverse :: (Measured b, Applicative f) => (Int -> a -> f b) -> Int -> MTree a -> f (MTree b) Source #
Construct
Index
Slice
splitAtF :: (Measured a, Biapplicative f) => Int -> MTree a -> f (MTree a) (S2 a (MTree a)) Source #
Transform
mapEitherA :: (Applicative f, Measured b, Measured c) => (a -> f (Either b c)) -> MTree a -> f (S2 (MTree b) (MTree c)) Source #
Force
Zip and unzip
zipWithStreamM :: (Measured c, Monad m) => (a -> b -> m c) -> MTree a -> Stream b -> m (MTree c) Source #
unzipWithA :: (Measured b, Measured c, Applicative f) => (a -> f (b, c)) -> MTree a -> f (S2 (MTree b) (MTree c)) Source #
unzipWith3A :: (Measured b, Measured c, Measured d, Applicative f) => (a -> f (b, c, d)) -> MTree a -> f (S3 (MTree b) (MTree c) (MTree d)) Source #
Tree helpers
fold :: b -> (Int -> a -> b -> b -> b) -> (Int -> a -> b -> b) -> (Int -> a -> b -> b) -> (a -> b) -> MTree a -> b Source #
foldSimple :: b -> (Int -> a -> b -> b -> b) -> MTree a -> b Source #