Reading type families from interface files

Devs, Is there a plumbing for returning declarations (not instances) of type families from an interface file? Janek

I don't know what you mean. Can you be more explicit. The mi_fam_insts field of a ModIface sounds like what you want | -----Original Message----- | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Jan | Stolarek | Sent: 23 October 2014 08:50 | To: ghc-devs@haskell.org | Subject: Reading type families from interface files | | Devs, | | Is there a plumbing for returning declarations (not instances) of type | families from an interface file? | | Janek | _______________________________________________ | ghc-devs mailing list | ghc-devs@haskell.org | http://www.haskell.org/mailman/listinfo/ghc-devs

Say I have: module Foo where type family F a type instance F Int = Char mi_fam_insts stores type family instances, in that case "F Int = Char". What I would like to load is type family declaration: "F a". If that does not exist already I wonder whether information about type family declarations should be cached in ModDetails in the same way md_fam_insts caches information about instances? Rationale: I want to load information about tyfam declarations in FamInst.checkFamInstConsistency and pass these definitions of type families to FamInst.checkForConflicts. My plan is to verify whether an open type family is injective at the same time when looking for conflicts. Janek Dnia czwartek, 23 października 2014, napisałeś:
I don't know what you mean. Can you be more explicit. The mi_fam_insts field of a ModIface sounds like what you want
| -----Original Message----- | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Jan | Stolarek | Sent: 23 October 2014 08:50 | To: ghc-devs@haskell.org | Subject: Reading type families from interface files | | Devs, | | Is there a plumbing for returning declarations (not instances) of type | families from an interface file? | | Janek | _______________________________________________ | ghc-devs mailing list | ghc-devs@haskell.org | http://www.haskell.org/mailman/listinfo/ghc-devs

It's in mi_decls, along with data type declarations, class declarations, and the like. If you are talking about a ModDetails, then look in the range of md_types; the TyThings there include all the data types, classes, and type families declared in this module S | -----Original Message----- | From: Jan Stolarek [mailto:jan.stolarek@p.lodz.pl] | Sent: 23 October 2014 11:31 | To: Simon Peyton Jones | Cc: ghc-devs@haskell.org | Subject: Re: Reading type families from interface files | | Say I have: | | module Foo where | type family F a | type instance F Int = Char | | mi_fam_insts stores type family instances, in that case "F Int = | Char". What I would like to load is type family declaration: "F a". If | that does not exist already I wonder whether information about type | family declarations should be cached in ModDetails in the same way | md_fam_insts caches information about instances? | | Rationale: I want to load information about tyfam declarations in | FamInst.checkFamInstConsistency and pass these definitions of type | families to FamInst.checkForConflicts. My plan is to verify whether an | open type family is injective at the same time when looking for | conflicts. | | Janek | | Dnia czwartek, 23 października 2014, napisałeś: | > I don't know what you mean. Can you be more explicit. The | > mi_fam_insts field of a ModIface sounds like what you want | > | > | -----Original Message----- | > | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of | > | Jan Stolarek | > | Sent: 23 October 2014 08:50 | > | To: ghc-devs@haskell.org | > | Subject: Reading type families from interface files | > | | > | Devs, | > | | > | Is there a plumbing for returning declarations (not instances) of | > | type families from an interface file? | > | | > | Janek | > | _______________________________________________ | > | ghc-devs mailing list | > | ghc-devs@haskell.org | > | http://www.haskell.org/mailman/listinfo/ghc-devs |
participants (2)
-
Jan Stolarek
-
Simon Peyton Jones