Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

App.ReplProtocol

Contents

Description

Define the protocol between the sequencer's repl port and the repl client.

Synopsis

types

data Query Source #

This is a simple RPC mechanism.

data Response Source #

Constructors

RSaveFile !(Maybe IO.FilePath)

current save file

RCommand !CmdResult 
RCompletion ![Text]

possible completions for the prefix

data Result Source #

Constructors

Raw !Text

Print this text directly, without formatting it.

Format !Text

Format and print.

Edit !Editor 

data Editor Source #

Open an editor locally.

Constructors

Editor 

Fields

data File Source #

Constructors

FileName !IO.FilePath

open this file

Text !Text

open this text in a temp file

Instances

protocol

query_save_file :: PortID -> IO.IO (Maybe (Maybe IO.FilePath)) Source #

Ask for the current save filename. Nothing for an error, and Just Nothing for no save file.

format

format_result :: CmdResult -> Text Source #

Format the response and strip trailing whitespace.