[project @ 2000-09-28 13:04:14 by simonpj]
------------------------------------ Mainly PredTypes (28 Sept 00) ------------------------------------ Three things in this commit: 1. Main thing: tidy up PredTypes 2. Move all Keys into PrelNames 3. Check for unboxed tuples in function args 1. Tidy up PredTypes ~~~~~~~~~~~~~~~~~~~~ The main thing in this commit is to modify the representation of Types so that they are a (much) better for the qualified-type world. This should simplify Jeff's life as he proceeds with implicit parameters and functional dependencies. In particular, PredType, introduced by Jeff, is now blessed and dignified with a place in TypeRep.lhs: data PredType = Class Class [Type] | IParam Name Type Consider these examples: f :: (Eq a) => a -> Int g :: (?x :: Int -> Int) => a -> Int h :: (r\l) => {r} => {l::Int | r} Here the "Eq a" and "?x :: Int -> Int" and "r\l" are all called *predicates*, and are represented by a PredType. (We don't support TREX records yet, but the setup is designed to expand to allow them.) In addition, Type gains an extra constructor: data Type = .... | PredTy PredType so that PredType is injected directly into Type. So the type p => t is represented by PredType p `FunTy` t I have deleted the hackish IPNote stuff; predicates are dealt with entirely through PredTys, not through NoteTy at all. 2. Move Keys into PrelNames ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is just a housekeeping operation. I've moved all the pre-assigned Uniques (aka Keys) from Unique.lhs into PrelNames.lhs. I've also moved knowKeyRdrNames from PrelInfo down into PrelNames. This localises in PrelNames lots of stuff about predefined names. Previously one had to alter three files to add one, now only one. 3. Unboxed tuples ~~~~~~~~~~~~~~~~~~ Add a static check for unboxed tuple arguments. E.g. data T = T (# Int, Int #) is illegal
Showing
- ghc/compiler/DEPEND-NOTES 5 additions, 2 deletionsghc/compiler/DEPEND-NOTES
- ghc/compiler/basicTypes/MkId.lhs 1 addition, 1 deletionghc/compiler/basicTypes/MkId.lhs
- ghc/compiler/basicTypes/Name.lhs 2 additions, 1 deletionghc/compiler/basicTypes/Name.lhs
- ghc/compiler/basicTypes/Unique.lhs 4 additions, 358 deletionsghc/compiler/basicTypes/Unique.lhs
- ghc/compiler/coreSyn/CoreUnfold.lhs 1 addition, 1 deletionghc/compiler/coreSyn/CoreUnfold.lhs
- ghc/compiler/coreSyn/Subst.lhs 5 additions, 3 deletionsghc/compiler/coreSyn/Subst.lhs
- ghc/compiler/deSugar/Check.lhs 1 addition, 1 deletionghc/compiler/deSugar/Check.lhs
- ghc/compiler/deSugar/DsCCall.lhs 1 addition, 1 deletionghc/compiler/deSugar/DsCCall.lhs
- ghc/compiler/deSugar/DsExpr.lhs 1 addition, 1 deletionghc/compiler/deSugar/DsExpr.lhs
- ghc/compiler/deSugar/DsForeign.lhs 2 additions, 2 deletionsghc/compiler/deSugar/DsForeign.lhs
- ghc/compiler/deSugar/DsGRHSs.lhs 1 addition, 1 deletionghc/compiler/deSugar/DsGRHSs.lhs
- ghc/compiler/deSugar/DsListComp.lhs 1 addition, 1 deletionghc/compiler/deSugar/DsListComp.lhs
- ghc/compiler/deSugar/DsUtils.lhs 1 addition, 1 deletionghc/compiler/deSugar/DsUtils.lhs
- ghc/compiler/hsSyn/HsBinds.lhs 1 addition, 0 deletionsghc/compiler/hsSyn/HsBinds.lhs
- ghc/compiler/hsSyn/HsTypes.lhs 3 additions, 5 deletionsghc/compiler/hsSyn/HsTypes.lhs
- ghc/compiler/parser/ParseUtil.lhs 5 additions, 2 deletionsghc/compiler/parser/ParseUtil.lhs
- ghc/compiler/prelude/PrelInfo.lhs 8 additions, 239 deletionsghc/compiler/prelude/PrelInfo.lhs
- ghc/compiler/prelude/PrelNames.lhs 542 additions, 51 deletionsghc/compiler/prelude/PrelNames.lhs
- ghc/compiler/prelude/PrelRules.lhs 1 addition, 2 deletionsghc/compiler/prelude/PrelRules.lhs
- ghc/compiler/prelude/TysPrim.lhs 2 additions, 2 deletionsghc/compiler/prelude/TysPrim.lhs
Loading
Please register or sign in to comment