toClassDecl :: SmokeClass -> Gen Decl
toClassDecl c = do
  mangler <- askModuleConf generatorClassNameMangler
  let baseName = dropOuterClass $ smokeClassName c
      cname = Ident $ T.unpack $ mangler baseName
      unpacker = "unpack" `mappend` baseName
      tvname = Ident "a"
      utype = TyFun (TyVar tvname) (TyApp (TyCon (UnQual (Ident "Ptr"))) unit_tycon)
      f = ClsDecl $ TypeSig dummyLoc [Ident (T.unpack unpacker)] utype
  return $ ClassDecl dummyLoc [] cname [UnkindedVar tvname] [] [f]
toClassDecl :: SmokeClass -> Gen Decl
toClassDecl c = do
  mangler <- askModuleConf generatorClassNameMangler
  let baseName = dropOuterClass $ smokeClassName c
      cname = Ident $ T.unpack $ mangler baseName
      unpacker = "unpack" `mappend` baseName
      tvname = Ident "a"
      utype = TyFun (TyVar tvname) (TyApp (TyCon (UnQual (Ident "Ptr"))) unit_tycon)
      f = ClsDecl $ TypeSig dummyLoc [Ident (T.unpack unpacker)] utype
  return $ ClassDecl dummyLoc [] cname [UnkindedVar tvname] [] [f]
toClassDecl c = do
  mangler <- askModuleConf generatorClassNameMangler
  let baseName = dropOuterClass $ smokeClassName c
      cname = Ident $ T.unpack $ mangler baseName
      unpacker = "unpack" `mappend` baseName
      tvname = Ident "a"
      utype = TyFun (TyVar tvname) (TyApp (TyCon (UnQual (Ident "Ptr"))) unit_tycon)
      f = ClsDecl $ TypeSig dummyLoc [Ident (T.unpack unpacker)] utype
  return $ ClassDecl dummyLoc [] cname [UnkindedVar tvname] [] [f]