| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
PathSize.Data.SubPathData
Description
Provides SubPathData type.
Since: 0.1
Synopsis
- data SubPathData where
- pattern MkSubPathData :: NESeq PathData -> SubPathData
- mkSubPathData :: Bool -> PathTree -> SubPathData
- takeLargestN :: HasCallStack => Bool -> Positive Int -> PathTree -> SubPathData
- unSubPathData :: SubPathData -> NESeq PathData
- display :: Bool -> SubPathData -> Text
- data NESeq a
Type
data SubPathData where Source #
A flattened and sorted representation of PathTree. Contains at least
one element.
Since: 0.1
Bundled Patterns
| pattern MkSubPathData :: NESeq PathData -> SubPathData | Pattern synonym for Since: 0.1 |
Instances
Construction
mkSubPathData :: Bool -> PathTree -> SubPathData Source #
Creates a SubPathData from a PathTree.
Since: 0.1
takeLargestN :: HasCallStack => Bool -> Positive Int -> PathTree -> SubPathData Source #
Retrieves the largest N paths.
Since: 0.1
Elimination
unSubPathData :: SubPathData -> NESeq PathData Source #
Since: 0.1
Operations
Reexports
data NESeq a infixr 5 Source #
A general-purpose non-empty (by construction) finite sequence type.
Non-emptiness means that:
- Functions that take an
NESeqcan safely operate on it with the assumption that it has at least value. - Functions that return an
NESeqprovide an assurance that the result has at least one value.
Data.Sequence.NonEmpty re-exports the API of Data.Sequence,
faithfully reproducing asymptotics, typeclass constraints, and
semantics. Functions that ensure that input and output maps are both
non-empty (like <|) return NESeq, but
functions that might potentially return an empty map (like
tail) return a Seq instead.
You can directly construct an NESeq with the API from
Data.Sequence.NonEmpty; it's more or less the same as constructing
a normal Seq, except you don't have access to empty. There
are also a few ways to construct an NESeq from a Seq:
- The
nonEmptySeqsmart constructor will convert ainto aSeqa, returningMaybe(NESeqa)Nothingif the originalSeqwas empty. - You can use
:<||,:||>, andinsertSeqAtto insert a value into aSeqto create a guaranteedNESeq. - You can use the
IsNonEmptyandIsEmptypatterns to "pattern match" on aSeqto reveal it as either containing aNESeqor an empty sequence. withNonEmptyoffers a continuation-based interface for deconstructing aSeqand treating it as if it were anNESeq.
You can convert an NESeq into a Seq with toSeq or
IsNonEmpty, essentially "obscuring" the
non-empty property from the type.
Instances
| MonadFix NESeq | |
Defined in Data.Sequence.NonEmpty.Internal | |
| MonadZip NESeq | mzipWith = zipWith munzip = unzip |
| Foldable NESeq |
|
Defined in Data.Sequence.NonEmpty.Internal Methods fold :: Monoid m => NESeq m -> m # foldMap :: Monoid m => (a -> m) -> NESeq a -> m # foldMap' :: Monoid m => (a -> m) -> NESeq a -> m # foldr :: (a -> b -> b) -> b -> NESeq a -> b # foldr' :: (a -> b -> b) -> b -> NESeq a -> b # foldl :: (b -> a -> b) -> b -> NESeq a -> b # foldl' :: (b -> a -> b) -> b -> NESeq a -> b # foldr1 :: (a -> a -> a) -> NESeq a -> a # foldl1 :: (a -> a -> a) -> NESeq a -> a # elem :: Eq a => a -> NESeq a -> Bool # maximum :: Ord a => NESeq a -> a # minimum :: Ord a => NESeq a -> a # | |
| Foldable1 NESeq | |
Defined in Data.Sequence.NonEmpty.Internal Methods fold1 :: Semigroup m => NESeq m -> m # foldMap1 :: Semigroup m => (a -> m) -> NESeq a -> m # foldMap1' :: Semigroup m => (a -> m) -> NESeq a -> m # toNonEmpty :: NESeq a -> NonEmpty a # maximum :: Ord a => NESeq a -> a # minimum :: Ord a => NESeq a -> a # foldrMap1 :: (a -> b) -> (a -> b -> b) -> NESeq a -> b # foldlMap1' :: (a -> b) -> (b -> a -> b) -> NESeq a -> b # foldlMap1 :: (a -> b) -> (b -> a -> b) -> NESeq a -> b # foldrMap1' :: (a -> b) -> (a -> b -> b) -> NESeq a -> b # | |
| Eq1 NESeq | |
| Ord1 NESeq | |
Defined in Data.Sequence.NonEmpty.Internal | |
| Read1 NESeq | |
Defined in Data.Sequence.NonEmpty.Internal | |
| Show1 NESeq | |
| Traversable NESeq | |
| Applicative NESeq | |
| Functor NESeq | |
| Monad NESeq | |
| Comonad NESeq | |
| Invariant NESeq | Since: nonempty-containers-0.3.4.4 |
| Alt NESeq | |
| Apply NESeq | |
| Bind NESeq | |
| Extend NESeq | |
| Traversable1 NESeq | |
| LabelOptic "unSubPathData" A_Getter SubPathData SubPathData (NESeq PathData) (NESeq PathData) Source # | Since: 0.1 |
Defined in PathSize.Data.SubPathData.Internal Methods labelOptic :: Optic A_Getter NoIx SubPathData SubPathData (NESeq PathData) (NESeq PathData) Source # | |
| HasField "unSubPathData" SubPathData (NESeq PathData) Source # | Since: 0.1 |
Defined in PathSize.Data.SubPathData.Internal Methods getField :: SubPathData -> NESeq PathData # | |
| FromJSON a => FromJSON (NESeq a) | |
| ToJSON a => ToJSON (NESeq a) | |
| Data a => Data (NESeq a) | |
Defined in Data.Sequence.NonEmpty.Internal Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NESeq a -> c (NESeq a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NESeq a) # toConstr :: NESeq a -> Constr # dataTypeOf :: NESeq a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NESeq a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NESeq a)) # gmapT :: (forall b. Data b => b -> b) -> NESeq a -> NESeq a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NESeq a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NESeq a -> r # gmapQ :: (forall d. Data d => d -> u) -> NESeq a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NESeq a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NESeq a -> m (NESeq a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NESeq a -> m (NESeq a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NESeq a -> m (NESeq a) # | |
| Semigroup (NESeq a) | |
| Read a => Read (NESeq a) | |
| Show a => Show (NESeq a) | |
| NFData a => NFData (NESeq a) | |
Defined in Data.Sequence.NonEmpty.Internal | |
| Eq a => Eq (NESeq a) | |
| Ord a => Ord (NESeq a) | |
Defined in Data.Sequence.NonEmpty.Internal | |