Skip to content

Refactor containers h includes#1176

Open
RikuMinamiyama wants to merge 2 commits intohaskell:masterfrom
RikuMinamiyama:refactor-containers-h-includes
Open

Refactor containers h includes#1176
RikuMinamiyama wants to merge 2 commits intohaskell:masterfrom
RikuMinamiyama:refactor-containers-h-includes

Conversation

@RikuMinamiyama
Copy link
Contributor

Overview
Removed unnecessary CPP and C header includes.

Correction details

  • C header removal

    The following modules use values defined in containers.h:

    /haskell-containers/containers/src/Data/Graph.hs
    → DEFINE_PATTERN_SYNONYMS, USE_ST_MONAD, USE_UNBOXED_ARRAYS
    
    /haskell-containers/containers/src/Data/Sequence.hs
    → DEFINE_PATTERN_SYNONYMS
    
    /haskell-containers/containers/src/Data/IntSet/Internal.hs
    → WORD_SIZE_IN_BITS
    
    /haskell-containers/containers/src/Data/Map/Internal.hs
    → WORD_SIZE_IN_BITS
    
    /haskell-containers/containers/src/Data/Sequence/Internal.hs
    → DEFINE_PATTERN_SYNONYMS
    
    /haskell-containers/containers-tests/tests/IntSetValidity.hs
    → WORD_SIZE_IN_BITS
    

    Removed #include "containers.h" from all other modules.

  • CPP removal

    Removed CPP language pragmas from files that do not use CPP directives.

Testing

  • cabal build containers succeeds
  • cabal test containers-tests passes all tests
  • cabal bench containers-tests passes all benchmarks

While the changes are straightforward, they affect a wide range of files, so careful review is requested.

Fixes #968

@meooow25
Copy link
Contributor

meooow25 commented Feb 1, 2026

Thanks for the PR, I'm taking a look but I would like to know, were LLMs were involved in this?

@RikuMinamiyama
Copy link
Contributor Author

RikuMinamiyama commented Feb 3, 2026

Thank you for your confirmation.

Regarding containers.h , I searched for values defined in containers.h , such as DEFINE_PATTERN_SYNONYMS , and removed the containers.h include from files where these values were absent. (LLMs were not used)

Regarding C++ pragmas, I first checked each file for the presence of #ifdef and similar directives. (No LLM was used.) Afterward, out of concern, I asked the LLM if there were any places where C++ pragma declarations might have been accidentally left in.

Additionally, when drafting the PR description, I used an LLM to translate from Japanese to English.

If there are any errors or omissions, please provide guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unnecessary CPP and C header in Data.Map.Internal.Debug.html?

2 participants