generics-sop icon indicating copy to clipboard operation
generics-sop copied to clipboard

[feat] add initial support for unlifted types

Open MangoIV opened this issue 2 years ago • 2 comments


Note This is a draft for adding support for unlifted types for generics-sop, according to #155


Status

  • [x] unlifted representations
  • [x] th generation for unlifted Generic
  • [x] levity polymorphic Generic
  • [x] example
  • [x] compiles on ghc927, ghc944, ghc961
  • [x] more polymorphic BasicFunctors (something like
    data family I :: forall levin levout. TYPE ('BoxedRep levin) -> TYPE ('BoxedRep levout)
    data instance I @'Unlifted @'Lifted a = ULI a
    ... 
    
  • [ ] make both the unlifted and the lifted repr derivable for an unlifted type (in the moment, only the unlifted is derivable by the TH code.)
  • [ ] a whole lot of CPP to exclude these changes on ghc <92

Warning Due to a bug in GHC, this only works on GHC 9.4 >= 9.4.6 it hasn't been backported to GHC 9.6 but should exist in GHC 9.8 I would also expect that it will get soon backported to GHC 9.6

MangoIV avatar Mar 21 '23 11:03 MangoIV

update: the PR to GHC that fixes the issue sometimes doesn't actually seem to fix this issue here as it is not only related to the interpreter but also segfaults after building normally

MangoIV avatar Mar 22 '23 14:03 MangoIV

https://gitlab.haskell.org/ghc/ghc/-/issues/23146#note_488309

the root of the issues have been found and a fix exists <3

MangoIV avatar Mar 22 '23 21:03 MangoIV