Skip to content

Commit

Permalink
ToJSONFilter: Remove unnecessary IO instance.
Browse files Browse the repository at this point in the history
This is covered already by the MonadIO instance.
Revises #105.
  • Loading branch information
jgm committed Jan 13, 2023
1 parent 6a571b2 commit 183af9d
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/Text/Pandoc/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ instance (Walkable a Pandoc, MonadIO m) => ToJSONFilter m (a -> m a) where
r <- walkM f (either error id (eitherDecode' c) :: Pandoc)
liftIO (BL.putStr (encode (r :: Pandoc)))

instance (Walkable [a] Pandoc) => ToJSONFilter IO (a -> [a]) where
toJSONFilter f = BL.getContents >>=
BL.putStr . encode . (walk (concatMap f) :: Pandoc -> Pandoc) .
either error id . eitherDecode'

instance (Walkable [a] Pandoc, MonadIO m) => ToJSONFilter m (a -> m [a]) where
toJSONFilter f = do
c <- liftIO BL.getContents
Expand Down

0 comments on commit 183af9d

Please sign in to comment.