Commit db84a671 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Remove IsString usage; theres no concrete way to do String -> DisplayData

parent dd7271b2
...@@ -53,10 +53,10 @@ import Control.Monad (forever, when, unless) ...@@ -53,10 +53,10 @@ import Control.Monad (forever, when, unless)
import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import qualified Data.Text as T import qualified Data.Text as T
import Data.String (IsString(..))
import IHaskell.IPython.Kernel import IHaskell.IPython.Kernel
import IHaskell.IPython.Message.UUID as UUID import IHaskell.IPython.Message.UUID as UUID
import IHaskell.IPython.Types
import System.Directory (createDirectoryIfMissing, doesDirectoryExist, doesFileExist, import System.Directory (createDirectoryIfMissing, doesDirectoryExist, doesFileExist,
getHomeDirectory) getHomeDirectory)
...@@ -156,7 +156,7 @@ createReplyHeader parent = do ...@@ -156,7 +156,7 @@ createReplyHeader parent = do
-- | Execute an IPython kernel for a config. Your 'main' action should call this as the last thing -- | Execute an IPython kernel for a config. Your 'main' action should call this as the last thing
-- it does. -- it does.
easyKernel :: (MonadIO m, IsString output) easyKernel :: MonadIO m
=> FilePath -- ^ The connection file provided by the IPython frontend => FilePath -- ^ The connection file provided by the IPython frontend
-> KernelConfig m output result -- ^ The kernel configuration specifying how to react to -> KernelConfig m output result -- ^ The kernel configuration specifying how to react to
-- messages -- messages
...@@ -174,7 +174,7 @@ easyKernel profileFile config = do ...@@ -174,7 +174,7 @@ easyKernel profileFile config = do
reply <- replyTo config execCount zmq req repHeader reply <- replyTo config execCount zmq req repHeader
liftIO $ writeChan shellRepChan reply liftIO $ writeChan shellRepChan reply
replyTo :: (MonadIO m, IsString output) replyTo :: MonadIO m
=> KernelConfig m output result => KernelConfig m output result
-> MVar Integer -> MVar Integer
-> ZeroMQInterface -> ZeroMQInterface
...@@ -221,7 +221,7 @@ replyTo config execCount interface req@ExecuteRequest { getCode = code } replyHe ...@@ -221,7 +221,7 @@ replyTo config execCount interface req@ExecuteRequest { getCode = code } replyHe
return return
ExecuteReply ExecuteReply
{ header = replyHeader { header = replyHeader
, pagerOutput = [fromString pagerOut] , pagerOutput = [DisplayData PlainText $ T.pack pagerOut]
, executionCounter = fromIntegral counter , executionCounter = fromIntegral counter
, status = replyStatus , status = replyStatus
} }
......
...@@ -431,9 +431,6 @@ replyType _ = Nothing ...@@ -431,9 +431,6 @@ replyType _ = Nothing
data DisplayData = DisplayData MimeType Text data DisplayData = DisplayData MimeType Text
deriving (Typeable, Generic) 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 -- 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. -- because of the way the evaluator is structured. See how `displayExpr` is computed.
instance Show DisplayData where instance Show DisplayData where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment