ihaskell-0.11.0.0: A Haskell backend kernel for the Jupyter project.
Safe HaskellSafe-Inferred
LanguageHaskell2010

IHaskell.Publish

Synopsis

Documentation

publishResult Source #

Arguments

:: (Message -> IO ())

A function to send messages

-> MessageHeader

Message header to use for reply

-> MVar [Display]

A MVar to use for displays

-> MVar Bool

A mutable boolean to decide whether the output need to be cleared and redrawn

-> MVar [DisplayData]

A MVar to use for storing pager output

-> Bool

Whether to use the pager

-> EvaluationResult

The evaluation result

-> ErrorOccurred

Whether evaluation completed successfully

-> IO () 

Publish evaluation results, ignore any CommMsgs. This function can be used to create a function of type (EvaluationResult -> IO ()), which can be used to publish results to the frontend. The resultant function shares some state between different calls by storing it inside the MVars passed while creating it using this function. Pager output is accumulated in the MVar passed for this purpose if a pager is being used (indicated by an argument), and sent to the frontend otherwise.