# Reference Counting with Linear Types

**URL:** <https://discourse.haskell.org/t/reference-counting-with-linear-types/9535>\
**Category:** Show and Tell\
**Created:** [May 12, 2024, 12:32am UTC](https://discourse.haskell.org/t/reference-counting-with-linear-types/9535 "2024-05-12T00:32:38Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![atravers](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@atravers](https://discourse.haskell.org/u/atravers)\
**Post date:** [June 11, 2024, 6:32pm UTC](https://discourse.haskell.org/t/reference-counting-with-linear-types/9535/19 "2024-06-11T18:32:16Z")

</div>

But if the use of `Counter` could be considered _“pure from the outside”_ then `IO a` isn’t needed - `ST s a` and `runST` would be enough. Also see:

> [@Using unsafePerformIO safely?](http://discourse.haskell.org/t/using-unsafeperformio-safely/4146):
>
> A colleague of mine Victor Miraldo asked me today whether I know how to use unsafePerformIO safely. And I realized I have no idea. Do you? Or do you know of an existing blog post / other resource that addresses this? Context: Victor is writing a program that needs to call out to an SMT solver. An SMT solver acts like a pure function: it gets information in and then deterministically produces a result based (only) on its input. But because the SMT solver is invoked via a separate process, the in…

---

_[View the full topic](https://discourse.haskell.org/t/reference-counting-with-linear-types/9535)._
