mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-16 11:26:08 +00:00
Remove IsString usage; theres no concrete way to do String -> DisplayData
This commit is contained in:
parent
dd7271b2a2
commit
db84a671cb
@ -53,10 +53,10 @@ import Control.Monad (forever, when, unless)
|
||||
import qualified Data.Map as Map
|
||||
import Data.Maybe (fromMaybe)
|
||||
import qualified Data.Text as T
|
||||
import Data.String (IsString(..))
|
||||
|
||||
import IHaskell.IPython.Kernel
|
||||
import IHaskell.IPython.Message.UUID as UUID
|
||||
import IHaskell.IPython.Types
|
||||
|
||||
import System.Directory (createDirectoryIfMissing, doesDirectoryExist, doesFileExist,
|
||||
getHomeDirectory)
|
||||
@ -156,7 +156,7 @@ createReplyHeader parent = do
|
||||
|
||||
-- | Execute an IPython kernel for a config. Your 'main' action should call this as the last thing
|
||||
-- it does.
|
||||
easyKernel :: (MonadIO m, IsString output)
|
||||
easyKernel :: MonadIO m
|
||||
=> FilePath -- ^ The connection file provided by the IPython frontend
|
||||
-> KernelConfig m output result -- ^ The kernel configuration specifying how to react to
|
||||
-- messages
|
||||
@ -174,7 +174,7 @@ easyKernel profileFile config = do
|
||||
reply <- replyTo config execCount zmq req repHeader
|
||||
liftIO $ writeChan shellRepChan reply
|
||||
|
||||
replyTo :: (MonadIO m, IsString output)
|
||||
replyTo :: MonadIO m
|
||||
=> KernelConfig m output result
|
||||
-> MVar Integer
|
||||
-> ZeroMQInterface
|
||||
@ -221,7 +221,7 @@ replyTo config execCount interface req@ExecuteRequest { getCode = code } replyHe
|
||||
return
|
||||
ExecuteReply
|
||||
{ header = replyHeader
|
||||
, pagerOutput = [fromString pagerOut]
|
||||
, pagerOutput = [DisplayData PlainText $ T.pack pagerOut]
|
||||
, executionCounter = fromIntegral counter
|
||||
, status = replyStatus
|
||||
}
|
||||
|
@ -431,9 +431,6 @@ replyType _ = Nothing
|
||||
data DisplayData = DisplayData MimeType Text
|
||||
deriving (Typeable, Generic)
|
||||
|
||||
instance S.IsString DisplayData where
|
||||
fromString = DisplayData PlainText . Text.strip . Text.pack
|
||||
|
||||
-- We can't print the actual data, otherwise this will be printed every time it gets computed
|
||||
-- because of the way the evaluator is structured. See how `displayExpr` is computed.
|
||||
instance Show DisplayData where
|
||||
|
Loading…
x
Reference in New Issue
Block a user