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

SmallUnliftedArray_ has type parameters in the wrong order #43

Closed
Qqwy opened this issue Oct 5, 2024 · 1 comment · Fixed by #44
Closed

SmallUnliftedArray_ has type parameters in the wrong order #43

Qqwy opened this issue Oct 5, 2024 · 1 comment · Fixed by #44

Comments

@Qqwy
Copy link
Contributor

Qqwy commented Oct 5, 2024

Compare

data SmallUnliftedArray_ a unlifted_a
with
data UnliftedArray_ unlifted_a a

The order of the type parameters is reversed.

If we want people to truly use SmallUnliftedArray_ (and SmallMutableUnliftedArray_) when defining class instances, it is important to have the 'element type' be the last parameter, because only then is it possible to implement typeclasses whose inhabitants are of kind Type -> Type (i.e. any container-like typeclass, like the ones of the contiguous library).

@Qqwy
Copy link
Contributor Author

Qqwy commented Oct 5, 2024

It seems like a similar change happend to UnliftedArray itself in version 2.1.0.0

Qqwy added a commit to Qqwy/haskell-primitive-unlifted that referenced this issue Oct 5, 2024
…tedArray

the unboxed parameter should be the first one

Fixes haskell-primitive#43
Qqwy added a commit to Qqwy/haskell-contiguous that referenced this issue Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant