Safe Haskell | Safe-Inferred |
---|
Synopsis
- data Stack
- empty :: Stack
- length :: Stack -> Int
- from_outermost :: [Frame] -> Stack
- from_innermost :: [Frame] -> Stack
- block :: Id.BlockId -> Stack
- call :: Text -> Stack
- add :: Frame -> Stack -> Stack
- member :: Frame -> Stack -> Bool
- outermost :: Stack -> [Frame]
- innermost :: Stack -> [Frame]
- block_of :: Frame -> Maybe Id.BlockId
- track_of :: Frame -> Maybe Id.TrackId
- region_of :: Frame -> Maybe (ScoreTime.TrackTime, ScoreTime.TrackTime)
- call_of :: Frame -> Maybe Text
- block_track_of :: Stack -> Maybe (Id.BlockId, Id.TrackId)
- block_tracks_of :: Stack -> [(Id.BlockId, [Id.TrackId])]
- block_track_region_of :: Stack -> Maybe (Id.BlockId, Id.TrackId, (ScoreTime.TrackTime, ScoreTime.TrackTime))
- track_ids_of :: Stack -> [Id.TrackId]
- match :: Pattern -> Stack -> Bool
- data Frame
- type Serial = Int
- format_ui :: Stack -> Doc
- pretty_ui :: Stack -> Text
- pretty_ui_ :: Stack -> Text
- pretty_ui_inner :: Stack -> Maybe Text
- log_ui_frame :: UiFrame -> Text
- track_regions :: Stack -> Id.TrackId -> [Ranges.Ranges ScoreTime.TrackTime]
- type UiFrame = (Maybe Id.BlockId, Maybe Id.TrackId, Maybe (ScoreTime.TrackTime, ScoreTime.TrackTime))
- to_ui :: Stack -> [UiFrame]
- to_ui_innermost :: Stack -> [UiFrame]
- unparse_ui_frame :: UiFrame -> Text
- unparse_ui_frame_ :: UiFrame -> Text
- parse_ui_frame :: String -> Maybe UiFrame
Documentation
The Stack is read in both inner -> outer and outer -> inner order. Since it's always modified at the innermost end, I keep it in inner -> outer order.
I originally used Data.Sequence but it generates more garbage and I couldn't figure out how to stop that from happening.
from_outermost :: [Frame] -> Stack Source #
Construct a Stack from frames starting with the outermost and ending with the innermost.
from_innermost :: [Frame] -> Stack Source #
Construct a Stack from frames starting with the innermost and ending with the outermost.
block :: Id.BlockId -> Stack Source #
Make a Stack with a single block.
outermost :: Stack -> [Frame] Source #
The stack, starting with the outermost call and ending with the innermost. All display should use this order.
innermost :: Stack -> [Frame] Source #
The stack, starting with the innermost call and ending with the outermost.
block_track_of :: Stack -> Maybe (Id.BlockId, Id.TrackId) Source #
Walk up the stack to discover the innermost TrackId, then BlockId.
block_tracks_of :: Stack -> [(Id.BlockId, [Id.TrackId])] Source #
Get each block and the tracks under it, starting from the innermost.
block_track_region_of :: Stack -> Maybe (Id.BlockId, Id.TrackId, (ScoreTime.TrackTime, ScoreTime.TrackTime)) Source #
Walk up the stack to discover the innermost Region, TrackId, then BlockId.
track_ids_of :: Stack -> [Id.TrackId] Source #
Block !Id.BlockId | |
Track !Id.TrackId | |
Region !ScoreTime.TrackTime !ScoreTime.TrackTime | |
Call !Text | |
Serial !Serial |
Instances
pretty_ui_ :: Stack -> Text Source #
log_ui_frame :: UiFrame -> Text Source #
Format a UiFrame for logging. This means it wraps it in {s "..."}
,
which causes logview to make it clickable, which will highlight the stack
location.
more specialized utils
track_regions :: Stack -> Id.TrackId -> [Ranges.Ranges ScoreTime.TrackTime] Source #
Get the Regions associated with a track in a given stack. It's a little tricky because track level calls will go in between the track and the region, e.g. [track, call, call, region].
ui
type UiFrame = (Maybe Id.BlockId, Maybe Id.TrackId, Maybe (ScoreTime.TrackTime, ScoreTime.TrackTime)) Source #
This is an abbreviation of the stack that only has elements that are visible in the UI.
(block_id, track_id, (event_start, event_end))
to_ui_innermost :: Stack -> [UiFrame] Source #
unparse_ui_frame :: UiFrame -> Text Source #
These functions are used by LogView and Cmd.Repl.*, but are here since both places import this module. Examples:
"untitled/b0 untitled/b0.t2 0-.25" "untitled/b0 foo/bar *" "untitled/b0 * *"
unparse_ui_frame_ :: UiFrame -> Text Source #
This is like unparse_ui_frame
except it omits the namespaces for a less
cluttered but potentially ambiguous output.