tfausak / cabal-gild

:crown: Format Haskell package descriptions.
https://hackage.haskell.org/package/cabal-gild
MIT License
47 stars 5 forks source link

Discern internal modules for the disovery feature #64

Closed nikita-volkov closed 5 months ago

nikita-volkov commented 5 months ago

Problem

The automatic module discovery feature is great, but it does not address the issue of discerning the private vs public modules.

I've found a workaround for this, but it's highly uncommon, hence frustrating, and it complicates navigation.

Suggestions

Marker in the module header

Treat a special marker comment in the headers of Haskell modules as a sign to treat it as an internal module. E.g.:

{- cabal-gild: internal -}
{-# LANGUAGE SomeHaskellExtension #-}
module ModuleName where

Specially treated namespace

If a module namespace contains some trigger word, consider it internal. E.g., if the trigger word is Internal then the following modules will be put under the other-modules section:

I guess this one should be easier to implement.

tfausak commented 5 months ago

I think this is similar to #59.

tfausak commented 5 months ago

I'm going to close this as a duplicate of #59. They're not exactly the same, but I think a solution to that issue should solve your issue here as well.