packages feed

overload 0.1.0.4 → 0.1.0.5

raw patch · 3 files changed

+6/−6 lines, 3 filesdep ~simple-effectsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: simple-effects

API changes (from Hackage documentation)

Files

overload.cabal view
@@ -1,5 +1,5 @@ name:                overload-version:             0.1.0.4+version:             0.1.0.5 synopsis:            Finite overloading description:         Provides a mechanism for finite overloading homepage:            https://gitlab.com/LukaHorvat/overload@@ -22,7 +22,7 @@                        Overload.Diff   build-depends:       base >= 4.7 && < 5                      , template-haskell-                     , simple-effects >= 0.9.0.0+                     , simple-effects >= 0.10.0.0                      , th-expand-syns   default-language:    Haskell2010   ghc-options:         -Wall
src/Overload/General.hs view
@@ -22,7 +22,7 @@ 
 isMoreGeneralThan :: forall a b. (Eq a, Eq b) => TypeTree a -> TypeTree b -> Bool
 isMoreGeneralThan t1 t2 =
-    runIdentity (handleStateT ([] :: VariableMapping a b) (isMoreGeneralThan' t1 t2))
+    runIdentity (implementStateViaStateT ([] :: VariableMapping a b) (isMoreGeneralThan' t1 t2))
 
 isMoreGeneralThan' :: (MonadEffect (State (VariableMapping a b)) m, Eq a, Eq b)
                    => TypeTree a -> TypeTree b -> m Bool
@@ -33,7 +33,7 @@ isMoreGeneralThan' _ _ = return False
 
 getEqualities :: forall a b. (Eq a, Eq b) => TypeTree a -> TypeTree b -> [(b, TypeTree a)]
-getEqualities specific general = runIdentity $ handleStateT ([] :: VariableMapping b a) $ do
+getEqualities specific general = runIdentity $ implementStateViaStateT ([] :: VariableMapping b a) $ do
     res <- general `isMoreGeneralThan'` specific
     if res then getState
     else error "Can't get equalities because the second type isn't more general than the first"
@@ -41,7 +41,7 @@ minimize :: Eq a => [TypeTree a] -> [TypeTree a]
 minimize [] = []
 minimize (t : ts) = foldl' minimizer [t] ts
-    where minimizer ms candidate = runIdentity $ handleStateT True $ do
+    where minimizer ms candidate = runIdentity $ implementStateViaStateT True $ do
               ms' <- filterM (\m ->
                   if m `isMoreGeneralThan` candidate then setState False >> return True
                   else if candidate `isMoreGeneralThan` m then return False
src/Overload/Normal.hs view
@@ -30,5 +30,5 @@ normalizeTypeTree :: forall a. Eq a => TypeTree (Maybe a) -> TypeTree Normal
 normalizeTypeTree =
       runIdentity
-    . handleStateT (([], Normal 0) :: FreshSource a)
+    . implementStateViaStateT (([], Normal 0) :: FreshSource a)
     . traverse (maybe (freshVar @a) lookupName)