Update and clean-up the implmenation of GHC.TypeLits
* Replace class `SingI` with two separate classes: `KnownNat` and `KnownSymbol` * Rename `magicSingId` to `magicDictId`. * Simplify and clean-up the "magic" implementation. This version makes a lot more sense, at least to me :-) * Update notes about how it all works: Note [KnownNat & KnownSymbol and EvLit] explains the evidence for the built-in classes Note [magicDictId magic] explains how we coerce singleton values into dictionaries. This is used to turn run-time integers and strings into Proxy singletons of unknwon type (using an existential).
Showing
- compiler/basicTypes/MkId.lhs 35 additions, 28 deletionscompiler/basicTypes/MkId.lhs
- compiler/basicTypes/MkId.lhs-boot 1 addition, 1 deletioncompiler/basicTypes/MkId.lhs-boot
- compiler/prelude/PrelNames.lhs 14 additions, 8 deletionscompiler/prelude/PrelNames.lhs
- compiler/prelude/PrelRules.lhs 15 additions, 15 deletionscompiler/prelude/PrelRules.lhs
- compiler/typecheck/TcEvidence.lhs 40 additions, 23 deletionscompiler/typecheck/TcEvidence.lhs
- compiler/typecheck/TcInteract.lhs 26 additions, 34 deletionscompiler/typecheck/TcInteract.lhs
Loading
Please register or sign in to comment