Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

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.

Instances
Eq Query # 
Instance details

Defined in App.ReplProtocol

Methods

(==) :: Query -> Query -> Bool #

(/=) :: Query -> Query -> Bool #

Show Query # 
Instance details

Defined in App.ReplProtocol

Methods

showsPrec :: Int -> Query -> ShowS #

show :: Query -> String #

showList :: [Query] -> ShowS #

Pretty Query # 
Instance details

Defined in App.ReplProtocol

Serialize.Serialize Query # 
Instance details

Defined in App.ReplProtocol

data Response Source #

Constructors

RSaveFile !(Maybe IO.FilePath)

current save file

RCommand !CmdResult 
RCompletion ![Text]

possible completions for the prefix

Instances
Eq Response # 
Instance details

Defined in App.ReplProtocol

Show Response # 
Instance details

Defined in App.ReplProtocol

Serialize.Serialize Response # 
Instance details

Defined in App.ReplProtocol

data CmdResult Source #

Constructors

CmdResult !Result ![Log.Msg] 
Instances
Eq CmdResult # 
Instance details

Defined in App.ReplProtocol

Show CmdResult # 
Instance details

Defined in App.ReplProtocol

DeepSeq.NFData CmdResult # 
Instance details

Defined in App.ReplProtocol

Methods

rnf :: CmdResult -> () #

Serialize.Serialize CmdResult # 
Instance details

Defined in App.ReplProtocol

data Result Source #

Constructors

Raw !Text

Print this text directly, without formatting it.

Format !Text

Format and print.

Edit !Editor 
Instances
Eq Result # 
Instance details

Defined in App.ReplProtocol

Methods

(==) :: Result -> Result -> Bool #

(/=) :: Result -> Result -> Bool #

Show Result # 
Instance details

Defined in App.ReplProtocol

Serialize.Serialize Result # 
Instance details

Defined in App.ReplProtocol

Return Result # 
Instance details

Defined in Cmd.Repl.Global

data Editor Source #

Open an editor locally.

Constructors

Editor 

Fields

Instances
Eq Editor # 
Instance details

Defined in App.ReplProtocol

Methods

(==) :: Editor -> Editor -> Bool #

(/=) :: Editor -> Editor -> Bool #

Show Editor # 
Instance details

Defined in App.ReplProtocol

Serialize.Serialize Editor # 
Instance details

Defined in App.ReplProtocol

data File Source #

Constructors

FileName !IO.FilePath

open this file

Text !Text

open this text in a temp file

Instances
Eq File # 
Instance details

Defined in App.ReplProtocol

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File # 
Instance details

Defined in App.ReplProtocol

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

Serialize.Serialize File # 
Instance details

Defined in App.ReplProtocol

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.