packages feed

ghc-typelits-knownnat 0.7.5 → 0.7.6

raw patch · 5 files changed

+38/−8 lines, 5 filesdep ~ghcdep ~ghc-primdep ~template-haskellPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ghc, ghc-prim, template-haskell

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Changelog for the [`ghc-typelits-knownnat`](http://hackage.haskell.org/package/ghc-typelits-knownnat) package +## 0.7.6 *June 18th 2021*+* Add support for GHC 9.2.0.20210422+ ## 0.7.5 *February 10th 2021* * Raise upper limit for TH dep to allow building on ghc-9.0.1 
README.md view
@@ -1,6 +1,6 @@ # ghc-typelits-knownnat -[![Build Status](https://secure.travis-ci.org/clash-lang/ghc-typelits-knownnat.svg?branch=master)](http://travis-ci.org/clash-lang/ghc-typelits-knownnat)+[![Build Status](https://github.com/clash-lang/ghc-typelits-knownnat/actions/workflows/haskell-ci.yml/badge.svg?branch=master)](https://github.com/clash-lang/ghc-typelits-knownnat/actions) [![Hackage](https://img.shields.io/hackage/v/ghc-typelits-knownnat.svg)](https://hackage.haskell.org/package/ghc-typelits-knownnat) [![Hackage Dependencies](https://img.shields.io/hackage-deps/v/ghc-typelits-knownnat.svg?style=flat)](http://packdeps.haskellers.com/feed?needle=exact%3Aghc-typelits-knownnat) 
ghc-typelits-knownnat.cabal view
@@ -1,5 +1,5 @@ name:                ghc-typelits-knownnat-version:             0.7.5+version:             0.7.6 synopsis:            Derive KnownNat constraints from other KnownNat constraints description:   A type checker plugin for GHC that can derive \"complex\" @KnownNat@@@ -54,7 +54,7 @@                      CHANGELOG.md cabal-version:       >=1.10 tested-with:         GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,-                     GHC == 8.8.4, GHC == 8.10.3, GHC == 9.0.1+                     GHC == 8.8.4, GHC == 8.10.4, GHC == 9.0.1, GHC == 9.2.1  source-repository head   type: git@@ -86,12 +86,12 @@                        UndecidableInstances                        ViewPatterns   build-depends:       base                      >= 4.9      && <5,-                       ghc                       >= 8.0.1    && <9.2,-                       ghc-prim                  >= 0.4.0.0  && <0.8,+                       ghc                       >= 8.0.1    && <9.4,+                       ghc-prim                  >= 0.4.0.0  && <0.9,                        ghc-tcplugins-extra       >= 0.3.1,                        ghc-typelits-natnormalise >= 0.7.1    && <0.8,                        transformers              >= 0.5.2.0  && <0.6,-                       template-haskell          >= 2.11.0.0 && <2.18+                       template-haskell          >= 2.11.0.0 && <2.19   hs-source-dirs:      src   default-language:    Haskell2010   if flag(deverror)
src/GHC/TypeLits/KnownNat.hs view
@@ -154,6 +154,9 @@   (KnownNat, Nat, Symbol, type (+), type (*), type (^), type (-), type (<=?),    type (<=), natVal) #endif+#if MIN_VERSION_base(4,16,0)+import Data.Type.Ord (OrdCond)+#endif  import GHC.TypeLits.KnownNat.TH @@ -286,6 +289,12 @@ instance (KnownNat a, KnownNat b) => KnownBoolNat2 $(nameToSymbol ''(<=?)) a b where   boolNatSing2 = SBoolKb (natVal (Proxy @a) <= natVal (Proxy @b))   {-# INLINE boolNatSing2 #-}++#if MIN_VERSION_base(4,16,0)+instance (KnownNat a, KnownNat b) => KnownBoolNat2 $(nameToSymbol ''OrdCond) a b where+  boolNatSing2 = SBoolKb (natVal (Proxy @a) <= natVal (Proxy @b))+  {-# INLINE boolNatSing2 #-}+#endif  -- | Class for ternary functions with a Natural result. --
src/GHC/TypeLits/KnownNat/Solver.hs view
@@ -115,6 +115,10 @@ import GHC.Builtin.Names (knownNatClassName) import GHC.Builtin.Types (boolTy) import GHC.Builtin.Types.Literals (typeNatAddTyCon, typeNatDivTyCon, typeNatSubTyCon)+#if MIN_VERSION_ghc(9,2,0)+import GHC.Builtin.Types (promotedFalseDataCon, promotedTrueDataCon)+import GHC.Builtin.Types.Literals (typeNatCmpTyCon)+#endif import GHC.Core.Class (Class, classMethods, className, classTyCon) import GHC.Core.Coercion (Role (Representational), mkUnivCo) import GHC.Core.InstEnv (instanceDFunId, lookupUniqueInstEnv)@@ -449,6 +453,20 @@               () | Just knN_cls    <- knownNatN defs (length args0)                  , Right (inst, _) <- lookupUniqueInstEnv ienv knN_cls args1                  -> Just (inst,knN_cls,args0,args1)+#if MIN_VERSION_base(4,16,0)+                 | fn0 == "Data.Type.Ord.OrdCond"+                 , [_,cmpNat,TyConApp t1 [],TyConApp t2 [],TyConApp f1 []] <- args0+                 , TyConApp cmpNatTc args2 <- cmpNat+                 , cmpNatTc == typeNatCmpTyCon+                 , t1 == promotedTrueDataCon+                 , t2 == promotedTrueDataCon+                 , f1 == promotedFalseDataCon+                 , let knN_cls = knownBoolNat2 defs+                       ki      = typeKind (head args2)+                       args1N  = ki:fn1:args2+                 , Right (inst,_) <- lookupUniqueInstEnv ienv knN_cls args1N+                 -> Just (inst,knN_cls,args2,args1N)+#endif                  | length args0 == 2                  , let knN_cls = knownBoolNat2 defs                        ki      = typeKind (head args0)@@ -697,12 +715,12 @@   , Just (_, op_co_rep) <- tcInstNewTyCon_maybe op_tcRep op_args     -- SNatKn (a+b) ~ Integer #if MIN_VERSION_ghc(8,5,0)-  , let EvExpr dfun_inst = evDFunApp dfid tyArgsI evArgs+  , EvExpr dfun_inst <- evDFunApp dfid tyArgsI evArgs #else   , let dfun_inst = EvDFunApp dfid tyArgsI evArgs #endif         -- KnownNatAdd a b-        op_to_kn  = mkTcTransCo (mkTcTransCo op_co_dict op_co_rep)+  , let op_to_kn  = mkTcTransCo (mkTcTransCo op_co_dict op_co_rep)                                 (mkTcSymCo (mkTcTransCo kn_co_dict kn_co_rep))         -- KnownNatAdd a b ~ KnownNat (a+b)         ev_tm     = mkEvCast dfun_inst op_to_kn