Safe Haskell | Safe-Inferred |
---|
Functions for larger scale transformations on a State.
Synopsis
- tracks :: Ui.M m => Id.BlockId -> (Block.TracklikeId -> Block.TracklikeId) -> m ()
- map_state_ids :: (Id.Id -> Id.Id) -> Ui.State -> Either Ui.Error Ui.State
- map_ids :: Ui.M m => (Id.Id -> Id.Id) -> m ()
- map_namespace :: Ui.M m => (Id.Namespace -> Id.Namespace) -> m ()
- map_view_ids :: Ui.M m => (Id.Id -> Id.Id) -> m ()
- map_block_ids :: Ui.M m => (Id.Id -> Id.Id) -> m ()
- map_track_ids :: Ui.M m => (Id.Id -> Id.Id) -> m ()
- map_ruler_ids :: Ui.M m => (Id.Id -> Id.Id) -> m ()
- safe_map_keys :: (Ui.M m, Ord k, Show k) => String -> (k -> k) -> Map k v -> m (Map k v)
- destroy_namespace :: Ui.M m => Id.Namespace -> m ()
- replace_namespace :: Id.Namespace -> Ui.State -> Ui.State -> Ui.State
- type UpdateM a = Logger.Logger Text a
- map_code :: (Text -> Text) -> Ui.State -> (Ui.State, [Text])
- merge_states :: Ui.State -> Ui.State -> Either Ui.Error Ui.State
- safe_union :: (Ui.M m, Ord k, Show k) => String -> Map k a -> Map k a -> m (Map k a)
- intern_text :: Ui.State -> (Ui.State, Map Text Int)
- intern_stats :: Map Text Int -> (Memory.Size, Int)
- data Stats = Stats {}
- short_stats :: Ui.State -> Text
- show_stats :: Ui.State -> Text
- stats :: Ui.State -> Stats
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_namespace :: Ui.M m => (Id.Namespace -> Id.Namespace) -> 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.
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
type UpdateM a = Logger.Logger Text a Source #
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.
intern
intern_text :: Ui.State -> (Ui.State, Map Text Int) Source #
Increase sharing in event text with an intern table.
intern_stats :: Map Text Int -> (Memory.Size, Int) Source #
stats
short_stats :: Ui.State -> Text Source #
show_stats :: Ui.State -> Text Source #