-- | This is an approximate re-implementation of "Data.Typeable" using open witnesses.moduleData.OpenWitness.Typeable(moduleData.OpenWitness.Typeable.Rep,moduleData.OpenWitness.Typeable)where{importData.OpenWitness.Typeable.Rep;importData.OpenWitness;importData.Witness;importData.Maybe;-- | types of kind @*@ with a representation;classTypeableawhere{rep::Repa;};-- | types of kind @* -> *@ with a representation;classTypeable1twhere{rep1::Rep1t;};-- | types of kind @* -> * -> *@ with a representation;classTypeable2twhere{rep2::Rep2t;};instance(Typeable1f,Typeablea)=>Typeable(fa)where{rep=ApplyReprep1rep;};instance(Typeable2f,Typeablea)=>Typeable1(fa)where{rep1=ApplyRep1rep2rep;};instanceTypeable2(->)where{rep2=SimpleRep2witFnwhere{witFn::IOWitness(()->());-- <- newIOWitness;witFn=unsafeIOWitnessFromString"Data.OpenWitness.Typeable.witFn";};};cast::forallab.(Typeablea,Typeableb)=>a->Maybeb;casta=do{MkEqualType::EqualTypeab<-matchWitnessreprep;returna;};gcast::forallabc.(Typeablea,Typeableb)=>ca->Maybe(cb);gcastca=do{MkEqualType::EqualTypeab<-matchWitnessreprep;returnca;};-- | represents a type of kind @*@;typeTypeRep=AnyWitnessRep;typeOf::forallt.(Typeablet)=>t->TypeRep;typeOf_=MkAnyWitness(rep::Rept);-- | represents a type of kind @* -> *@;typeTypeRep1=AnyWitness1Rep1;typeOf1::forallta.(Typeable1t)=>ta->TypeRep1;typeOf1_=MkAnyWitness1(rep1::Rep1t);-- | represents a type of kind @* -> * -> *@;typeTypeRep2=AnyWitness2Rep2;typeOf2::foralltab.(Typeable2t)=>tab->TypeRep2;typeOf2_=MkAnyWitness2(rep2::Rep2t);-- | given representations of @a@ and @b@, make a representation of @a -> b@;mkFunTy::TypeRep->TypeRep->TypeRep;mkFunTy(MkAnyWitnessta)(MkAnyWitnesstb)=MkAnyWitness(ApplyRep(ApplyRep1(rep2::Rep2(->))ta)tb);-- | given representations of @a -> b@ and @a@, make a representation of @b@ (otherwise not);funResultTy::TypeRep->TypeRep->MaybeTypeRep;funResultTy(MkAnyWitness(ApplyRep(ApplyRep1repFn'ta')tb'))(MkAnyWitnessta)=do{MkEqualType<-matchRep2repFn'(rep2::Rep2(->));MkEqualType<-matchWitnessta'ta;return(MkAnyWitnesstb');};funResultTy__=Nothing;mkAppTy::TypeRep1->TypeRep->TypeRep;mkAppTy(MkAnyWitness1tf)(MkAnyWitnessta)=MkAnyWitness(ApplyReptfta);mkAppTy1::TypeRep2->TypeRep->TypeRep1;mkAppTy1(MkAnyWitness2tf)(MkAnyWitnessta)=MkAnyWitness1(ApplyRep1tfta);}