Clean unused dependencies from Map + use a more defined Monad for the Box Chunks instance, hoping we will be able to clear the whole stack someday and stop requiring that RoContext type, unboxing and reboxing the FontSet for no good

This commit is contained in:
Tissevert 2020-03-14 16:27:56 +01:00
parent f2a99e1fd2
commit a9d3e5d326

View file

@ -16,7 +16,7 @@ import Control.Monad.Fail (MonadFail(..))
import Control.Monad.Reader (MonadReader(..), ReaderT, asks, runReaderT)
import Control.Monad.State (MonadState(..), StateT, evalStateT)
import Data.Map ((!))
import qualified Data.Map as Map (empty, fromList, singleton)
import qualified Data.Map as Map (empty, singleton)
import Data.Text (Text, breakOn)
import qualified Data.Text as Text (drop)
import PDF.Box (Box(..))
@ -46,7 +46,7 @@ decodeString input = do
data Chunks = Chunks
instance (MonadReader FontSet m, MonadFail m) => Box m Chunks Content (Indexed Text) where
instance MonadFail m => Box (ReaderT FontSet m) Chunks Content (Indexed Text) where
r Chunks content = do
fontSet <- ask
renderText fontSet content