-
-
Save sshine/4883017fd5969d5962c1782a562f8818 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype TEST a = TEST { runTEST :: Int -> Double -> Either String (a, String, Double) } | |
instance Monad TEST where | |
m >>= f = TEST $ \i db0 -> do | |
(a,ch,db1) <- runTEST m i db0 | |
(a',ch',db2) <- runTEST (f a) rd db1 | |
return (a',ch ++ ch',db2) | |
instance Monad TEST where | |
m >>= f = TEST $ \i db0 -> | |
runTEST m i db0 >>= \(a,ch,db1) -> | |
runTEST (f a) rd db1 >>= \(a',ch',db2) -> | |
return (a',ch ++ ch',db2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment