git.iko.soy/lynxjs-elm/compiler
on master help sign in
update to build with GHC 9.4.*
commit0421dfbe48e53d880a401e201890eac0b3de5f06 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 27 Sep 2023, 16:55 (3 years ago) parent047d502
4 files changed+38−41
compiler/src/Data/Name.hs+4−4 compiler/src/Data/Utf8.hs+14−14 compiler/src/Parse/Variable.hs+2−2 elm.cabal+18−21
compiler/src/Data/Name.hs+4−4
@@ -241,7 +241,7 @@ fromTypeVariable name@(Utf8.Utf8 ba#) index =
241241 else
242242 let
243243 len# = sizeofByteArray# ba#
244− end# = indexWord8Array# ba# (len# -# 1#)
244+ end# = word8ToWord# (indexWord8Array# ba# (len# -# 1#))
245245 in
246246 if isTrue# (leWord# 0x30## end#) && isTrue# (leWord# end# 0x39##) then
247247 runST
@@ -316,11 +316,11 @@ fromManyNames names =
316316 ST $ \s ->
317317 case newByteArray# (len# +# 3#) s of
318318 (# s, mba# #) ->
319− case writeWord8Array# mba# 0# 0x5F## {-_-} s of
319+ case writeWord8Array# mba# 0# (wordToWord8# 0x5F##) {-_-} s of
320320 s ->
321− case writeWord8Array# mba# 1# 0x4D## {-M-} s of
321+ case writeWord8Array# mba# 1# (wordToWord8# 0x4D##) {-M-} s of
322322 s ->
323− case writeWord8Array# mba# 2# 0x24## {-$-} s of
323+ case writeWord8Array# mba# 2# (wordToWord8# 0x24##) {-$-} s of
324324 s ->
325325 case copyByteArray# ba# 0# mba# 3# len# s of
326326 s ->
compiler/src/Data/Utf8.hs+14−14
@@ -109,10 +109,10 @@ contains (W8# word#) (Utf8 ba#) =
109109 containsHelp word# ba# 0# (sizeofByteArray# ba#)
110110
111111
112−containsHelp :: Word# -> ByteArray# -> Int# -> Int# -> Bool
112+containsHelp :: Word8# -> ByteArray# -> Int# -> Int# -> Bool
113113containsHelp word# ba# !offset# len# =
114114 if isTrue# (offset# <# len#) then
115− if isTrue# (eqWord# word# (indexWord8Array# ba# offset#))
115+ if isTrue# (eqWord8# word# (indexWord8Array# ba# offset#))
116116 then True
117117 else containsHelp word# ba# (offset# +# 1#) len#
118118 else
@@ -145,7 +145,7 @@ startsWithChar isGood bytes@(Utf8 ba#) =
145145 False
146146 else
147147 let
148− !w# = indexWord8Array# ba# 0#
148+ !w# = word8ToWord# (indexWord8Array# ba# 0#)
149149 !char
150150 | isTrue# (ltWord# w# 0xC0##) = C# (chr# (word2Int# w#))
151151 | isTrue# (ltWord# w# 0xE0##) = chr2 ba# 0# w#
@@ -164,7 +164,7 @@ endsWithWord8 (W8# w#) (Utf8 ba#) =
164164 let len# = sizeofByteArray# ba# in
165165 isTrue# (len# ># 0#)
166166 &&
167− isTrue# (eqWord# w# (indexWord8Array# ba# (len# -# 1#)))
167+ isTrue# (eqWord8# w# (indexWord8Array# ba# (len# -# 1#)))
168168
169169
170170
@@ -186,11 +186,11 @@ splitHelp str start offsets =
186186 unsafeSlice str start offset : splitHelp str (offset + 1) offsets
187187
188188
189−findDividers :: Word# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
189+findDividers :: Word8# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
190190findDividers divider# ba# !offset# len# revOffsets =
191191 if isTrue# (offset# <# len#) then
192192 findDividers divider# ba# (offset# +# 1#) len# $
193− if isTrue# (eqWord# divider# (indexWord8Array# ba# offset#))
193+ if isTrue# (eqWord8# divider# (indexWord8Array# ba# offset#))
194194 then I# offset# : revOffsets
195195 else revOffsets
196196 else
@@ -353,7 +353,7 @@ toCharsHelp ba# offset# len# =
353353 []
354354 else
355355 let
356− !w# = indexWord8Array# ba# offset#
356+ !w# = word8ToWord# (indexWord8Array# ba# offset#)
357357 !(# char, width# #)
358358 | isTrue# (ltWord# w# 0xC0##) = (# C# (chr# (word2Int# w#)), 1# #)
359359 | isTrue# (ltWord# w# 0xE0##) = (# chr2 ba# offset# w#, 2# #)
@@ -370,7 +370,7 @@ chr2 :: ByteArray# -> Int# -> Word# -> Char
370370chr2 ba# offset# firstWord# =
371371 let
372372 !i1# = word2Int# firstWord#
373− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
373+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
374374 !c1# = uncheckedIShiftL# (i1# -# 0xC0#) 6#
375375 !c2# = i2# -# 0x80#
376376 in
@@ -382,8 +382,8 @@ chr3 :: ByteArray# -> Int# -> Word# -> Char
382382chr3 ba# offset# firstWord# =
383383 let
384384 !i1# = word2Int# firstWord#
385− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
386− !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
385+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
386+ !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
387387 !c1# = uncheckedIShiftL# (i1# -# 0xE0#) 12#
388388 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 6#
389389 !c3# = i3# -# 0x80#
@@ -396,9 +396,9 @@ chr4 :: ByteArray# -> Int# -> Word# -> Char
396396chr4 ba# offset# firstWord# =
397397 let
398398 !i1# = word2Int# firstWord#
399− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
400− !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
401− !i4# = word2Int# (indexWord8Array# ba# (offset# +# 3#))
399+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
400+ !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
401+ !i4# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 3#)))
402402 !c1# = uncheckedIShiftL# (i1# -# 0xF0#) 18#
403403 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 12#
404404 !c3# = uncheckedIShiftL# (i3# -# 0x80#) 6#
@@ -473,7 +473,7 @@ toEscapedBuilderHelp before after !name@(Utf8 ba#) k =
473473escape :: Word8 -> Word8 -> Ptr a -> Utf8 t -> Int -> Int -> Int -> IO ()
474474escape before@(W8# before#) after ptr name@(Utf8 ba#) offset@(I# offset#) len@(I# len#) i@(I# i#) =
475475 if isTrue# (i# <# len#) then
476− if isTrue# (eqWord# before# (indexWord8Array# ba# (offset# +# i#)))
476+ if isTrue# (eqWord8# before# (indexWord8Array# ba# (offset# +# i#)))
477477 then
478478 do writeWordToPtr ptr i after
479479 escape before after ptr name offset len (i + 1)
compiler/src/Parse/Variable.hs+2−2
@@ -21,7 +21,7 @@ import qualified Data.Name as Name
2121import qualified Data.Set as Set
2222import Data.Word (Word8)
2323import Foreign.Ptr (Ptr, plusPtr)
24−import GHC.Exts (Char(C#), Int#, (+#), (-#), chr#, uncheckedIShiftL#, word2Int#)
24+import GHC.Exts (Char(C#), Int#, (+#), (-#), chr#, uncheckedIShiftL#, word2Int#, word8ToWord#)
2525import GHC.Word (Word8(W8#))
2626
2727import qualified AST.Source as Src
@@ -384,4 +384,4 @@ chr4 pos firstWord =
384384
385385unpack :: Word8 -> Int#
386386unpack (W8# word#) =
387− word2Int# word#
387+ word2Int# (word8ToWord# word#)
elm.cabal+18−21
@@ -35,9 +35,6 @@ Flag dev {
3535
3636
3737Executable elm
38− if flag(dev)
39− ghc-options: -O0 -Wall -Werror
40− else
4138 ghc-options: -O2 -rtsopts -threaded "-with-rtsopts=-N -qg -A128m"
4239 -- add -eventlog for (elm make src/Main.elm +RTS -l; threadscope elm.eventlog)
4340 -- https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/
@@ -203,26 +200,26 @@ Executable elm
203200 Paths_elm
204201
205202 Build-depends:
206− ansi-terminal >= 0.8 && < 0.9,
207− ansi-wl-pprint >= 0.6.8 && < 0.7,
208− base >=4.11 && <5,
209− binary >= 0.8 && < 0.9,
210− bytestring >= 0.9 && < 0.11,
211− containers >= 0.5.8.2 && < 0.6,
212− directory >= 1.2.3.0 && < 2.0,
213− edit-distance >= 0.2 && < 0.3,
203+ ansi-terminal,
204+ ansi-wl-pprint < 1,
205+ base,
206+ binary,
207+ bytestring,
208+ containers,
209+ directory,
210+ edit-distance,
214211 file-embed,
215212 filelock,
216− filepath >= 1 && < 2.0,
217− ghc-prim >= 0.5.2,
213+ filepath,
214+ ghc-prim,
218215 haskeline,
219− HTTP >= 4000.2.5 && < 4000.4,
220− http-client >= 0.6 && < 0.7,
221− http-client-tls >= 0.3 && < 0.4,
222− http-types >= 0.12 && < 1.0,
223− language-glsl >= 0.3,
224− mtl >= 2.2.1 && < 3,
225− network >= 2.4 && < 2.7,
216+ HTTP,
217+ http-client,
218+ http-client-tls,
219+ http-types,
220+ language-glsl,
221+ mtl,
222+ network,
226223 parsec,
227224 process,
228225 raw-strings-qq,
@@ -231,7 +228,7 @@ Executable elm
231228 snap-core,
232229 snap-server,
233230 template-haskell,
234− time >= 1.9.1,
231+ time,
235232 unordered-containers,
236233 utf8-string,
237234 vector,