git.iko.soy/lynxjs-elm/compiler
on master help sign in
update to build with GHC 9.4.*
0421dfbEvan Czaplicki
compiler/src/Data/Name.hs+4−4
@@ -241,7 +241,7 @@ fromTypeVariable name@(Utf8.Utf8 ba#) index =
241 else
241 else
242 let
242 let
243 len# = sizeofByteArray# ba#
243 len# = sizeofByteArray# ba#
244− end# = indexWord8Array# ba# (len# -# 1#)
244+ end# = word8ToWord# (indexWord8Array# ba# (len# -# 1#))
245 in
245 in
246 if isTrue# (leWord# 0x30## end#) && isTrue# (leWord# end# 0x39##) then
246 if isTrue# (leWord# 0x30## end#) && isTrue# (leWord# end# 0x39##) then
247 runST
247 runST
@@ -316,11 +316,11 @@ fromManyNames names =
316 ST $ \s ->
316 ST $ \s ->
317 case newByteArray# (len# +# 3#) s of
317 case newByteArray# (len# +# 3#) s of
318 (# s, mba# #) ->
318 (# s, mba# #) ->
319− case writeWord8Array# mba# 0# 0x5F## {-_-} s of
319+ case writeWord8Array# mba# 0# (wordToWord8# 0x5F##) {-_-} s of
320 s ->
320 s ->
321− case writeWord8Array# mba# 1# 0x4D## {-M-} s of
321+ case writeWord8Array# mba# 1# (wordToWord8# 0x4D##) {-M-} s of
322 s ->
322 s ->
323− case writeWord8Array# mba# 2# 0x24## {-$-} s of
323+ case writeWord8Array# mba# 2# (wordToWord8# 0x24##) {-$-} s of
324 s ->
324 s ->
325 case copyByteArray# ba# 0# mba# 3# len# s of
325 case copyByteArray# ba# 0# mba# 3# len# s of
326 s ->
326 s ->
compiler/src/Data/Utf8.hs+14−14
@@ -109,10 +109,10 @@ contains (W8# word#) (Utf8 ba#) =
109 containsHelp word# ba# 0# (sizeofByteArray# ba#)
109 containsHelp word# ba# 0# (sizeofByteArray# ba#)
110
110
111
111
112−containsHelp :: Word# -> ByteArray# -> Int# -> Int# -> Bool
112+containsHelp :: Word8# -> ByteArray# -> Int# -> Int# -> Bool
113containsHelp word# ba# !offset# len# =
113containsHelp word# ba# !offset# len# =
114 if isTrue# (offset# <# len#) then
114 if isTrue# (offset# <# len#) then
115− if isTrue# (eqWord# word# (indexWord8Array# ba# offset#))
115+ if isTrue# (eqWord8# word# (indexWord8Array# ba# offset#))
116 then True
116 then True
117 else containsHelp word# ba# (offset# +# 1#) len#
117 else containsHelp word# ba# (offset# +# 1#) len#
118 else
118 else
@@ -145,7 +145,7 @@ startsWithChar isGood bytes@(Utf8 ba#) =
145 False
145 False
146 else
146 else
147 let
147 let
148− !w# = indexWord8Array# ba# 0#
148+ !w# = word8ToWord# (indexWord8Array# ba# 0#)
149 !char
149 !char
150 | isTrue# (ltWord# w# 0xC0##) = C# (chr# (word2Int# w#))
150 | isTrue# (ltWord# w# 0xC0##) = C# (chr# (word2Int# w#))
151 | isTrue# (ltWord# w# 0xE0##) = chr2 ba# 0# w#
151 | isTrue# (ltWord# w# 0xE0##) = chr2 ba# 0# w#
@@ -164,7 +164,7 @@ endsWithWord8 (W8# w#) (Utf8 ba#) =
164 let len# = sizeofByteArray# ba# in
164 let len# = sizeofByteArray# ba# in
165 isTrue# (len# ># 0#)
165 isTrue# (len# ># 0#)
166 &&
166 &&
167− isTrue# (eqWord# w# (indexWord8Array# ba# (len# -# 1#)))
167+ isTrue# (eqWord8# w# (indexWord8Array# ba# (len# -# 1#)))
168
168
169
169
170
170
@@ -186,11 +186,11 @@ splitHelp str start offsets =
186 unsafeSlice str start offset : splitHelp str (offset + 1) offsets
186 unsafeSlice str start offset : splitHelp str (offset + 1) offsets
187
187
188
188
189−findDividers :: Word# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
189+findDividers :: Word8# -> ByteArray# -> Int# -> Int# -> [Int] -> [Int]
190findDividers divider# ba# !offset# len# revOffsets =
190findDividers divider# ba# !offset# len# revOffsets =
191 if isTrue# (offset# <# len#) then
191 if isTrue# (offset# <# len#) then
192 findDividers divider# ba# (offset# +# 1#) len# $
192 findDividers divider# ba# (offset# +# 1#) len# $
193− if isTrue# (eqWord# divider# (indexWord8Array# ba# offset#))
193+ if isTrue# (eqWord8# divider# (indexWord8Array# ba# offset#))
194 then I# offset# : revOffsets
194 then I# offset# : revOffsets
195 else revOffsets
195 else revOffsets
196 else
196 else
@@ -353,7 +353,7 @@ toCharsHelp ba# offset# len# =
353 []
353 []
354 else
354 else
355 let
355 let
356− !w# = indexWord8Array# ba# offset#
356+ !w# = word8ToWord# (indexWord8Array# ba# offset#)
357 !(# char, width# #)
357 !(# char, width# #)
358 | isTrue# (ltWord# w# 0xC0##) = (# C# (chr# (word2Int# w#)), 1# #)
358 | isTrue# (ltWord# w# 0xC0##) = (# C# (chr# (word2Int# w#)), 1# #)
359 | isTrue# (ltWord# w# 0xE0##) = (# chr2 ba# offset# w#, 2# #)
359 | isTrue# (ltWord# w# 0xE0##) = (# chr2 ba# offset# w#, 2# #)
@@ -370,7 +370,7 @@ chr2 :: ByteArray# -> Int# -> Word# -> Char
370chr2 ba# offset# firstWord# =
370chr2 ba# offset# firstWord# =
371 let
371 let
372 !i1# = word2Int# firstWord#
372 !i1# = word2Int# firstWord#
373− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
373+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
374 !c1# = uncheckedIShiftL# (i1# -# 0xC0#) 6#
374 !c1# = uncheckedIShiftL# (i1# -# 0xC0#) 6#
375 !c2# = i2# -# 0x80#
375 !c2# = i2# -# 0x80#
376 in
376 in
@@ -382,8 +382,8 @@ chr3 :: ByteArray# -> Int# -> Word# -> Char
382chr3 ba# offset# firstWord# =
382chr3 ba# offset# firstWord# =
383 let
383 let
384 !i1# = word2Int# firstWord#
384 !i1# = word2Int# firstWord#
385− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
385+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
386− !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
386+ !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
387 !c1# = uncheckedIShiftL# (i1# -# 0xE0#) 12#
387 !c1# = uncheckedIShiftL# (i1# -# 0xE0#) 12#
388 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 6#
388 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 6#
389 !c3# = i3# -# 0x80#
389 !c3# = i3# -# 0x80#
@@ -396,9 +396,9 @@ chr4 :: ByteArray# -> Int# -> Word# -> Char
396chr4 ba# offset# firstWord# =
396chr4 ba# offset# firstWord# =
397 let
397 let
398 !i1# = word2Int# firstWord#
398 !i1# = word2Int# firstWord#
399− !i2# = word2Int# (indexWord8Array# ba# (offset# +# 1#))
399+ !i2# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 1#)))
400− !i3# = word2Int# (indexWord8Array# ba# (offset# +# 2#))
400+ !i3# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 2#)))
401− !i4# = word2Int# (indexWord8Array# ba# (offset# +# 3#))
401+ !i4# = word2Int# (word8ToWord# (indexWord8Array# ba# (offset# +# 3#)))
402 !c1# = uncheckedIShiftL# (i1# -# 0xF0#) 18#
402 !c1# = uncheckedIShiftL# (i1# -# 0xF0#) 18#
403 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 12#
403 !c2# = uncheckedIShiftL# (i2# -# 0x80#) 12#
404 !c3# = uncheckedIShiftL# (i3# -# 0x80#) 6#
404 !c3# = uncheckedIShiftL# (i3# -# 0x80#) 6#
@@ -473,7 +473,7 @@ toEscapedBuilderHelp before after !name@(Utf8 ba#) k =
473escape :: Word8 -> Word8 -> Ptr a -> Utf8 t -> Int -> Int -> Int -> IO ()
473escape :: Word8 -> Word8 -> Ptr a -> Utf8 t -> Int -> Int -> Int -> IO ()
474escape before@(W8# before#) after ptr name@(Utf8 ba#) offset@(I# offset#) len@(I# len#) i@(I# i#) =
474escape before@(W8# before#) after ptr name@(Utf8 ba#) offset@(I# offset#) len@(I# len#) i@(I# i#) =
475 if isTrue# (i# <# len#) then
475 if isTrue# (i# <# len#) then
476− if isTrue# (eqWord# before# (indexWord8Array# ba# (offset# +# i#)))
476+ if isTrue# (eqWord8# before# (indexWord8Array# ba# (offset# +# i#)))
477 then
477 then
478 do writeWordToPtr ptr i after
478 do writeWordToPtr ptr i after
479 escape before after ptr name offset len (i + 1)
479 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
21import qualified Data.Set as Set
21import qualified Data.Set as Set
22import Data.Word (Word8)
22import Data.Word (Word8)
23import Foreign.Ptr (Ptr, plusPtr)
23import 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#)
25import GHC.Word (Word8(W8#))
25import GHC.Word (Word8(W8#))
26
26
27import qualified AST.Source as Src
27import qualified AST.Source as Src
@@ -384,4 +384,4 @@ chr4 pos firstWord =
384
384
385unpack :: Word8 -> Int#
385unpack :: Word8 -> Int#
386unpack (W8# word#) =
386unpack (W8# word#) =
387− word2Int# word#
387+ word2Int# (word8ToWord# word#)
elm.cabal+18−21
@@ -35,9 +35,6 @@ Flag dev {
35
35
36
36
37Executable elm
37Executable elm
38− if flag(dev)
39− ghc-options: -O0 -Wall -Werror
40− else
41 ghc-options: -O2 -rtsopts -threaded "-with-rtsopts=-N -qg -A128m"
38 ghc-options: -O2 -rtsopts -threaded "-with-rtsopts=-N -qg -A128m"
42 -- add -eventlog for (elm make src/Main.elm +RTS -l; threadscope elm.eventlog)
39 -- add -eventlog for (elm make src/Main.elm +RTS -l; threadscope elm.eventlog)
43 -- https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/
40 -- https://www.oreilly.com/library/view/parallel-and-concurrent/9781449335939/
@@ -203,26 +200,26 @@ Executable elm
203 Paths_elm
200 Paths_elm
204
201
205 Build-depends:
202 Build-depends:
206− ansi-terminal >= 0.8 && < 0.9,
203+ ansi-terminal,
207− ansi-wl-pprint >= 0.6.8 && < 0.7,
204+ ansi-wl-pprint < 1,
208− base >=4.11 && <5,
205+ base,
209− binary >= 0.8 && < 0.9,
206+ binary,
210− bytestring >= 0.9 && < 0.11,
207+ bytestring,
211− containers >= 0.5.8.2 && < 0.6,
208+ containers,
212− directory >= 1.2.3.0 && < 2.0,
209+ directory,
213− edit-distance >= 0.2 && < 0.3,
210+ edit-distance,
214 file-embed,
211 file-embed,
215 filelock,
212 filelock,
216− filepath >= 1 && < 2.0,
213+ filepath,
217− ghc-prim >= 0.5.2,
214+ ghc-prim,
218 haskeline,
215 haskeline,
219− HTTP >= 4000.2.5 && < 4000.4,
216+ HTTP,
220− http-client >= 0.6 && < 0.7,
217+ http-client,
221− http-client-tls >= 0.3 && < 0.4,
218+ http-client-tls,
222− http-types >= 0.12 && < 1.0,
219+ http-types,
223− language-glsl >= 0.3,
220+ language-glsl,
224− mtl >= 2.2.1 && < 3,
221+ mtl,
225− network >= 2.4 && < 2.7,
222+ network,
226 parsec,
223 parsec,
227 process,
224 process,
228 raw-strings-qq,
225 raw-strings-qq,
@@ -231,7 +228,7 @@ Executable elm
231 snap-core,
228 snap-core,
232 snap-server,
229 snap-server,
233 template-haskell,
230 template-haskell,
234− time >= 1.9.1,
231+ time,
235 unordered-containers,
232 unordered-containers,
236 utf8-string,
233 utf8-string,
237 vector,
234 vector,