Skip to content

Commit

Permalink
Explicit export lists for Main
Browse files Browse the repository at this point in the history
Lack of explicit export list can degrade performance. The Main module in particular should always have an explicit export list that contains just the main function.
  • Loading branch information
noughtmare authored and Mikolaj committed Nov 30, 2024
1 parent 8144494 commit 7850b6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/Init/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ myLibHs =

myExeHs :: [String]
myExeHs =
[ "module Main where"
[ "module Main (main) where"
, ""
, "main :: IO ()"
, "main = putStrLn \"Hello, Haskell!\""
]

myLibExeHs :: [String]
myLibExeHs =
[ "module Main where"
[ "module Main (main) where"
, ""
, "import qualified MyLib (someFunc)"
, ""
Expand Down

0 comments on commit 7850b6b

Please sign in to comment.