Skip to content

Instantly share code, notes, and snippets.

@sw17ch
Created December 19, 2011 16:47
Show Gist options
  • Save sw17ch/1497923 to your computer and use it in GitHub Desktop.
Save sw17ch/1497923 to your computer and use it in GitHub Desktop.
Sometimes Haskell warnings can be ... complicated.
dist/build/Language/C/Parser/Lexer.hs:522:17:
Warning: Bindings containing unlifted types should use an outermost bang pattern:
(new_s)
= if (offset >=# 0#) && (check ==# ord_c) then
alexIndexInt16OffAddr alex_table offset
else
alexIndexInt16OffAddr alex_deflt s
In the expression:
let
(base) = alexIndexInt32OffAddr alex_base s
((I# (ord_c))) = fromIntegral c
(offset) = (base +# ord_c)
....
in
case new_s of {
-1# -> (new_acc, input)
_ -> alex_scan_tkn
user
orig_input
(if c < 128 || c >= 192 then (len +# 1#) else len)
new_input
new_s
new_acc }
In a case alternative:
Just (c, new_input)
-> let
(base) = alexIndexInt32OffAddr alex_base s
((I# (ord_c))) = fromIntegral c
....
in
case new_s of {
-1# -> (new_acc, input)
_ -> alex_scan_tkn
user
orig_input
(if c < 128 || c >= 192 then (len +# 1#) else len)
new_input
new_s
new_acc }
In the second argument of `seq', namely
`case alexGetByte input of {
Nothing -> (new_acc, input)
Just (c, new_input)
-> let
(base) = ...
....
in
case new_s of {
-1# -> ...
_ -> alex_scan_tkn
user
orig_input
(if c < 128 || c >= 192 then (len +# 1#) else len)
new_input
new_s
new_acc } }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment