recover-rtti: Recover run-time type information from the GHC heap

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

The main function in this package is classify, which looks at the GHC heap to recover type information about arbitrary values. This makes it possible for example to show any value (function anythingToString) without having any Show instance in scope, though there are other use cases as well. For example, you could use it to define an anythingToJSON function.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.4.1.0, 0.4.2, 0.4.3
Change log CHANGELOG.md
Dependencies aeson (>=1.5 && <1.6), base (>=4.13 && <4.16), bytestring (>=0.10 && <0.11), containers (>=0.6 && <0.7), ghc-heap (>=8.8 && <9.1), mtl (>=2.2 && <2.3), sop-core (>=0.5 && <0.6), stm (>=2.5 && <2.6), text (>=1.2 && <1.3) [details]
License BSD-3-Clause
Copyright Juspay Technologies Pvt Ltd, Well-Typed LLP
Author Edsko de Vries
Maintainer edsko@well-typed.com
Category Debugging
Bug tracker https://github.com/well-typed/recover-rtti/issues
Uploaded by EdskoDeVries at 2021-03-11T18:19:33Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for recover-rtti-0.1.0.0

[back to package description]

recover-rtti

Recover run-time type information from the GHC heap. The key function in this library is

classify :: a -> Classifier a

which recovers type information about values about which we know nothing (in particular, no type class constraints). One example use case is the following anythingToString function:

anythingToString :: a -> String

We test that the result of anythingToString is equal to the result of regular show for a large range of data types (including user-defined ones that the library is not aware of). There are also other possible use cases; for example, it should be possible to define an anythingToJSON function.

Obviously there are limitations; the most important ones are:

There may be other gotchas as well; this library is primarily intended for debugging.