Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Ui.Transform

Description

Functions for larger scale transformations on a State.

Synopsis

Documentation

tracks :: Ui.M m => Id.BlockId -> (Block.TracklikeId -> Block.TracklikeId) -> m () Source #

Transform TracklikeIds.

map IDs

map_state_ids :: (Id.Id -> Id.Id) -> Ui.State -> Either Ui.Error Ui.State Source #

Map a function across the IDs in the given state. Any collisions are thrown in Left.

map_ids :: Ui.M m => (Id.Id -> Id.Id) -> m () Source #

Transform IDs, but don't update view_id pointer map. So only use this when you are sure there are no visible views ("invisible" views occur after they are created but before the sync). This should probably only be used by map_state_ids.

map_view_ids :: Ui.M m => (Id.Id -> Id.Id) -> m () Source #

map_block_ids :: Ui.M m => (Id.Id -> Id.Id) -> m () Source #

Rename a BlockId. Views are updated to point to the new block.

map_track_ids :: Ui.M m => (Id.Id -> Id.Id) -> m () Source #

map_ruler_ids :: Ui.M m => (Id.Id -> Id.Id) -> m () Source #

safe_map_keys :: (Ui.M m, Ord k, Show k) => String -> (k -> k) -> Map k v -> m (Map k v) Source #

namespace

destroy_namespace :: Ui.M m => Id.Namespace -> m () Source #

Destroy all views, blocks, tracks, and rulers with the given namespace.

replace_namespace :: Id.Namespace -> Ui.State -> Ui.State -> Ui.State Source #

Replace the namespace of the second state with the one from the first state.

code

map_code :: (Text -> Text) -> Ui.State -> (Ui.State, [Text]) Source #

Modify tracklang code: block titles, track titles, events.

merge

merge_states :: Ui.State -> Ui.State -> Either Ui.Error Ui.State Source #

Merge ID maps from the states together. Collisions will throw. The Config comes from the first state.

safe_union :: (Ui.M m, Ord k, Show k) => String -> Map k a -> Map k a -> m (Map k a) Source #

intern

intern_text :: Ui.State -> (Ui.State, Map Text Int) Source #

Increase sharing in event text with an intern table.

stats

data Stats Source #

Constructors

Stats 

Fields

Instances

Instances details
Show Stats Source # 
Instance details

Defined in Ui.Transform

Methods

showsPrec :: Int -> Stats -> ShowS #

show :: Stats -> String #

showList :: [Stats] -> ShowS #