@@ -264,7 +264,7 @@ iFail s = do i <- getIState
264264 s -> liftIO $ putStrLn s
265265 IdeSlave n ->
266266 let good = SexpList [SymbolAtom "error", toSExp s] in
267− liftIO $ putStrLn $ convSExp "return" good n
267+ liftIO . putStrLn $ convSExp "return" good n
268268
269269iputStrLn :: String -> Idris ()
270270iputStrLn s = do i <- getIState
@@ -277,25 +277,31 @@ iputStrLn s = do i <- getIState
277277 ([], msg) -> write
278278 (num, ':':msg) -> iWarn (FC fn (read num)) msg
279279 _ -> write
280− where write = liftIO $ putStrLn $ convSExp "write-string" s n
280+ where write = liftIO . putStrLn $ convSExp "write-string" s n
281+
282+ideslavePutSExp :: SExpable a => String -> a -> Idris ()
283+ideslavePutSExp cmd info = do i <- getIState
284+ case idris_outputmode i of
285+ IdeSlave n -> liftIO . putStrLn $ convSExp cmd info n
286+ _ -> return ()
281287
282288-- this needs some typing magic and more structured output towards emacs
283289iputGoal :: String -> Idris ()
284290iputGoal s = do i <- getIState
285291 case idris_outputmode i of
286292 RawOutput -> liftIO $ putStrLn s
287− IdeSlave n -> liftIO $ putStrLn $ convSExp "write-goal" s n
293+ IdeSlave n -> liftIO . putStrLn $ convSExp "write-goal" s n
288294
289295isetPrompt :: String -> Idris ()
290296isetPrompt p = do i <- getIState
291297 case idris_outputmode i of
292− IdeSlave n -> liftIO $ putStrLn $ convSExp "set-prompt" p n
298+ IdeSlave n -> liftIO . putStrLn $ convSExp "set-prompt" p n
293299
294300iWarn :: FC -> String -> Idris ()
295301iWarn fc err = do i <- getIState
296302 case idris_outputmode i of
297303 RawOutput -> liftIO $ putStrLn (show fc ++ ":" ++ err)
298− IdeSlave n -> liftIO $ putStrLn $ convSExp "warning" (fc_fname fc, fc_line fc, err) n
304+ IdeSlave n -> liftIO . putStrLn $ convSExp "warning" (fc_fname fc, fc_line fc, err) n
299305
300306setLogLevel :: Int -> Idris ()
301307setLogLevel l = do i <- getIState