aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-07 07:25:08 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-07 07:25:08 +0100
commit64d495b4cfbbeb3fcc72b5b8771874793d8fc6a3 (patch)
tree258b4f4469be1bdb934b76127159b7bded1a3151
parent7a121b63e2bc1e942dd68a7b4976e83fde7d286e (diff)
chore: drop unused type class magic
-rw-r--r--src/Process/Shell.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/Process/Shell.hs b/src/Process/Shell.hs
index 4b26512..06c9dbe 100644
--- a/src/Process/Shell.hs
+++ b/src/Process/Shell.hs
@@ -32,26 +32,23 @@ import Text.Megaparsec
import Text.Megaparsec.Char
import Prelude hiding (exp)
-class Processable a r where
- sh_ :: a -> r
+class Processable r where
+ sh_ :: String -> r
-instance (Processable a r) => Processable (String -> a) (String -> r) where
- sh_ f x = sh_ (f x)
-
-instance (MonadIO m) => Processable String (m ()) where
+instance (MonadIO m) => Processable (m ()) where
sh_ s = do
liftIO (runProcess_ (fromString s))
-instance (MonadIO m, Outputable a) => Processable String (m a) where
+instance (MonadIO m, Outputable a) => Processable (m a) where
sh_ s = do
fromLBS <$> liftIO (readProcessInterleaved_ (fromString s))
-instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable String (m (stdout, stderr)) where
+instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable (m (stdout, stderr)) where
sh_ s = do
(\(out, err) -> (fromLBS out, fromLBS err))
<$> liftIO (readProcess_ (fromString s))
-instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable String (m (ExitCode, stdout, stderr)) where
+instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable (m (ExitCode, stdout, stderr)) where
sh_ s = do
(\(exitCode, out, err) -> (exitCode, fromLBS out, fromLBS err))
<$> liftIO (readProcess (fromString s))