Provide `getWithUserData` and `putWithUserData`
authorMatthew Pickering <matthew.pickering@tweag.io>
Mon, 4 Jun 2018 02:05:46 +0000 (02:05 +0000)
committerMatthew Pickering <matthew.pickering@tweag.io>
Mon, 4 Jun 2018 02:06:03 +0000 (02:06 +0000)
commit554bc7fcca30b1b6ffb6a2daca684ea74eb83ad8
tree622414d95ac9fe351718c471e98f2033038cee15
parent4dd1895bf8bbe5aac7a8e80f18ba76e78520be18
Provide `getWithUserData` and `putWithUserData`

Summary:
This makes it possible to serialise Names and FastStrings in user
programs, for example, when writing a source plugin.

When writing my first source plugin, I wanted to serialise names but it
wasn't possible easily without exporting additional constructors. This
interface is sufficient and abstracts nicely over the symbol table and
dictionary.

Reviewers: alpmestan, bgamari

Reviewed By: alpmestan

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15223

Differential Revision: https://phabricator.haskell.org/D4782
compiler/iface/BinIface.hs