mirror of
https://github.com/thma/LtuPatternFactory.git
synced 2024-12-03 03:55:08 +03:00
on the way
This commit is contained in:
parent
1acbfc75ff
commit
88edb716c2
@ -30,15 +30,9 @@ storeAndExecute' light command = do
|
||||
logEntry <- liftIO (command light)
|
||||
tell [logEntry]
|
||||
|
||||
{--
|
||||
--storeAndExecute'' :: Light -> (Light -> IO String) -> WriterT[String] IO ()
|
||||
--storeAndExecute'' :: Light -> Cont (WriterT[String] IO ()) Light
|
||||
--storeAndExecute'' :: MonadWriter a m => ContT () (m) String
|
||||
storeAndExecute'' :: Light -> ContT (String) IO Light
|
||||
storeAndExecute'' light = ContT $ \command -> do
|
||||
logEntry <- liftIO ((command light) :: IO String)
|
||||
tell [logEntry]
|
||||
--return ""
|
||||
--}
|
||||
liftIO (command light)
|
||||
|
||||
funA :: String -> Int
|
||||
funA = length
|
||||
@ -60,4 +54,6 @@ commandDemo = do
|
||||
storeAndExecute' lamp flipDownCommand >>
|
||||
storeAndExecute' lamp flipUpCommand
|
||||
putStrLn $ "switch history: " ++ show result
|
||||
r <- runContT (storeAndExecute'' lamp) flipUpCommand
|
||||
print r
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user