polysemy 1.7.0.0 → 1.7.1.0
raw patch · 4 files changed
+17/−29 lines, 4 files
Files
- ChangeLog.md +5/−0
- polysemy.cabal +1/−1
- src/Polysemy/Internal/CustomErrors.hs +0/−25
- src/Polysemy/Internal/Index.hs +11/−3
ChangeLog.md view
@@ -6,6 +6,11 @@ ### Other Changes +## 1.7.1.0 (2021-11-23)++### Other Changes++* Support GHC 9.2.1 ## 1.7.0.0 (2021-11-16)
polysemy.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: polysemy-version: 1.7.0.0+version: 1.7.1.0 synopsis: Higher-order, low-boilerplate free monads. description: Please see the README on GitHub at <https://github.com/polysemy-research/polysemy#readme> category: Language
src/Polysemy/Internal/CustomErrors.hs view
@@ -36,31 +36,6 @@ type family (%) (t :: k1) (b :: k2) :: ErrorMessage where t % b = ToErrorMessage t ':$$: ToErrorMessage b --- TODO(sandy): Put in type-errors-type ShowTypeBracketed t = "(" <> t <> ")"------------------------------------------------------------------------------------ | The constructor of the effect row --- it's either completely polymorphic,--- a nil, or a cons.-data EffectRowCtor = TyVarR | NilR | ConsR------------------------------------------------------------------------------------ | Given that @r@ isn't stuck, determine which constructor it has.-type family UnstuckRState (r :: EffectRow) :: EffectRowCtor where- UnstuckRState '[] = 'NilR- UnstuckRState (_ ': _) = 'ConsR------------------------------------------------------------------------------------ | Put brackets around @r@ if it's a cons.-type family ShowRQuoted (rstate :: EffectRowCtor) (r :: EffectRow) :: ErrorMessage where- ShowRQuoted 'TyVarR r = 'ShowType r- ShowRQuoted 'NilR r = 'ShowType r- ShowRQuoted 'ConsR r = ShowTypeBracketed r-- data FirstOrderErrorFcf :: k -> Symbol -> Exp Constraint type instance Eval (FirstOrderErrorFcf e fn) = $(te[t| UnlessPhantom
src/Polysemy/Internal/Index.hs view
@@ -2,16 +2,17 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE CPP #-} {-# OPTIONS_HADDOCK not-home #-} module Polysemy.Internal.Index where import GHC.TypeLits (Nat)-import Type.Errors (TypeError, ErrorMessage(ShowType))+import Type.Errors (ErrorMessage (ShowType), TypeError) -import Polysemy.Internal.CustomErrors (type (<>), type (%))-import Polysemy.Internal.Sing (SList (SEnd, SCons))+import Polysemy.Internal.CustomErrors (type (%), type (<>))+import Polysemy.Internal.Sing (SList (SCons, SEnd)) ------------------------------------------------------------------------------ -- | Infer a partition of the result type @full@ so that for the fixed segments@@ -31,9 +32,16 @@ insertAtIndex = SCons (insertAtIndex @_ @index @head @tail @oldTail @full) {-# INLINE insertAtIndex #-} +-- Broken on 9.2.+-- It appears that instance matching is done with an abstract value for @oldTail@, thus not matching the correct+-- instance and finding only this one, causing a false positive for the @TypeError@.+#if __GLASGOW_HASKELL__ < 902+ instance {-# INCOHERENT #-} TypeError (InsertAtFailure index oldTail head full) => InsertAtIndex index head tail oldTail full inserted where insertAtIndex = error "unreachable"++#endif type family InsertAtUnprovidedIndex where InsertAtUnprovidedIndex = TypeError (