Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Cmd.Repl.Global

Description

Helper functions to be imported into Cmd.Repl.Environ. Cmd.Repl.Environ must be interpreted since it's the "top level" module, so I put the library of commands in here. An unqualified import in Cmd.Repl.Environ means this module is in scope at the REPL.

Of course, REPL commands can use anything in scope in Cmd.Repl.Environ, not just these helpers. That includes all the various cmd_* functions used by the keybindings and everything in State. Also, keybindings can be invoked directly with the keybinding helper. TODO not implemented

Functions which are not designed to be composed generally take simpler types like strings, or get their block from the current focus, so they're easier to type.

To keep this module from getting huge, only general purpose and common cmds should go here. Cmds which are meant to be used from the REPL but may be more specialized can go in Cmd.Repl.L* modules.

Synopsis

# Documentation

make_id :: Id.Ident a => Text -> Text -> a Source #

Take a string and automatically figure out what kind of ID is expected and add a namespace if one was not already in the string.

Throws an error if the ID has bad characters, which is ok since this is expected to be used from the REPL.

This is used by the REPL's macro feature, to replace xyz with (make_id "current-namespace" "xyz")

Get the current focused block.

Get the track under the selection.

Get the current focused view.

RulerId of the ruler under the selection.

Get the root block.

Create a namespace, and throw an IO exception if it has bad characters. Intended to be used from the REPL, where throwing an IO exception is ok.

($>) :: Functor f => f a -> (a -> b) -> f b infixl 1 Source # Some oprators to more conveniently string together monadic and non-monadic functions in the REPL. For instance:  block >>= LPerf.get_midi_cache$> Midi.Cache.cache_chunks
.> (!!1) .> Midi.Cache.chunk_state .> Perform.state_postproc


(.>) :: (a -> b) -> (b -> c) -> a -> c infixl 9 Source #

The REPL puts haskell in your sequencer, so you can compose while you compose.

Pretty-print the result of a cmd with Pretty.format.

# errors

s :: String -> Cmd.CmdL () Source #

Called from logview

I used to use error_selnum for this, but it could be hard to find. Maybe the normal selection is more convenient, since I can zoom in on it, or move it around to find it.

# show / modify cmd state

Save to the given filename and switch to saving plain states.

Save to the given filename and switch to saving plain states.

Like save_state, but don't change Cmd.state_save_file.

Save to the given git repo and switch to saving incrementally.

# called externally

Called from logview.

Called from logview.

Called from the browser.

class Return a where Source #

The result of a REPL Cmd is converted to a ReplProtocol.Result with this method.

Methods

Instances

 Return () # Methods Show a => Return a # Methods # Methods # Methods # Methods