|
@@ -77,14 +77,14 @@ tres5 = do
|
|
int1 :: IO Progress
|
|
int1 :: IO Progress
|
|
int1 = do
|
|
int1 = do
|
|
let f = (\x y -> return $ x + y) :: Int -> Int -> EitherT () IO Int
|
|
let f = (\x y -> return $ x + y) :: Int -> Int -> EitherT () IO Int
|
|
- r <- intercalateWith resume f [1, 2, 3] (map Right [10, 20])
|
|
|
|
|
|
+ r <- intercalateFold resume f [1, 2, 3] (map Right [10, 20])
|
|
let v = map (fromRight 0) r
|
|
let v = map (fromRight 0) r
|
|
Finished <$> if v == [16, 26] then return Pass else return $ Fail $ "Wrong value: " ++ show v
|
|
Finished <$> if v == [16, 26] then return Pass else return $ Fail $ "Wrong value: " ++ show v
|
|
|
|
|
|
int5 :: IO Progress
|
|
int5 :: IO Progress
|
|
int5 = do
|
|
int5 = do
|
|
let f = (\x y -> return $ x + y) :: Int -> Int -> EitherT () (EitherT () (EitherT () (EitherT () (EitherT () IO)))) Int
|
|
let f = (\x y -> return $ x + y) :: Int -> Int -> EitherT () (EitherT () (EitherT () (EitherT () (EitherT () IO)))) Int
|
|
- r <- intercalateWith resume5 f [1, 2, 3] (map (Right . Right . Right . Right . Right) [10, 20])
|
|
|
|
|
|
+ r <- intercalateFold resume5 f [1, 2, 3] (map (Right . Right . Right . Right . Right) [10, 20])
|
|
let v = map (fromRight 0 . fromRight (Left ()) . fromRight (Left ()) . fromRight (Left ()) . fromRight (Left ())) r
|
|
let v = map (fromRight 0 . fromRight (Left ()) . fromRight (Left ()) . fromRight (Left ()) . fromRight (Left ())) r
|
|
Finished <$> if v == [16, 26] then return Pass else return . Fail $ "Wrong value: " ++ show v
|
|
Finished <$> if v == [16, 26] then return Pass else return . Fail $ "Wrong value: " ++ show v
|
|
|
|
|