Refl package:base

This provides a type-indexed type representation mechanism, similar to that described by,
  • Simon Peyton-Jones, Stephanie Weirich, Richard Eisenberg, Dimitrios Vytiniotis. "A reflection on types". Proc. Philip Wadler's 60th birthday Festschrift, Edinburgh (April 2016).
The interface provides TypeRep, a type representation which can be safely decomposed and composed. See Data.Dynamic for an example of this.
Atomically apply a function to the contents of an IORef and return the old and new values. The result of the function is not forced. As this can lead to a memory leak, it is usually better to use atomicModifyIORef'_.