-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: Split up Primer.Core
module
#643
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
Conversation
, (baseName tEither, TypeDefAST eitherDef) | ||
] | ||
, moduleDefs = mempty | ||
} |
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.
These two definitions are the only two that strike me as maybe now being in an odd place. Should our hard-wired modules be defined in the same place as the concept of a module?
But I expect we'll end up revisiting these soon enough as part of our prelude / standard library work anyway.
Completely unscientific build time comparison: I will compare this PR's build of Build 1721: This build (1724): (Quick remark that has nothing to do with this particular PR: those Mac build times are on a laptop that I've repurposed as a build machine. Unreal!) |
Here is a higher-quality test: I will build this PR in a I also added I will update this as results roll in. How much speedup vs
|
So pretty good speed-ups from this PR, in the end. But I think the most revealing bits of this benchmarking, for me, are:
|
primer/src/Primer/Core.hs
Outdated
data ValCon = ValCon | ||
{ valConName :: ValConName | ||
, valConArgs :: [Type' ()] | ||
} | ||
deriving (Eq, Show, Data, Generic) | ||
deriving (FromJSON, ToJSON) via PrimerJSON ValCon |
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.
I suspect that ValCon
should move with typedefs
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.
Good catch, moved.
ff67139
to
2b399af
Compare
The original intention here was to be able to put `Primitives.defType` somewhere more sensible. But as a bonus, this _should_ result in better compilation times, particularly incrementally. We also take the opportunity to simplify the definition of `primConName`, now that it is in a module where it can access `tChar` etc.
2b399af
to
8df99e0
Compare
I see no downsides other than the short term pain of this causing conflicts with almost any other ongoing work.
Relevant module subgraph
Before
After