on master help sign in
Update code rendering to start with a ByteString
5b0204dEvan Czaplicki
compiler/src/Reporting/Render/Code.hs+4−2
@@ -10,6 +10,8 @@ module Reporting.Render.Code
10 where
10 where
11
11
12
12
13+import qualified Data.ByteString as B
14+import qualified Data.ByteString.UTF8 as UTF8_BS
13import qualified Data.List as List
15import qualified Data.List as List
14import Data.Word (Word16)
16import Data.Word (Word16)
15
17
@@ -26,10 +28,10 @@ newtype Source =
26 Source [(Word16, String)]
28 Source [(Word16, String)]
27
29
28
30
29−toSource :: String -> Source
31+toSource :: B.ByteString -> Source
30toSource source =
32toSource source =
31 Source $ zip [1..] $
33 Source $ zip [1..] $
32− lines source ++ [""]
34+ lines (UTF8_BS.toString source) ++ [""]
33
35
34
36
35
37