@@ -25,11 +25,11 @@ caseCountScalars = do
26 yamlString = "foo:\n baz: [bin1, bin2, bin3]\nbaz: bazval"
26 yamlString = "foo:\n baz: [bin1, bin2, bin3]\nbaz: bazval"
27 yamlBS = B8.pack yamlString
27 yamlBS = B8.pack yamlString
28− fold (s, l, m) (EventScalar {}) = Right (s + 1, l, m)
28+ fold (s, l, m) (EventScalar {}) = return $ More (s + 1, l, m)
29− fold (s, l, m) EventSequenceStart = Right (s, l + 1, m)
29+ fold (s, l, m) EventSequenceStart = return $ More (s, l + 1, m)
30− fold (s, l, m) EventMappingStart = Right (s, l, m + 1)
30+ fold (s, l, m) EventMappingStart = return $ More (s, l, m + 1)
31− fold res EventNone = Left res
31+ fold res EventNone = return $ Done res
32− fold res _ = Right res
32+ fold res _ = return $ More res
33 accum = (0, 0, 0) :: (Int, Int, Int)
33 accum = (0, 0, 0) :: (Int, Int, Int)
35caseLargestString :: Assertion
35caseLargestString :: Assertion
@@ -43,10 +43,10 @@ caseLargestString = do
43 let s' = B8.unpack bs
43 let s' = B8.unpack bs
44 i' = length s'
44 i' = length s'
45 in if i' > i
45 in if i' > i
46− then Right (i', s')
46+ then return $ More (i', s')
47− else Right (i, s)
47+ else return $ More (i, s)
48− fold res EventNone = Left res
48+ fold res EventNone = return $ Done res
49− fold res _ = Right res
49+ fold res _ = return $ More res
50 accum = (0, "no strings found")
50 accum = (0, "no strings found")
52toIO :: Exception l => IO (Either l r) -> IO r
52toIO :: Exception l => IO (Either l r) -> IO r
@@ -63,8 +63,8 @@ caseEncodeDecode = do
64 yamlString = "foo: bar\nbaz:\n - bin1\n - bin2\n"
64 yamlString = "foo: bar\nbaz:\n - bin1\n - bin2\n"
65 yamlBS = B8.pack yamlString
65 yamlBS = B8.pack yamlString
66− fold x EventNone = Left x
66+ fold x EventNone = return $ Done x
67− fold x e = Right $ x . (:) e
67+ fold x e = return $ More $ x . (:) e
68 unfold (x:xs) = Just (x, xs)
68 unfold (x:xs) = Just (x, xs)
69 unfold [] = Nothing
69 unfold [] = Nothing
@@ -79,8 +79,8 @@ caseEncodeDecodeFile = do
80 filePath = "test/largest-string.yaml"
80 filePath = "test/largest-string.yaml"
81 tmpPath = "tmp.yaml"
81 tmpPath = "tmp.yaml"
82− fold x EventNone = Left x
82+ fold x EventNone = return $ Done x
83− fold x e = Right $ x . (:) e
83+ fold x e = return $ More $ x . (:) e
84 unfold (x:xs) = Just (x, xs)
84 unfold (x:xs) = Just (x, xs)
85 unfold [] = Nothing
85 unfold [] = Nothing