Handling of unlifted types

Erik de Castro Lopo mle+hs at mega-nerd.com
Sun Feb 5 08:49:26 UTC 2017


Hi all,

I'm working on pulling the core parts of Joachim Breitner's
ghc-heap-view library into GHC. The WIP Phab review is here:

    https://phabricator.haskell.org/D3055

Currently that library has a function:

    getClosureData :: a -> IO Closure

which works fine for lifted types. However, some of the supported
closure types in 

    http://hackage.haskell.org/trac/ghc/browser/includes/rts/storage/InfoTables.h

actually refer to unlifted types, like the `MUT_ARR_PTRS_*` and
`SMALL_MUT_ARR_PTRS_*`.

I've had a look at the levity polymorphism stuff implemented in ghc 8.0
and came up with a new type for `getClosureData`:

    getClosureData :: forall (r :: RuntimeRep) (a :: TYPE r). a -> IO Closure

but that results in:

    A representation-polymorphic type is not allowed here:
      Type: a
      Kind: TYPE r
    In the type of binder ‘x’

Am I barking up the wrong tree here? Any one have a clue on how I might
make progress on this?


Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the ghc-devs mailing list