Skip to content

Small updates to standard library#565

Open
Tjalle-S wants to merge 6 commits into
AccelerateHS:masterfrom
Tjalle-S:update-stdlib
Open

Small updates to standard library#565
Tjalle-S wants to merge 6 commits into
AccelerateHS:masterfrom
Tjalle-S:update-stdlib

Conversation

@Tjalle-S
Copy link
Copy Markdown
Contributor

Description
Makes some small additions to the standard library, bringing it more in line with base:

  • Re-export id (occasionally useful) and (~) (previously built-in syntax) from Data.Array.Accelerate.
  • Add join to Data.Array.Accelerate.Control.Monad.
  • Change the Monoid instance for Maybe to require only a Semigroup instance for the element, instead of Monoid.
  • Generalize the Eq instance for (sh :. i) to support non-integer shapes. May be useful in combination with slices.
    Add Eq instances for All and Any sh to support this.

How has this been tested?
No additional tests are required. Most of these changes don't change or introduce implementations. The new join functions is a common utility function, with the same implementation as in base.

Types of changes
What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@Tjalle-S
Copy link
Copy Markdown
Contributor Author

The change making (~) a standard type operator was introduced only in GHC 9.4.1, meaning the build fails with older versions of GHC. If desirable, backward compatibility could be maintained by conditionally importing and exporting this operator.

@tomsmeding
Copy link
Copy Markdown
Member

9.4.1 is still pretty recent, so yes, a conditional would be appropriate I think.

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