{-# LANGUAGE KindSignatures #-}{-# LANGUAGE ScopedTypeVariables #-}{-# LANGUAGE FlexibleContexts #-}{-# LANGUAGE FlexibleInstances #-}{-# LANGUAGE OverlappingInstances #-}{-# LANGUAGE TypeFamilies #-}-- Contains functions to help making Typeable instances from Typed instances.---- Warning: The TypeRep of parameters comes from the Typed instances even if they might have a Typeable instance.-- This propably won't be a problem when they are just being used for casting, but it is an ugly hack.moduleData.Type.Typeable(toTypeable,toTypeable1,toTypeable2,toTypeable3,toTypeable4,toTypeable5,toTypeable6,toTypeable7)whereimportData.Type.FrameworkimportData.Type.GeneratedimportData.TypeablemigrateTypeRep::Typedt=>t->TypeRepmigrateTypeRep=mapTypeID(\ps->mkTyConApp(mkTyCon(s++'@':p))[])mkAppTy.typeIDtoTypeable::forallt.Typed(Typet)=>t->TypeReptoTypeable_=migrateTypeRep(type_::Typet)toTypeable1::forallta.Typed(TypeXt)=>ta->TypeReptoTypeable1_=migrateTypeRep(type_::TypeXt)toTypeable2::foralltab.Typed(TypeXXt)=>tab->TypeReptoTypeable2_=migrateTypeRep(type_::TypeXXt)toTypeable3::foralltabc.Typed(TypeXXXt)=>tabc->TypeReptoTypeable3_=migrateTypeRep(type_::TypeXXXt)toTypeable4::foralltabcd.Typed(TypeXXXXt)=>tabcd->TypeReptoTypeable4_=migrateTypeRep(type_::TypeXXXXt)toTypeable5::foralltabcde.Typed(TypeXXXXXt)=>tabcde->TypeReptoTypeable5_=migrateTypeRep(type_::TypeXXXXXt)toTypeable6::foralltabcdef.Typed(TypeXXXXXXt)=>tabcdef->TypeReptoTypeable6_=migrateTypeRep(type_::TypeXXXXXXt)toTypeable7::foralltabcdefg.Typed(TypeXXXXXXXt)=>tabcdefg->TypeReptoTypeable7_=migrateTypeRep(type_::TypeXXXXXXXt)