Skip to content

Add instance Ix for Unsigned and Signed. - #1481

Merged
alex-mckenna merged 2 commits into
clash-lang:masterfrom
gergoerdi:ix
Aug 20, 2020
Merged

Add instance Ix for Unsigned and Signed.#1481
alex-mckenna merged 2 commits into
clash-lang:masterfrom
gergoerdi:ix

Conversation

@gergoerdi

Copy link
Copy Markdown
Contributor

This allows using Signed n and Unsigned n as Data.Array indices,
for example in test benches that simulate memory.

@martijnbastiaan martijnbastiaan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@alex-mckenna

Copy link
Copy Markdown
Contributor

Not to nitpick, but as you're not defining any of the GHC-specific unsafe Ix functions, would you also mind changing from GHC.Arr to Data.Ix?

@gergoerdi

Copy link
Copy Markdown
Contributor Author

Not to nitpick, but as you're not defining any of the GHC-specific unsafe Ix functions, would you also mind changing from GHC.Arr to Data.Ix?

That's fair, I'll do that. But hopefully we'll get indexError back... https://gitlab.haskell.org/ghc/ghc/-/issues/18579

@gergoerdi

Copy link
Copy Markdown
Contributor Author

Not to nitpick, but as you're not defining any of the GHC-specific unsafe Ix functions, would you also mind changing from GHC.Arr to Data.Ix?

I've done this just now.

@martijnbastiaan

Copy link
Copy Markdown
Member

Cool! I think we can merge it after a CHANGELOG entry.

@gergoerdi

Copy link
Copy Markdown
Contributor Author

Cool! I think we can merge it after a CHANGELOG entry.

But the git log shows that CHANGELOG is updated after-the-fact, at release time, not in individual commits.

@martijnbastiaan

Copy link
Copy Markdown
Member

That's true, but we keep each entry as a file so we can easily backport / update the changelog later. See:

This allows using `Signed n` and `Unsigned n` as `Data.Array` indices,
for example in test benches that simulate memory.
@gergoerdi

Copy link
Copy Markdown
Contributor Author

That's true, but we keep each entry as a file so we can easily backport / update the changelog later.

The friction is real...

@alex-mckenna
alex-mckenna merged commit 455f63f into clash-lang:master Aug 20, 2020
@martijnbastiaan

Copy link
Copy Markdown
Member

The friction is real...

ikr..

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.

3 participants