From 6962c5cb174f95ab749ef983da1bbc5a0625594b Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Sat, 21 Sep 2024 16:38:37 +0200 Subject: [PATCH] Remove piping attempt --- byg/src/Main.hs | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/byg/src/Main.hs b/byg/src/Main.hs index 5eae78b..b45db29 100644 --- a/byg/src/Main.hs +++ b/byg/src/Main.hs @@ -31,32 +31,6 @@ data FunctionIO a b where deriving instance Show (FunctionIO a b) -data Computation a b where - Pipe :: Computation t u -> Computation u v -> Computation t v - Duplicate :: Computation t (t, t) - PairWith :: Computation t u -> Computation () u1 -> Computation t (u, u1) - TupleComputation :: Computation t0 u0 -> Computation t1 u1 -> Computation (t0, t1) (u0, u1) - -- OnFirst :: Computation t0 u0 -> Computation (t0, t1) (u0, u1) - -- OnSecond :: Computation t1 u1 -> Computation (t0, t1) (u0, u1) - MapComputation :: Computation t u -> Computation [t] [u] - MapUnit :: Computation [()] () - FilterComputation :: Computation t Bool -> Computation [t] [t] - Inject :: t -> Computation () t - Run :: Function t u -> Computation t u - RunIO :: FunctionIO t u -> Computation t u - -handleImages :: Computation () () -handleImages = - Inject "retter" - `Pipe` (RunIO ListDirectory) - `Pipe` FilterComputation (Run IsImageFilename) - `Pipe` MapComputation (Duplicate - `Pipe` (TupleComputation - (PairWith (RunIO OpenImage) (Inject ImageConversion) - `Pipe` RunIO ConvertImage) - (Run ConvertedImageFilename)) - `Pipe` RunIO Save) - `Pipe` MapUnit