You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Haskell: bitwise_ops regex has a typo (.&&. for .&.), arch_io counts the IO type, decorators ignores pragmas #8904
Three Haskell families disagree with their contracts. Found with a Haskell oracle on pandoc's src/ (5,099 functions matched; args 0.97 / 1.00 and branch 0.93 / 0.99, so the oracle reads functions correctly):
bitwise_ops never matches .&. or .|.. The rule (haskell.py, bitwise_ops) ends ...|\.&&\.|\|\.\|\|\., which matches .&&. and .||., operators that do not exist; the Data.Bits operators are .&. and .|. (a typo of doubled characters).
arch_io counts the type IO in a signature.hs_io :: Int -> IO Int scores arch_io == 1. A type in a signature is not an operation that moves data between the program and the outside; the contract is about the operation ("at its invocation").
decorators is dead:{-# INLINE hs_inl #-} scores 0, although the decorators contract names "an annotation, attribute, pragma or directive line".
A fourth point is a question, not a bug: monadic error raising (throwError, fail, ioError) is not in panics_and_aborts ("a throw or raise ... or process-exit call"); they account for the whole recall gap (0.11) of that family on pandoc.
Reproduce
hs_bits::Int->Int
hs_bits x = x .&.3-- bitwise_ops == 0, should be 1hs_io::Int->IOInt
hs_io x =return x -- arch_io == 1, should be 0 (no I/O operation, only the type)
{-# INLINE hs_inl #-}
hs_inl::Int->Int
hs_inl x = x +1-- struct_decorators == 0, should be 1hs_err::Int->EitherStringInt
hs_err x = throwError "bad"-- state_bailout_hits == 0 (question: is throwError a raise?)
Expected
bitwise_ops matches .&., .|., xor, shiftL/shiftR, complement (fix the typo); arch_io is anchored on an I/O call (readFile, hGetLine, putStrLn, ...) and not on the IO type; decorators counts {-# ... #-} pragmas attached to a binding; the throwError/fail question is answered in #8862.
Part of #8863. Time the change; rosetta:rebless-owed if counts move; add each case above as a test.
Claimed by promoter-bot host melek, lease renewed 2026-11-24T12:53Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.
Closing: the three defects landed in #9111 and the I/O recall gap in #9193. The fourth point (monadic raises in panics_and_aborts: recommend throwError and ioError, not bare fail) is a question for #8862, recorded in #9193.
Activity
fix(haskell): bitwise_ops matches .&. and .|.; io counts operations, …
test(golden): re-bless for Haskell pragmas counted as decorators (Par…
Merge origin/main; re-bless goldens (Part of #8904)
squid-protocol commentedon Nov 23, 2026
This issue's PR content landed via #9111 (merged as fcc440b). It was a 'Part of' change, so the issue stays open for the remaining work.
squid-protocol commentedon Nov 24, 2026
Claimed by promoter-bot host
melek, lease renewed 2026-11-24T12:53Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove theclaim:meleklabel.Haskell io: name hGetLine, putStrLn and the other console/handle call…
squid-protocol commentedon Nov 24, 2026
Closing: the three defects landed in #9111 and the I/O recall gap in #9193. The fourth point (monadic raises in panics_and_aborts: recommend throwError and ioError, not bare fail) is a question for #8862, recorded in #9193.