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

Store configurations for known domains #1405

Merged
merged 1 commit into from
Jun 25, 2020
Merged

Conversation

alex-mckenna
Copy link
Contributor

When loading modules, the domain configurations for all synthesis
domains are extracted into a mapping from domain name to configuration.
This will help remove some KnownDomain constraints later, and help
with issues like #1387.

knownConfs = filter (\x -> "KnownConf" == nameString (FamInstEnv.fi_fam x)) allTCInsts

#if MIN_VERSION_ghc(8,10,0)
fsToText = Text.pack . BS8.unpack . FastString.bytesFS
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fsToText = Text.pack . BS8.unpack . FastString.bytesFS
fsToText = Data.Text.Encoding.decodeUtf8 . FastString.bytesFS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh, nice 👍

#if MIN_VERSION_ghc(8,10,0)
fsToText = Text.pack . BS8.unpack . FastString.bytesFS
#else
fsToText = Text.pack . BS8.unpack . BS.pack . FastString.bytesFS
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
fsToText = Text.pack . BS8.unpack . BS.pack . FastString.bytesFS
fsToText = Data.Text.Encoding.decodeUtf8 . FastString.fastStringToByteString

When loading modules, the domain configurations for all synthesis
domains are extracted into a mapping from domain name to configuration.
This will help remove some KnownDomain constraints later, and help
with issues like #1387.
@alex-mckenna
Copy link
Contributor Author

Approved elsewhere; going ahead with merge

@alex-mckenna alex-mckenna merged commit d015262 into master Jun 25, 2020
@alex-mckenna alex-mckenna deleted the domain-configuration-map branch June 25, 2020 13:41
Comment on lines +511 to +513
asActiveEdge "Rising" = Rising
asActiveEdge "Falling" = Falling
asActiveEdge x = error $ $(curLoc) ++ "Unknown active edge: " ++ show x
Copy link
Member

Choose a reason for hiding this comment

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

read?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No Read instances, and the error from Read is quite obtuse (*** Exception: Prelude.read: no parse)

Copy link
Member

Choose a reason for hiding this comment

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

deriving Read + readMaybe? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You've got me there, I'll make a small PR for it tomorrow 👍

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.

None yet

3 participants