... | ... | @@ -6,7 +6,7 @@ Error: HttpError (HttpExceptionRequest Request { |
|
|
secure = True
|
|
|
requestHeaders = []
|
|
|
path = "/trac/ghc/wiki/TypeFunctionsIface"
|
|
|
queryString = "?version=7"
|
|
|
queryString = "?version=8"
|
|
|
method = "GET"
|
|
|
proxy = Nothing
|
|
|
rawBody = False
|
... | ... | @@ -14,7 +14,7 @@ Error: HttpError (HttpExceptionRequest Request { |
|
|
responseTimeout = ResponseTimeoutDefault
|
|
|
requestVersion = HTTP/1.1
|
|
|
}
|
|
|
(StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Sun, 10 Mar 2019 06:57:22 GMT"),("Server","Apache/2.2.22 (Debian)"),("Strict-Transport-Security","max-age=63072000; includeSubDomains"),("Vary","Accept-Encoding"),("Content-Encoding","gzip"),("Content-Length","257"),("Content-Type","text/html; charset=iso-8859-1")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /trac/ghc/wiki/TypeFunctionsIface\non this server.</p>\n<hr>\n<address>Apache/2.2.22 (Debian) Server at ghc.haskell.org Port 443</address>\n</body></html>\n"))
|
|
|
(StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Sun, 10 Mar 2019 06:57:31 GMT"),("Server","Apache/2.2.22 (Debian)"),("Strict-Transport-Security","max-age=63072000; includeSubDomains"),("Vary","Accept-Encoding"),("Content-Encoding","gzip"),("Content-Length","257"),("Content-Type","text/html; charset=iso-8859-1")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /trac/ghc/wiki/TypeFunctionsIface\non this server.</p>\n<hr>\n<address>Apache/2.2.22 (Debian) Server at ghc.haskell.org Port 443</address>\n</body></html>\n"))
|
|
|
|
|
|
Original source:
|
|
|
|
... | ... | @@ -23,9 +23,7 @@ Original source: |
|
|
|
|
|
== Representation of family instances ==
|
|
|
|
|
|
The `IfaceSyn.IfaceData` variant of `IfaceDecl` contains a new `ifFamInst :: Maybe IfaceFamInst` field that is distinguishes ordinary data/newtype declarations from family instances. In the latter case, a `IfaceFamInst` value gives the instances head of the family instance. Moreover, all family instance heads of a module are collected in the new `mi_fam_insts :: [(IfaceFamInst, IfaceDecl)]` field of `HscTypes.ModIface`. We don't include the `IfaceDecl` component into `IfaceFamInst`, as we otherwise would get a cyclic dependency - the `IfaceDecl` must include `IfaceFamInst`, so that we can generate the correct wrapper signature for family data constructors during type checking the interface declarations.
|
|
|
The `IfaceSyn.IfaceData` variant of `IfaceDecl` contains a new `ifFamInst :: Maybe (IfaceTyCon, [IfaceType])` field that distinguishes ordinary data/newtype declarations from family instances. In the latter case, the `(IfaceTyCon, [IfaceType])` value gives the family instance type. In addition, each family instance is represented by a value of type `IfaceFamInst` that includes the instances rough match (i.e., name of the family type and a `[Maybe IfaceTyCon]` value that gives the outermost type constructor of each index argument for that instance) and refers to the type declaration for full details (as a class instance does with its dfun).
|
|
|
|
|
|
The `mi_fam_insts` field does not contain any additional information, but instead is just a cached summary of the family instances of the `mi_decls` field. Hence, the serialised interface description does not explicitly contain the value of `mi_fam_insts`. Instead, the `get` method of `Binary ModIface` (in `BinIface`) - like all other places producing a `HscTypes.ModIface` - uses `HscTypes.mkIfaceFamInstsCache` to extract the relevant information from the declarations.
|
|
|
|
|
|
Similarly, `HscTypes.ModDetails` maintains a cached summary of the type checked representations of family instances in `md_fam_insts :: ![FamInstEnv.FamInst]`. This computed from the field `md_types` with `HscTypes.mkDetailsFamInstsCache`.
|
|
|
Moreover, much like class instances, family instance heads of a module are collected in the new `mi_fam_insts :: [IfaceFamInst]` field of `HscTypes.ModIface`. This allows to enter the rough matches into the `ModGuts`, when reading the interface, without having to parse the full tycon that represents the instance yet. This in turn avoids pulling in everything that hangs of that tycon.
|
|
|
``` |