Skip to content

Instance for TVar #15

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

Open
hvr opened this issue Apr 19, 2016 · 7 comments · May be fixed by #50
Open

Instance for TVar #15

hvr opened this issue Apr 19, 2016 · 7 comments · May be fixed by #50

Comments

@hvr
Copy link
Member

hvr commented Apr 19, 2016

This is a left-over issue from #6

As described in #6 (comment) by @glguy defining an instance for TVar is complicated since we'd lose {-# LANGUAGE Safe #-} by import TVar which seems undesirable, given all other instances can be imported safely.

@phadej
Copy link
Contributor

phadej commented Oct 11, 2016

should the instance live in stm package instead? No safety problem then?

@hvr
Copy link
Member Author

hvr commented Nov 20, 2016

@phadej yeah, the only not-so-nice thing about that is that in stm it'd be an orphan

@treeowl
Copy link
Contributor

treeowl commented Sep 23, 2017

One option would be to add a Trustworthy module to define the rnf function and import it into Control.DeepSeq. But that seems pretty silly! The right answer is surely to add a safe TVar re-export somewhere in base.

@RyanGlScott
Copy link
Member

The right answer is surely to add a safe TVar re-export somewhere in base.

That would be nice. But this needn't stop us from adding an NFData instance for TVar today, since there's a module Control.DeepSeq.BackDoor specifically for the purpose of safely re-exporting things from base that currently can't be imported safely. We'd likely have to perform some surgery on the CPP bounds to accommodate TVar, but it should be possible.

@hvr
Copy link
Member Author

hvr commented Sep 24, 2017

Yeah, this ticket predates the backdoor module by 1 year... so I mostly forgot about this... if anyone wants to take a stab at a PR...? :-)

@TravisWhitaker TravisWhitaker linked a pull request Sep 21, 2019 that will close this issue
@spacekitteh
Copy link

Anyone?

@mixphix
Copy link
Collaborator

mixphix commented Mar 10, 2024

Pull requests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants