diff --git a/byg/src/ComputationM.hs b/byg/src/ComputationM.hs index 947e255..b78ae23 100644 --- a/byg/src/ComputationM.hs +++ b/byg/src/ComputationM.hs @@ -75,6 +75,10 @@ inject x = genDependency (Dependency NoToken (TInject x)) runIO :: (Show a, Show b, IsFIO f a b) => f -> Token t a -> ComputationM TokenNotTraversable b runIO f input = genDependency (Dependency input (FIO f)) +listDirectory = runIO ListDirectory +openImage = runIO OpenImage + + makeTraversable :: Token TokenNotTraversable [a] -> Token TokenTraversable (Token TokenNotTraversable a) makeTraversable (Token n) = Token n diff --git a/byg/src/Main.hs b/byg/src/Main.hs index 5c3d2c5..a69525b 100644 --- a/byg/src/Main.hs +++ b/byg/src/Main.hs @@ -6,9 +6,9 @@ import ComputationM test :: ComputationM TokenNotTraversable () test = do dir <- inject "retter" - dirContents <- runIO ListDirectory dir + dirContents <- listDirectory dir let dirContents' = makeTraversable dirContents - u <- mapM (runIO OpenImage) dirContents' + u <- mapM openImage dirContents' pure $ NoToken main :: IO ()