-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for creating kernels for IPython frontends -- -- ipython-kernel is a library for communicating with frontends for the -- interactive IPython framework. It is used extensively in IHaskell, the -- interactive Haskell environment. @package ipython-kernel @version 0.10.3.0 -- | Generate, parse, and pretty print UUIDs for use with IPython. module IHaskell.IPython.Message.UUID -- | A UUID (universally unique identifier). data UUID -- | Generate a single random UUID. random :: IO UUID -- | Generate a list of random UUIDs. randoms :: Int -> IO [UUID] uuidToString :: UUID -> String instance GHC.Classes.Ord IHaskell.IPython.Message.UUID.UUID instance GHC.Classes.Eq IHaskell.IPython.Message.UUID.UUID instance GHC.Read.Read IHaskell.IPython.Message.UUID.UUID instance GHC.Show.Show IHaskell.IPython.Message.UUID.UUID instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Message.UUID.UUID instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Message.UUID.UUID -- | This module contains all types used to create an IPython language -- kernel. module IHaskell.IPython.Types -- | A kernel profile, specifying how the kernel communicates. data Profile Profile :: IP -> Transport -> Port -> Port -> Port -> Port -> Port -> ByteString -> Profile -- | The IP on which to listen. [ip] :: Profile -> IP -- | The transport mechanism. [transport] :: Profile -> Transport -- | The stdin channel port. [stdinPort] :: Profile -> Port -- | The control channel port. [controlPort] :: Profile -> Port -- | The heartbeat channel port. [hbPort] :: Profile -> Port -- | The shell command port. [shellPort] :: Profile -> Port -- | The IOPub port. [iopubPort] :: Profile -> Port -- | The HMAC encryption key. [signatureKey] :: Profile -> ByteString -- | The transport mechanism used to communicate with the IPython frontend. data Transport -- | Default transport mechanism via TCP. TCP :: Transport -- | A TCP port. type Port = Int -- | An IP address. type IP = String data KernelSpec KernelSpec :: String -> String -> [String] -> KernelSpec -- | Name shown to users to describe this kernel (e.g. Haskell) [kernelDisplayName] :: KernelSpec -> String -- | Name for the kernel; unique kernel identifier (e.g. "haskell") [kernelLanguage] :: KernelSpec -> 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. [kernelCommand] :: KernelSpec -> [String] -- | A message used to communicate with the IPython frontend. -- -- See -- https://jupyter-client.readthedocs.io/en/stable/messaging.html data Message -- | A request from a frontend for information about the kernel. KernelInfoRequest :: MessageHeader -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | A response to a KernelInfoRequest. KernelInfoReply :: MessageHeader -> String -> String -> String -> String -> LanguageInfo -> ExecuteReplyStatus -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | current protocol version, major and minor [protocolVersion] :: Message -> String -- | Kernel information description e.g. (IHaskell 0.8.3.0 GHC 7.10.2) [banner] :: Message -> String -- | e.g. IHaskell [implementation] :: Message -> String -- | The version of the implementation [implementationVersion] :: Message -> String [languageInfo] :: Message -> LanguageInfo -- | The status of the output. [status] :: Message -> ExecuteReplyStatus -- | A request from a frontend for information about the comms. CommInfoRequest :: MessageHeader -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | A response to a CommInfoRequest. CommInfoReply :: MessageHeader -> Map String String -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | A dictionary of the comms, indexed by uuids. [commInfo] :: Message -> Map String String -- | A request from a frontend to execute some code. ExecuteInput :: MessageHeader -> Text -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code string. [getCode] :: Message -> Text -- | The execution count, i.e. which output this is. [executionCounter] :: Message -> Int -- | A request from a frontend to execute some code. ExecuteRequest :: MessageHeader -> Text -> Bool -> Bool -> Bool -> [Text] -> [Text] -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code string. [getCode] :: Message -> Text -- | Whether this should be silently executed. [getSilent] :: Message -> Bool -- | Whether to store this in history. [getStoreHistory] :: Message -> Bool -- | Whether this code can use stdin. [getAllowStdin] :: Message -> Bool -- | Unused. [getUserVariables] :: Message -> [Text] -- | Unused. [getUserExpressions] :: Message -> [Text] -- | A reply to an execute request. ExecuteReply :: MessageHeader -> ExecuteReplyStatus -> [DisplayData] -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The status of the output. [status] :: Message -> ExecuteReplyStatus -- | The mimebundles to display in the pager. [pagerOutput] :: Message -> [DisplayData] -- | The execution count, i.e. which output this is. [executionCounter] :: Message -> Int -- | A reply to an execute request. ExecuteResult :: MessageHeader -> [DisplayData] -> Map String String -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Key/value pairs (keys are MIME types) [dataResult] :: Message -> [DisplayData] -- | Any metadata that describes the data [metadataResult] :: Message -> Map String String -- | The execution count, i.e. which output this is. [executionCounter] :: Message -> Int -- | An error reply to an execute request ExecuteError :: MessageHeader -> [Text] -> Text -> Text -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [traceback] :: Message -> [Text] [ename] :: Message -> Text [evalue] :: Message -> Text PublishStatus :: MessageHeader -> ExecutionState -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The execution state of the kernel. [executionState] :: Message -> ExecutionState PublishStream :: MessageHeader -> StreamType -> String -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Which stream to publish to. [streamType] :: Message -> StreamType -- | What to publish. [streamContent] :: Message -> String PublishDisplayData :: MessageHeader -> [DisplayData] -> Maybe Transient -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | A list of data representations. [displayData] :: Message -> [DisplayData] [transient] :: Message -> Maybe Transient PublishUpdateDisplayData :: MessageHeader -> [DisplayData] -> Maybe Transient -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | A list of data representations. [displayData] :: Message -> [DisplayData] [transient] :: Message -> Maybe Transient PublishOutput :: MessageHeader -> String -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Printed output text. [reprText] :: Message -> String -- | Which output this is for. [executionCount] :: Message -> Int PublishInput :: MessageHeader -> String -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Submitted input code. [inCode] :: Message -> String -- | Which output this is for. [executionCount] :: Message -> Int Input :: MessageHeader -> Text -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code string. [getCode] :: Message -> Text -- | Which output this is for. [executionCount] :: Message -> Int Output :: MessageHeader -> [DisplayData] -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [getText] :: Message -> [DisplayData] -- | Which output this is for. [executionCount] :: Message -> Int IsCompleteRequest :: MessageHeader -> String -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code entered in the repl. [inputToReview] :: Message -> String IsCompleteReply :: MessageHeader -> CodeReview -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The result of reviewing the code. [reviewResult] :: Message -> CodeReview CompleteRequest :: MessageHeader -> Text -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code string. [getCode] :: Message -> Text -- | Position of the cursor in unicode characters. json field -- cursor_pos [getCursorPos] :: Message -> Int CompleteReply :: MessageHeader -> [Text] -> Int -> Int -> Metadata -> Bool -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [completionMatches] :: Message -> [Text] [completionCursorStart] :: Message -> Int [completionCursorEnd] :: Message -> Int [completionMetadata] :: Message -> Metadata [completionStatus] :: Message -> Bool InspectRequest :: MessageHeader -> Text -> Int -> Int -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | The code context in which introspection is requested [inspectCode] :: Message -> Text -- | Position of the cursor in unicode characters. json field -- cursor_pos [inspectCursorPos] :: Message -> Int -- | Level of detail desired (defaults to 0). 0 is equivalent to foo?, 1 is -- equivalent to foo??. [detailLevel] :: Message -> Int InspectReply :: MessageHeader -> Bool -> [DisplayData] -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | whether the request succeeded or failed [inspectStatus] :: Message -> Bool -- | inspectData can be empty if nothing is found [inspectData] :: Message -> [DisplayData] ShutdownRequest :: MessageHeader -> Bool -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Whether this shutdown precedes a restart. [restartPending] :: Message -> Bool ShutdownReply :: MessageHeader -> Bool -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Whether this shutdown precedes a restart. [restartPending] :: Message -> Bool ClearOutput :: MessageHeader -> Bool -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | Whether to wait to redraw until there is more output. [wait] :: Message -> Bool RequestInput :: MessageHeader -> String -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [inputPrompt] :: Message -> String InputReply :: MessageHeader -> String -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [inputValue] :: Message -> String CommOpen :: MessageHeader -> String -> String -> UUID -> Value -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [commTargetName] :: Message -> String [commTargetModule] :: Message -> String [commUuid] :: Message -> UUID [commData] :: Message -> Value CommData :: MessageHeader -> UUID -> Value -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [commUuid] :: Message -> UUID [commData] :: Message -> Value CommClose :: MessageHeader -> UUID -> Value -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [commUuid] :: Message -> UUID [commData] :: Message -> Value HistoryRequest :: MessageHeader -> Bool -> Bool -> HistoryAccessType -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader -- | If True, also return output history in the resulting dict. [historyGetOutput] :: Message -> Bool -- | If True, return the raw input history, else the transformed input. [historyRaw] :: Message -> Bool -- | What history is being requested. [historyAccessType] :: Message -> HistoryAccessType HistoryReply :: MessageHeader -> [HistoryReplyElement] -> Message -- | Unused field retained for backwards compatibility. [header] :: Message -> MessageHeader [historyReply] :: Message -> [HistoryReplyElement] SendNothing :: Message -- | A message header with some metadata. data MessageHeader MessageHeader :: [ByteString] -> Maybe MessageHeader -> Metadata -> UUID -> UUID -> Username -> MessageType -> [ByteString] -> MessageHeader -- | The identifiers sent with the message. [mhIdentifiers] :: MessageHeader -> [ByteString] -- | The parent header, if present. [mhParentHeader] :: MessageHeader -> Maybe MessageHeader -- | A dict of metadata. [mhMetadata] :: MessageHeader -> Metadata -- | A unique message UUID. [mhMessageId] :: MessageHeader -> UUID -- | A unique session UUID. [mhSessionId] :: MessageHeader -> UUID -- | The user who sent this message. [mhUsername] :: MessageHeader -> Username -- | The message type. [mhMsgType] :: MessageHeader -> MessageType -- | Extra raw data buffer(s) [mhBuffers] :: MessageHeader -> [ByteString] -- | A username for the source of a message. type Username = Text newtype Transient Transient :: UUID -> Transient [transientDisplayId] :: Transient -> UUID -- | The type of a message, corresponding to IPython message types. data MessageType KernelInfoReplyMessage :: MessageType KernelInfoRequestMessage :: MessageType ExecuteInputMessage :: MessageType ExecuteReplyMessage :: MessageType ExecuteErrorMessage :: MessageType ExecuteRequestMessage :: MessageType ExecuteResultMessage :: MessageType StatusMessage :: MessageType StreamMessage :: MessageType DisplayDataMessage :: MessageType UpdateDisplayDataMessage :: MessageType OutputMessage :: MessageType InputMessage :: MessageType IsCompleteRequestMessage :: MessageType IsCompleteReplyMessage :: MessageType CompleteRequestMessage :: MessageType CompleteReplyMessage :: MessageType InspectRequestMessage :: MessageType InspectReplyMessage :: MessageType ShutdownRequestMessage :: MessageType ShutdownReplyMessage :: MessageType ClearOutputMessage :: MessageType InputRequestMessage :: MessageType InputReplyMessage :: MessageType CommOpenMessage :: MessageType CommDataMessage :: MessageType CommInfoRequestMessage :: MessageType CommInfoReplyMessage :: MessageType CommCloseMessage :: MessageType HistoryRequestMessage :: MessageType HistoryReplyMessage :: MessageType data CodeReview CodeComplete :: CodeReview -- | String to be used to indent next line of input CodeIncomplete :: String -> CodeReview CodeInvalid :: CodeReview CodeUnknown :: CodeReview -- | Possible MIME types for the display data. type Width = Int type Height = Int -- | Input and output streams. data StreamType Stdin :: StreamType Stdout :: StreamType Stderr :: StreamType -- | The execution state of the kernel. data ExecutionState Busy :: ExecutionState Idle :: ExecutionState Starting :: ExecutionState -- | Possible statuses in the execution reply messages. data ExecuteReplyStatus Ok :: ExecuteReplyStatus Err :: ExecuteReplyStatus Abort :: ExecuteReplyStatus -- | Ways in which the frontend can request history. TODO: Implement fields -- as described in messaging spec. data HistoryAccessType HistoryRange :: HistoryAccessType HistoryTail :: HistoryAccessType HistorySearch :: HistoryAccessType -- | Reply to history requests. data HistoryReplyElement HistoryReplyElement :: Int -> Int -> Either String (String, String) -> HistoryReplyElement [historyReplySession] :: HistoryReplyElement -> Int [historyReplyLineNumber] :: HistoryReplyElement -> Int [historyReplyContent] :: HistoryReplyElement -> Either String (String, String) -- | Kernel language info, see -- -- data LanguageInfo LanguageInfo :: String -> String -> String -> String -> String -> String -> LanguageInfo -- | The language name, e.g. "haskell" [languageName] :: LanguageInfo -> String -- | GHC 7.6.3 [languageVersion] :: LanguageInfo -> String -- | .hs [languageFileExtension] :: LanguageInfo -> String -- | ihaskell. can be null [languageCodeMirrorMode] :: LanguageInfo -> String [languagePygmentsLexer] :: LanguageInfo -> String [languageMimeType] :: LanguageInfo -> String -- | A metadata dictionary. newtype Metadata Metadata :: Object -> Metadata -- | Get the reply message type for a request message type. replyType :: MessageType -> Maybe MessageType showMessageType :: MessageType -> String -- | Data for display: a string with associated MIME type. data DisplayData DisplayData :: MimeType -> Text -> DisplayData data MimeType PlainText :: MimeType MimeHtml :: MimeType MimeBmp :: Width -> Height -> MimeType MimePng :: Width -> Height -> MimeType MimeJpg :: Width -> Height -> MimeType MimeGif :: Width -> Height -> MimeType MimeSvg :: MimeType MimeLatex :: MimeType MimeMarkdown :: MimeType MimeJavascript :: MimeType MimeJson :: MimeType MimeVega :: MimeType MimeVegalite :: MimeType MimeVdom :: MimeType MimeWidget :: MimeType MimeCustom :: Text -> MimeType extractPlain :: [DisplayData] -> String -- | Convert a MIME type and value into a JSON dictionary pair. displayDataToJson :: DisplayData -> (Key, Value) instance GHC.Read.Read IHaskell.IPython.Types.Transport instance GHC.Show.Show IHaskell.IPython.Types.Transport instance GHC.Read.Read IHaskell.IPython.Types.Profile instance GHC.Show.Show IHaskell.IPython.Types.Profile instance GHC.Show.Show IHaskell.IPython.Types.KernelSpec instance GHC.Classes.Eq IHaskell.IPython.Types.KernelSpec instance GHC.Base.Monoid IHaskell.IPython.Types.Metadata instance GHC.Base.Semigroup IHaskell.IPython.Types.Metadata instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.Metadata instance GHC.Read.Read IHaskell.IPython.Types.Metadata instance GHC.Show.Show IHaskell.IPython.Types.Metadata instance GHC.Classes.Eq IHaskell.IPython.Types.MessageType instance GHC.Read.Read IHaskell.IPython.Types.MessageType instance GHC.Show.Show IHaskell.IPython.Types.MessageType instance GHC.Read.Read IHaskell.IPython.Types.MessageHeader instance GHC.Show.Show IHaskell.IPython.Types.MessageHeader instance GHC.Classes.Eq IHaskell.IPython.Types.LanguageInfo instance GHC.Show.Show IHaskell.IPython.Types.LanguageInfo instance GHC.Show.Show IHaskell.IPython.Types.CodeReview instance GHC.Classes.Eq IHaskell.IPython.Types.Transient instance GHC.Show.Show IHaskell.IPython.Types.Transient instance GHC.Show.Show IHaskell.IPython.Types.HistoryAccessType instance GHC.Classes.Eq IHaskell.IPython.Types.HistoryAccessType instance GHC.Show.Show IHaskell.IPython.Types.HistoryReplyElement instance GHC.Classes.Eq IHaskell.IPython.Types.HistoryReplyElement instance GHC.Show.Show IHaskell.IPython.Types.ExecutionState instance GHC.Show.Show IHaskell.IPython.Types.StreamType instance GHC.Generics.Generic IHaskell.IPython.Types.MimeType instance GHC.Classes.Eq IHaskell.IPython.Types.MimeType instance GHC.Generics.Generic IHaskell.IPython.Types.DisplayData instance GHC.Show.Show IHaskell.IPython.Types.Message instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.Message instance GHC.Show.Show IHaskell.IPython.Types.DisplayData instance Data.Binary.Class.Binary IHaskell.IPython.Types.DisplayData instance Data.Binary.Class.Binary IHaskell.IPython.Types.MimeType instance GHC.Show.Show IHaskell.IPython.Types.MimeType instance GHC.Read.Read IHaskell.IPython.Types.MimeType instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.StreamType instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.StreamType instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.ExecutionState instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.ExecutionState instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.ExecuteReplyStatus instance GHC.Show.Show IHaskell.IPython.Types.ExecuteReplyStatus instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.Transient instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.LanguageInfo instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.MessageHeader instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.MessageType instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.KernelSpec instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.Profile instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.Profile instance Data.Aeson.Types.FromJSON.FromJSON IHaskell.IPython.Types.Transport instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.Types.Transport -- | This module is responsible for converting from low-level ByteStrings -- obtained from the 0MQ sockets into Messages. The only exposed function -- is parseMessage, which should only be used in the low-level 0MQ -- interface. module IHaskell.IPython.Message.Parser parseMessage :: [ByteString] -> ByteString -> ByteString -> ByteString -> ByteString -> [ByteString] -> Message -- | The ZeroMQ module abstracts away the low-level 0MQ based -- interface with IPython, replacing it instead with a Haskell Channel -- based interface. The serveProfile function takes a IPython -- profile specification and returns the channel interface to use. module IHaskell.IPython.ZeroMQ -- | The channel interface to the ZeroMQ sockets. All communication is done -- via Messages, which are encoded and decoded into a lower level form -- before being transmitted to IPython. These channels should -- functionally serve as high-level sockets which speak Messages instead -- of ByteStrings. data ZeroMQInterface Channels :: Chan Message -> Chan Message -> Chan Message -> Chan Message -> Chan Message -> ByteString -> ZeroMQInterface -- | A channel populated with requests from the frontend. [shellRequestChannel] :: ZeroMQInterface -> Chan Message -- | Writing to this channel causes a reply to be sent to the frontend. [shellReplyChannel] :: ZeroMQInterface -> Chan Message -- | This channel is a duplicate of the shell request channel, though using -- a different backend socket. [controlRequestChannel] :: ZeroMQInterface -> Chan Message -- | This channel is a duplicate of the shell reply channel, though using a -- different backend socket. [controlReplyChannel] :: ZeroMQInterface -> Chan Message -- | Writing to this channel sends an iopub message to the frontend. [iopubChannel] :: ZeroMQInterface -> Chan Message -- | Key used to sign messages. [hmacKey] :: ZeroMQInterface -> ByteString data ZeroMQStdin StdinChannel :: Chan Message -> Chan Message -> ZeroMQStdin [stdinRequestChannel] :: ZeroMQStdin -> Chan Message [stdinReplyChannel] :: ZeroMQStdin -> Chan Message -- | Start responding on all ZeroMQ channels used to communicate with -- IPython | via the provided profile. Return a set of channels which can -- be used to | communicate with IPython in a more structured manner. serveProfile :: Profile -> Bool -> IO ZeroMQInterface serveStdin :: Profile -> IO ZeroMQStdin -- | Describes ports used when creating an ephemeral ZeroMQ session. Used -- to generate the ipython JSON config file. data ZeroMQEphemeralPorts -- | Run session for communicating with an IPython instance on ephemerally -- allocated ZMQ4 sockets. The sockets will be closed when the callback -- returns. withEphemeralPorts :: ByteString -> Bool -> (ZeroMQEphemeralPorts -> ZeroMQInterface -> IO a) -> IO a instance Data.Aeson.Types.ToJSON.ToJSON IHaskell.IPython.ZeroMQ.ZeroMQEphemeralPorts -- | This module exports all the types and functions necessary to create an -- IPython language kernel that supports the ipython console and -- ipython notebook frontends. module IHaskell.IPython.Kernel -- | simple IPython kernels. In particular, it provides a record type that -- defines configurations and a function that interprets a configuration -- as an action in some monad that can do IO. -- -- The configuration consists primarily of functions that implement the -- various features of a kernel, such as running code, looking up -- documentation, and performing completion. An example for a simple -- language that nevertheless has side effects, global state, and timing -- effects is included in the examples directory. -- --

Kernel Specs

-- -- To run your kernel, you will need to install the kernelspec into the -- Jupyter namespace. If your kernel name is kernel, you will -- need to run the command: -- --
--   kernel install
--   
-- -- This will inform Jupyter of the kernel so that it may be used. -- --

Further profile improvements Consult the IPython documentation -- along with the generated

-- -- profile source code for further configuration of the frontend, -- including syntax highlighting, logos, help text, and so forth. module IHaskell.IPython.EasyKernel -- | Execute an IPython kernel for a config. Your main action -- should call this as the last thing it does. easyKernel :: MonadIO m => FilePath -> KernelConfig m output result -> m () installKernelspec :: MonadIO m => KernelConfig m output result -> Bool -> Maybe FilePath -> m () -- | The kernel configuration specifies the behavior that is specific to -- your language. The type parameters provide the monad in which your -- kernel will run, the type of intermediate outputs from running cells, -- and the type of final results of cells, respectively. data KernelConfig m output result KernelConfig :: LanguageInfo -> (FilePath -> IO KernelSpec) -> (output -> [DisplayData]) -> (result -> [DisplayData]) -> (Text -> Int -> m (Text, [Text])) -> (Text -> Int -> m (Maybe [DisplayData])) -> (Text -> IO () -> (output -> IO ()) -> m (result, ExecuteReplyStatus, String)) -> Bool -> String -> String -> String -> String -> KernelConfig m output result -- | Info on the language of the kernel. [kernelLanguageInfo] :: KernelConfig m output result -> LanguageInfo -- | Write all the files into the kernel directory, including `kernel.js`, -- `logo-64x64.svg`, and any other required files. The directory to write -- to will be passed to this function, and the return value should be the -- kernelspec to be written to `kernel.json`. [writeKernelspec] :: KernelConfig m output result -> FilePath -> IO KernelSpec -- | How to render intermediate output [displayOutput] :: KernelConfig m output result -> output -> [DisplayData] -- | How to render final cell results [displayResult] :: KernelConfig m output result -> result -> [DisplayData] -- | Perform completion. The returned tuple consists of the matched text -- and completions. The arguments are the code in the cell and the -- position of the cursor in the cell. [completion] :: KernelConfig m output result -> Text -> Int -> m (Text, [Text]) -- | Return the information or documentation for its argument, described by -- the cell contents and cursor position. The returned value is simply -- the data to display. [inspectInfo] :: KernelConfig m output result -> Text -> Int -> m (Maybe [DisplayData]) -- | Execute a cell. The arguments are the contents of the cell, an IO -- action that will clear the current intermediate output, and an IO -- action that will add a new item to the intermediate output. The result -- consists of the actual result, the status to be sent to IPython, and -- the contents of the pager. Return the empty string to indicate that -- there is no pager output. Errors should be handled by defining an -- appropriate error constructor in your result type. [run] :: KernelConfig m output result -> Text -> IO () -> (output -> IO ()) -> m (result, ExecuteReplyStatus, String) -- | Whether to print extra debugging information to | A One-line -- description of the kernel [debug] :: KernelConfig m output result -> Bool [kernelBanner] :: KernelConfig m output result -> String -- | The version of the messaging specification used by the kernel [kernelProtocolVersion] :: KernelConfig m output result -> String -- | Name of the kernel implementation [kernelImplName] :: KernelConfig m output result -> String -- | Version of the kernel implementation [kernelImplVersion] :: KernelConfig m output result -> String