diff --git a/byg/src/ComputationM.hs b/byg/src/ComputationM.hs index c564dd2..c766481 100644 --- a/byg/src/ComputationM.hs +++ b/byg/src/ComputationM.hs @@ -75,8 +75,8 @@ genDependency g = do inject :: Show a => a -> ComputationM ta a inject x = genDependency (Dependency NoToken (TInject x)) -runIO :: (Show a, Show b) => FunctionIO a b -> Token t a -> ComputationM TokenNotTraversable b -runIO f input = genDependency (Dependency input (FIO f)) +runIO :: (Show a, Show b, IsFIO f a b) => f -> Token t a -> ComputationM TokenNotTraversable b +runIO f input = genDependency (Dependency input (FIO' f)) makeTraversable :: Token TokenNotTraversable [a] -> Token TokenTraversable (Token TokenNotTraversable a) makeTraversable (Token n) = Token n diff --git a/byg/src/Functions.hs b/byg/src/Functions.hs index d9de92e..a959be6 100644 --- a/byg/src/Functions.hs +++ b/byg/src/Functions.hs @@ -34,3 +34,8 @@ data ListDirectory' = ListDirectory' deriving (Show) instance IsFIO ListDirectory' FilePath [FilePath] where runFIO ListDirectory' path = undefined + +data OpenImage' = OpenImage' + deriving (Show) +instance IsFIO OpenImage' FilePath Image where + runFIO OpenImage' path = undefined diff --git a/byg/src/Main.hs b/byg/src/Main.hs index 5c3d2c5..ea4c757 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 <- runIO ListDirectory' dir let dirContents' = makeTraversable dirContents - u <- mapM (runIO OpenImage) dirContents' + u <- mapM (runIO OpenImage') dirContents' pure $ NoToken main :: IO ()