Skip to content

Add/Expose Binary API that allows dumping of any GHC Binary instance

Serialising Names requires that a symbol table is being provided in the BinHandle so that a string can be mapped to an index in the symbol table. API clients like Haddock need this so they can use all Binary instances of GHC data types.

Whether a symbol table is provided or not is best reflected in the type (using phantom types / type labels). For example:

    data Put symtab a = ...
    data Symtab

    instance Monad (Put b) where ...

    instance Put a Foo where ...

    instance Put Symtab Name where ...

    runPut :: ... -> Put () a -> IO a 
    putWithSymtable :: ... -> Put Symtab a -> IO a

Similarly for a Get monad

(feature suggested by David Waern)

Trac metadata
Trac field Value
Version 6.9
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHC API
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information