summaryrefslogtreecommitdiffhomepage
path: root/debug-me.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-13 16:27:45 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-13 16:27:45 -0400
commit26b6b0fbd304f0c14b1d973867037269b1797b91 (patch)
treecf770e4adb9018de256695fdc36e5640b5e705af /debug-me.hs
parentcf9eb1f6d1dd9a5a52a9604bff60dcbb766825fe (diff)
downloaddebug-me-26b6b0fbd304f0c14b1d973867037269b1797b91.tar.gz
squash some warnings
Diffstat (limited to 'debug-me.hs')
-rw-r--r--debug-me.hs17
1 files changed, 8 insertions, 9 deletions
diff --git a/debug-me.hs b/debug-me.hs
index a5115cd..c219360 100644
--- a/debug-me.hs
+++ b/debug-me.hs
@@ -15,7 +15,6 @@ import System.Exit
import qualified Data.ByteString as B
import Data.List.NonEmpty (NonEmpty(..), toList)
import Data.Monoid
-import Debug.Trace
main :: IO ()
main = do
@@ -28,7 +27,7 @@ main = do
ichan <- newTChanIO
ochan <- newTChanIO
dthread <- async (developer ichan ochan)
- uthread <- async (user p ichan ochan ph)
+ uthread <- async (user p ichan ochan)
exitstatus <- waitForProcess ph
cancel dthread
cancel uthread
@@ -108,12 +107,12 @@ sendTtyOutput ochan devstate = go
-- missed one somehow. Ignore it?
_ -> return mempty
-user :: Pty -> TChan (Activity Entered) -> TChan (Activity Seen) -> ProcessHandle -> IO ()
-user p ichan ochan ph = do
+user :: Pty -> TChan (Activity Entered) -> TChan (Activity Seen) -> IO ()
+user p ichan ochan = do
let startact = StartActivity (Seen ">>> debug-me started\r\n") dummySignature
atomically $ writeTChan ochan startact
backlog <- newTVarIO $ Backlog ((hash startact, startact) :| [])
- _ <- sendPtyOutput p ochan backlog ph
+ _ <- sendPtyOutput p ochan backlog
`concurrently` sendPtyInput ichan p backlog
return ()
@@ -122,8 +121,8 @@ data Backlog = Backlog (NonEmpty (HashPointer, Activity Seen))
deriving (Show)
-- | Forward things written to the Pty out the TChan.
-sendPtyOutput :: Pty -> TChan (Activity Seen) -> TVar Backlog -> ProcessHandle -> IO ()
-sendPtyOutput p ochan backlog ph = go
+sendPtyOutput :: Pty -> TChan (Activity Seen) -> TVar Backlog -> IO ()
+sendPtyOutput p ochan backlog = go
where
go = do
b <- readPty p
@@ -153,12 +152,12 @@ sendPtyInput ichan p backlog = go
writeTVar backlog bl'
return (Right (enteredData (activityContent newact)))
else do
- return (Left ("illegal entry", newact, bl'))
+ return (Left ("illegal entry" :: String, newact, bl'))
case mb of
Right b -> do
writePty p b
go
- Left e -> do
+ Left _e -> do
-- print e
go