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

Safe HaskellNone

IHaskell.Types

Description

 

Synopsis

Documentation

data Message Source

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

header :: MessageHeader
 
versionList :: [Int]

The version of the language, e.g. [7, 6, 3] for GHC 7.6.3

language :: String

The language name, e.g. haskell

ExecuteRequest

A request from a frontend to execute some code.

Fields

header :: MessageHeader
 
getCode :: Text

The entire block of text where the line is. This may be useful in the case of multiline completions where more context may be needed. Note: if in practice this field proves unnecessary, remove it to lighten the messages. json field block

The code string.

getSilent :: Bool

Whether this should be silently executed.

getStoreHistory :: Bool

Whether to store this in history.

getAllowStdin :: Bool

Whether this code can use stdin.

getUserVariables :: [Text]

Unused.

getUserExpressions :: [Text]

Unused.

ExecuteReply

A reply to an execute request.

Fields

header :: MessageHeader
 
status :: ExecuteReplyStatus

The status of the output.

pagerOutput :: String

The help string to show in the pager.

executionCounter :: Int

The execution count, i.e. which output this is.

PublishStatus 

Fields

header :: MessageHeader
 
executionState :: ExecutionState

The execution state of the kernel.

PublishStream 

Fields

header :: MessageHeader
 
streamType :: StreamType

Which stream to publish to.

streamContent :: String

What to publish.

PublishDisplayData 

Fields

header :: MessageHeader
 
source :: String

The name of the data source.

displayData :: [DisplayData]

A list of data representations.

PublishOutput 

Fields

header :: MessageHeader
 
reprText :: String

Printed output text.

executionCount :: Int

Which input this is.

Which output this is for.

PublishInput 

Fields

header :: MessageHeader
 
inCode :: String

Submitted input code.

executionCount :: Int

Which input this is.

Which output this is for.

CompleteRequest 

Fields

header :: MessageHeader
 
getCode :: Text

The entire block of text where the line is. This may be useful in the case of multiline completions where more context may be needed. Note: if in practice this field proves unnecessary, remove it to lighten the messages. json field block

The code string.

getCodeLine :: Text

just the line with the cursor. json field line

getCursorPos :: Int

position of the cursor (index into the line?). json field cursor_pos

CompleteReply 
ObjectInfoRequest 

Fields

header :: MessageHeader
 
objectName :: Text

Name of object which was searched for.

Name of object being searched for.

detailLevel :: Int

Level of detail desired (defaults to 0). 0 is equivalent to foo?, 1 is equivalent to foo??.

ObjectInfoReply 

Fields

header :: MessageHeader
 
objectName :: Text

Name of object which was searched for.

Name of object being searched for.

objectFound :: Bool

Whether the object was found.

objectTypeString :: Text

Object type.

objectDocString :: Text
 
ShutdownRequest 

Fields

header :: MessageHeader
 
restartPending :: Bool

Whether this shutdown precedes a restart.

Whether this shutdown precedes a restart.

ShutdownReply 

Fields

header :: MessageHeader
 
restartPending :: Bool

Whether this shutdown precedes a restart.

Whether this shutdown precedes a restart.

ClearOutput 

Fields

header :: MessageHeader
 
wait :: Bool

Whether to wait to redraw until there is more output.

RequestInput 
InputReply 
CommOpen 
CommData 
CommClose 
SendNothing 

data MessageHeader Source

A message header with some metadata.

Constructors

MessageHeader 

Fields

identifiers :: [ByteString]

The identifiers sent with the message.

parentHeader :: Maybe MessageHeader

The parent header, if present.

metadata :: Metadata

A dict of metadata.

messageId :: UUID

A unique message UUID.

sessionId :: UUID

A unique session UUID.

username :: Username

The user who sent this message.

msgType :: MessageType

The message type.

type Username = TextSource

A username for the source of a message.

type Metadata = Map Text TextSource

A metadata dictionary.

replyType :: MessageType -> Maybe MessageTypeSource

Get the reply message type for a request message type.

data ExecutionState Source

The execution state of the kernel.

Constructors

Busy 
Idle 
Starting 

Instances

Show ExecutionState 
ToJSON ExecutionState

Print an execution state as busy, idle, or starting.

data StreamType Source

Input and output streams.

Constructors

Stdin 
Stdout 

Instances

Show StreamType 
ToJSON StreamType

Print a stream as stdin or stdout strings.

data DisplayData Source

Data for display: a string with associated MIME type.

Constructors

DisplayData MimeType Text 

data EvaluationResult Source

Output of evaluation.

Constructors

IntermediateResult

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

Fields

outputs :: Display

Display outputs.

Display outputs.

FinalResult 

Fields

outputs :: Display

Display outputs.

Display outputs.

pagerOut :: String

Text to display in the IPython pager.

startComms :: [CommInfo]

Comms to start.

data ExecuteReplyStatus Source

Possible statuses in the execution reply messages.

Constructors

Ok 
Err 
Abort 

data InitInfo Source

Initialization information for the kernel.

Constructors

InitInfo 

Fields

extensions :: [String]

Extensions to enable at start.

initCells :: [String]

Code blocks to run before start.

initDir :: String

Which directory this kernel should pretend to operate in.

frontend :: FrontendType

What frontend this serves.

data KernelState Source

All state stored in the kernel between executions.

Instances

data LintStatus Source

Current HLint status.

Constructors

LintOn 
LintOff 

type Width = IntSource

Possible MIME types for the display data.

data Display Source

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

data KernelOpt Source

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

Constructors

KernelOpt 

Fields

getOptionName :: [String]

Ways to set this option via `:option`

getSetName :: [String]

Ways to set this option via `:set`

getUpdateKernelState :: KernelState -> KernelState

Function to update the kernel state.

class IHaskellDisplay a whereSource

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

Methods

display :: a -> IO DisplaySource

Instances

IHaskellDisplay DisplayData 
IHaskellDisplay Display 
IHaskellDisplay Widget 
IHaskellDisplay a => IHaskellDisplay [a] 
IHaskellDisplay a => IHaskellDisplay (IO a)

these instances cause the image, html etc. which look like:

 Display
 [Display]
 IO [Display]
 IO (IO Display)

be run the IO and get rendered (if the frontend allows it) in the pretty form.

class IHaskellDisplay a => IHaskellWidget a whereSource

Display as an interactive widget.

Methods

targetName :: a -> StringSource

Output target name for this widget. The actual input parameter should be ignored.

openSource

Arguments

:: a

Widget to open a comm port with.

-> (Value -> IO ())

Way to respond to the message.

-> IO () 

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

commSource

Arguments

:: a

Widget which is being communicated with.

-> Value

Sent data.

-> (Value -> IO ())

Way to respond to the message.

-> IO () 

Respond to a comm data message.

closeSource

Arguments

:: a

Widget to close comm port with.

-> Value

Sent data.

-> IO () 

Close the comm, releasing any resources we might need to.