parent
b4f36f9370
commit
f12ac12ea8
|
@ -15,6 +15,7 @@ data TypedRun a b where
|
||||||
F :: IsF f a b => f -> TypedRun a b
|
F :: IsF f a b => f -> TypedRun a b
|
||||||
FIO :: IsFIO f a b => f -> TypedRun a b
|
FIO :: IsFIO f a b => f -> TypedRun a b
|
||||||
TInject :: b -> TypedRun () b
|
TInject :: b -> TypedRun () b
|
||||||
|
GetListElem :: TypedRun () b
|
||||||
InList :: ComputationM TokenNotTraversable b -> TypedRun [a] [b]
|
InList :: ComputationM TokenNotTraversable b -> TypedRun [a] [b]
|
||||||
|
|
||||||
instance Show (ComputationM t a) where
|
instance Show (ComputationM t a) where
|
||||||
|
@ -69,6 +70,9 @@ genDependency g = do
|
||||||
inject :: Show a => a -> ComputationM ta a
|
inject :: Show a => a -> ComputationM ta a
|
||||||
inject x = genDependency (Dependency NoToken (TInject x))
|
inject x = genDependency (Dependency NoToken (TInject x))
|
||||||
|
|
||||||
|
getListElem :: Show a => ComputationM ta a
|
||||||
|
getListElem = genDependency (Dependency NoToken GetListElem)
|
||||||
|
|
||||||
run :: (Show a, Show b, IsF f a b) => f -> Token t a -> ComputationM TokenNotTraversable b
|
run :: (Show a, Show b, IsF f a b) => f -> Token t a -> ComputationM TokenNotTraversable b
|
||||||
run f input = genDependency (Dependency input (F f))
|
run f input = genDependency (Dependency input (F f))
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
|
import Types
|
||||||
import ComputationM
|
import ComputationM
|
||||||
|
|
||||||
|
testSub :: ComputationM TokenNotTraversable Image
|
||||||
|
testSub = do
|
||||||
|
inp <- getListElem
|
||||||
|
openImage inp
|
||||||
|
|
||||||
test :: ComputationM TokenNotTraversable ()
|
test :: ComputationM TokenNotTraversable ()
|
||||||
test = do
|
test = do
|
||||||
dir <- inject "retter"
|
dir <- inject "retter"
|
||||||
dirContents <- listDirectory dir
|
dirContents <- listDirectory dir
|
||||||
let dirContents' = makeTraversable dirContents
|
u <- mapListTaken testSub dirContents
|
||||||
u <- mapM openImage dirContents'
|
|
||||||
pure $ NoToken
|
pure $ NoToken
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
|
Loading…
Reference in New Issue