ihaskell-0.9.0.3: A Haskell backend kernel for the IPython project.

Safe HaskellNone
LanguageHaskell2010

IHaskell.Types

Description

 

Synopsis

Documentation

data Message :: * #

A message used to communicate with the IPython frontend.

Constructors

KernelInfoRequest

A request from a frontend for information about the kernel.

KernelInfoReply

A response to a KernelInfoRequest.

Fields

CommInfoRequest

A request from a frontend for information about the comms.

CommInfoReply

A response to a CommInfoRequest.

Fields

ExecuteInput

A request from a frontend to execute some code.

Fields

ExecuteRequest

A request from a frontend to execute some code.

Fields

ExecuteReply

A reply to an execute request.

Fields

ExecuteResult

A reply to an execute request.

Fields

ExecuteError

An error reply to an execute request

Fields

PublishStatus 

Fields

PublishStream 

Fields

PublishDisplayData 

Fields

PublishOutput 

Fields

PublishInput 

Fields

Input 

Fields

Output 

Fields

IsCompleteRequest 

Fields

IsCompleteReply 

Fields

CompleteRequest 

Fields

CompleteReply 
InspectRequest 

Fields

InspectReply 

Fields

ShutdownRequest 

Fields

ShutdownReply 

Fields

ClearOutput 

Fields

RequestInput 
InputReply 
CommOpen 
CommData 
CommClose 
HistoryRequest 

Fields

HistoryReply 
SendNothing 

Instances

data MessageHeader :: * #

A message header with some metadata.

Constructors

MessageHeader 

Fields

dupHeader :: MessageHeader -> MessageType -> IO MessageHeader #

Duplicate a message header, giving it a new UUID and message type.

type Username = Text #

A username for the source of a message.

type Metadata = Map Text Text #

A metadata dictionary.

replyType :: MessageType -> Maybe MessageType #

Get the reply message type for a request message type.

data StreamType :: * #

Input and output streams.

Constructors

Stdin 
Stdout 
Stderr 

data MimeType :: * #

Instances

Eq MimeType 
Read MimeType 
Show MimeType 
Generic MimeType 

Associated Types

type Rep MimeType :: * -> * #

Methods

from :: MimeType -> Rep MimeType x #

to :: Rep MimeType x -> MimeType #

Serialize MimeType 
type Rep MimeType 

data DisplayData :: * #

Data for display: a string with associated MIME type.

Constructors

DisplayData MimeType Text 

data EvaluationResult #

Output of evaluation.

Constructors

IntermediateResult

An intermediate result which communicates what has been printed thus far.

Fields

FinalResult 

Fields

data LintStatus #

Current HLint status.

Constructors

LintOn 
LintOff 

type Width = Int #

Possible MIME types for the display data.

type Height = Int #

data Display #

Wrapper for ipython-kernel's DisplayData which allows sending multiple results from the same expression.

data KernelOpt #

Kernel options to be set via `:set` and `:option`.

Constructors

KernelOpt 

Fields

class IHaskellDisplay a where #

A class for displayable Haskell types.

IHaskell's displaying of results behaves as if these two overlapping/undecidable instances also existed:

instance (Show a) => IHaskellDisplay a
instance Show a where shows _ = id

Minimal complete definition

display

Methods

display :: a -> IO Display #

Instances

class IHaskellDisplay a => IHaskellWidget a where #

Display as an interactive widget.

Minimal complete definition

getCommUUID

Methods

targetName :: a -> String #

Target name for this widget. The actual input parameter should be ignored. By default evaluate to "jupyter.widget", which is used by IPython for its backbone widgets.

targetModule :: a -> String #

Target module for this widget. Evaluates to an empty string by default.

getCommUUID :: a -> UUID #

Get the uuid for comm associated with this widget. The widget is responsible for storing the UUID during initialization.

open #

Arguments

:: a

Widget to open a comm port with.

-> (Value -> IO ())

A function for sending messages.

-> IO () 

Called when the comm is opened. Allows additional messages to be sent after comm open.

comm #

Arguments

:: a

Widget which is being communicated with.

-> Value

Data recieved from the frontend.

-> (Value -> IO ())

Way to respond to the message.

-> IO () 

Respond to a comm data message. Called when a message is recieved on the comm associated with the widget.

close #

Arguments

:: a

Widget to close comm port with.

-> Value

Data recieved from the frontend.

-> IO () 

Called when a comm_close is recieved from the frontend.

Instances

IHaskellWidget Widget # 

Methods

targetName :: Widget -> String #

targetModule :: Widget -> String #

getCommUUID :: Widget -> UUID #

open :: Widget -> (Value -> IO ()) -> IO () #

comm :: Widget -> Value -> (Value -> IO ()) -> IO () #

close :: Widget -> Value -> IO () #

data Widget #

Constructors

IHaskellWidget a => Widget a 

Instances

data WidgetMsg #

Send JSON objects with specific formats

Constructors

Open Widget Value

Cause the interpreter to open a new comm, and register the associated widget in the kernelState. Also sends an initial state Value with comm_open.

Update Widget Value

Cause the interpreter to send a comm_msg containing a state update for the widget. Can be used to send fragments of state for update. Also updates the value of widget stored in the kernelState

View Widget

Cause the interpreter to send a comm_msg containing a display command for the frontend.

Close Widget Value

Cause the interpreter to close the comm associated with the widget. Also sends data with comm_close.

Custom Widget Value

A [method .= custom, content = value] message

JSONValue Widget Value

A json object that is sent to the widget without modifications.

DispMsg Widget Display

A display_data message, sent as a [method .= custom] comm_msg

ClrOutput Widget Bool

A clear_output message, sent as a [method .= custom] comm_msg

data KernelSpec :: * #

Constructors

KernelSpec 

Fields

  • kernelDisplayName :: String

    Name shown to users to describe this kernel (e.g. Haskell)

  • kernelLanguage :: String

    Name for the kernel; unique kernel identifier (e.g. "haskell")

  • kernelCommand :: [String]

    Command to run to start the kernel. One of the strings maybe "{connection_file}", which will be replaced by the path to a kernel profile file (see Profile) when the command is run.