Skip to content

Commit d15f767

Browse files
committed
Make older GHC happy by using traverse_ instead of mapM_ in a doctest
1 parent 8d1fb46 commit d15f767

File tree

1 file changed

+2
-1
lines changed
  • src/Servant/Swagger/Internal

1 file changed

+2
-1
lines changed

src/Servant/Swagger/Internal/Test.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ props _ f px = sequence_ specs
139139
-- (using 'encodePretty').
140140
--
141141
-- >>> import Data.Aeson
142+
-- >>> import Data.Foldable (traverse_)
142143
-- >>> data Person = Person { name :: String, phone :: Integer } deriving (Generic)
143144
-- >>> instance ToJSON Person where toJSON p = object [ "name" .= name p ]
144145
-- >>> instance ToSchema Person
145146
-- >>> let person = Person { name = "John", phone = 123456 }
146-
-- >>> mapM_ putStrLn $ prettyValidateWith validateToJSON person
147+
-- >>> traverse_ putStrLn $ prettyValidateWith validateToJSON person
147148
-- Validation against the schema fails:
148149
-- * property "phone" is required, but not found in "{\"name\":\"John\"}"
149150
-- <BLANKLINE>

0 commit comments

Comments
 (0)