ghc-typelits-extra 0.5.0 → 0.5.1
raw patch · 3 files changed
+18/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
CHANGELOG.md view
@@ -1,5 +1,8 @@ # Changelog for the [`ghc-typelits-extra`](http://hackage.haskell.org/package/ghc-typelits-extra) package +# 0.5.1 *October 21st 2025*+* Compatibility with `ghc-typelits-natnormalise` 0.9.1 release+ # 0.5.0 *October 17th 2025* * Add support for GHC 9.14 * Uses https://hackage.haskell.org/package/ghc-tcplugin-api to make supporting new GHC versions easier
ghc-typelits-extra.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ghc-typelits-extra-version: 0.5.0+version: 0.5.1 synopsis: Additional type-level operations on GHC.TypeLits.Nat description: Additional type-level operations on @GHC.TypeLits.Nat@:
src/GHC/TypeLits/Extra/Solver/Operations.hs view
@@ -133,9 +133,14 @@ let x' = reifyEOP defs x y' = reifyEOP defs y (z,deps) = fst (runWriter (normaliseNat (mkTyConApp typeNatSubTyCon [y',x'])))+ (z',deps') = fst (runWriter (normaliseNat (mkTyConApp typeNatSubTyCon [x',y']))) in case runWriterT (isNatural z) of- Just (True , cs) | Set.null cs -> (y, Normalised deps)- Just (False, cs) | Set.null cs -> (x, Normalised deps)+ Nothing -> case runWriterT (isNatural z') of+ Just (True ,cs) | Set.null cs -> (x, Normalised deps') -- x >= y+ Just (False,cs) | Set.null cs -> (y, Normalised deps') -- x < y+ _ -> (Max x y, Untouched)+ Just (True , cs) | Set.null cs -> (y, Normalised deps) -- y >= x+ Just (False, cs) | Set.null cs -> (x, Normalised deps) -- y < x _ -> (Max x y, Untouched) mergeMin :: ExtraDefs -> ExtraOp -> ExtraOp -> NormaliseResult@@ -143,9 +148,14 @@ let x' = reifyEOP defs x y' = reifyEOP defs y (z,deps) = fst (runWriter (normaliseNat (mkTyConApp typeNatSubTyCon [y',x'])))+ (z',deps') = fst (runWriter (normaliseNat (mkTyConApp typeNatSubTyCon [x',y']))) in case runWriterT (isNatural z) of- Just (True, cs) | Set.null cs -> (x, Normalised deps)- Just (False,cs) | Set.null cs -> (y, Normalised deps)+ Nothing -> case runWriterT (isNatural z') of+ Just (True ,cs) | Set.null cs -> (y, Normalised deps') -- x >= y+ Just (False,cs) | Set.null cs -> (x, Normalised deps') -- x < y+ _ -> (Min x y, Untouched)+ Just (True, cs) | Set.null cs -> (x, Normalised deps) -- y >= x+ Just (False,cs) | Set.null cs -> (y, Normalised deps) -- y < x _ -> (Min x y, Untouched) mergeDiv :: ExtraOp -> ExtraOp -> Maybe NormaliseResult