FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove `unsafeCoerce` from `Data.constant` by dmjio · Pull Request #73 · arrayfire/arrayfire-haskell · GitHub

Remove unsafeCoerce from Data.constant - #73

Merged
dmjio merged 1 commit into
masterfrom
remove-unsafe-coerce
Jun 20, 2026
Merged

Remove unsafeCoerce from Data.constant#73
dmjio merged 1 commit into
masterfrom
remove-unsafe-coerce

Conversation

dmjio commented Jun 20, 2026

Copy link
Copy Markdown
Member

Replace runtime type-tag dispatch + unsafeCoerce with three direct FFI functions: constant (takes Double, ArrayFire converts internally), constantComplex (preserves imaginary part via af_constant_complex), constantLong / constantULong (64-bit integers without Double rounding).

Add tests covering all four functions including precision boundaries (maxBound/minBound for Int and Word64).

Replace runtime type-tag dispatch + unsafeCoerce with three direct FFI
functions: constant (takes Double, ArrayFire converts internally),
constantComplex (preserves imaginary part via af_constant_complex),
constantLong / constantULong (64-bit integers without Double rounding).

Add tests covering all four functions including precision boundaries
(maxBound/minBound for Int and Word64).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dmjio changed the title Remove unsafeCoerce from Data.constant Remove unsafeCoerce from Data.constant Jun 20, 2026
dmjio merged commit 630d7aa into master Jun 20, 2026
2 checks passed
dmjio deleted the remove-unsafe-coerce branch June 20, 2026 07:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL