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

Unlifted API #38

Open
treeowl opened this issue Mar 23, 2023 · 3 comments
Open

Unlifted API #38

treeowl opened this issue Mar 23, 2023 · 3 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Mar 23, 2023

I'm thinking we might want an additional API for unlifted types that aren't viewed as unboxed versions of boxed types. This would have functions like

newMutVar :: forall m (a :: UnliftedType) PrimMonad m => a -> m (MutVar (PrimState m) a)
readMutVar :: forall m (a :: UnliftedType) PrimMonad m => MutVar (PrimState m) a -> m (Box a)
writeMutVar :: forall m (a :: UnliftedType) PrimMonad m => MutVar (PrimState m) a -> a -> m ()
@andrewthad
Copy link
Collaborator

Oh, this is nice. I like the Box trick to make readMutVar work.

@treeowl
Copy link
Contributor Author

treeowl commented Mar 23, 2023

What should the modules be called?

@treeowl
Copy link
Contributor Author

treeowl commented Mar 23, 2023

And how should the functions be named?

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

No branches or pull requests

2 participants