@@ -60,7 +60,7 @@ iWarn fc err =
60 do maybeSource <- readSource fc
60 do maybeSource <- readSource fc
61 let maybeFormattedSource = (maybeSource >>= layoutSource fc)
61 let maybeFormattedSource = (maybeSource >>= layoutSource fc)
62 err' <- iRender . fmap (fancifyAnnots i True) $
62 err' <- iRender . fmap (fancifyAnnots i True) $
63− layoutWarning (layoutFC fc) (fmap string maybeFormattedSource) err
63+ layoutWarning (layoutFC fc) maybeFormattedSource err
64 hWriteDoc h i err'
64 hWriteDoc h i err'
65 IdeMode n h ->
65 IdeMode n h ->
66 do err' <- iRender . fmap (fancifyAnnots i True) $ err
66 do err' <- iRender . fmap (fancifyAnnots i True) $ err
@@ -80,10 +80,10 @@ iWarn fc err =
80 Right v -> pure (Just v)
80 Right v -> pure (Just v)
81 readSource _ = pure Nothing
81 readSource _ = pure Nothing
83− layoutSource :: FC -> String -> Maybe String
83+ layoutSource :: FC -> String -> Maybe OutputDoc
84 layoutSource (FC fn (si, sj) (ei, ej)) src =
84 layoutSource (FC fn (si, sj) (ei, ej)) src =
85 if isJust sourceLine
85 if isJust sourceLine
86− then Just (top ++ "\n" ++ formattedLine ++ "\n" ++ bottom)
86+ then Just . string $ top ++ "\n" ++ formattedLine ++ "\n" ++ bottom
87 else Nothing
87 else Nothing
89 sourceLine = listToMaybe . drop (si - 1) . lines $ src
89 sourceLine = listToMaybe . drop (si - 1) . lines $ src