-
Notifications
You must be signed in to change notification settings - Fork 3
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
Empty modules #55
Empty modules #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing! Left some 🎨 comments; nothing blocking.
I merged master and confirmed the original issue is resolved. Can you double-check that the merge was clean?
src/ConcatModule.hs
Outdated
T.concat | ||
[ "/* START: " | ||
, fnName | ||
, " */" | ||
, if all isSpace $ T.unpack body | ||
then " console.warn(\"" <> T.pack filePath <> | ||
": is an empty module!\");" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎨 A module being empty might not be a runtime concern, but a compile-time concern.
src/ConcatModule.hs
Outdated
wrapper config (Dependency {filePath}, ds) = do | ||
let Config {tempDir} = config | ||
withContent :: | ||
Config -> (Dependency, [Dependency]) -> IO (FilePath, [Dependency], T.Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎨 (FilePath, [Dependency], T.Text)
could be a named type like
data Module = Module
{ filePath :: FilePath
, dependencies :: [Dependency]
, content :: T.Text
}
-- and perhaps rename withContent
readModule :: Config -> (Dependency, [Dependency]) -> IO Module
-- and perhaps rename wrapDependency
compileModule :: Module -> T.Text
426b0b4
to
c90e2c5
Compare
closes #19
output looks like this: