Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate valid Main.lhs files with cabal init. #5810

Merged
merged 3 commits into from
Jan 24, 2019
Merged

Conversation

hrhino
Copy link
Contributor

@hrhino hrhino commented Dec 20, 2018

Fixes #5577.


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

I have not. Pointers on how to do so are very appreciated!

| isLiterate = "> " ++ line
| otherwise = line
isLiterate = case mainIs flags of
Flag mainPath -> takeExtension mainPath == ".lhs"
Copy link
Contributor Author

@hrhino hrhino Dec 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"lhs" isExtensionOf mainPath

edit: nvm, we need a newer filepath for that.

Copy link
Member

@23Skidoo 23Skidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

mainHs = unlines
-- | Default Main.(l)hs file. Used when no Main.(l)hs exists.
mainHs :: InitFlags -> String
mainHs flags = (unlines . fmap prependPrefix)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use map instead of fmap here.

@23Skidoo 23Skidoo merged commit b4661c4 into haskell:master Jan 24, 2019
@23Skidoo
Copy link
Member

Merged, thanks!

@hrhino
Copy link
Contributor Author

hrhino commented Jan 24, 2019

Thank you! I'll be back...

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.

2 participants