overload 0.1.0.3 → 0.1.0.4
raw patch · 3 files changed
+6/−6 lines, 3 filesdep ~simple-effects
Dependency ranges changed: simple-effects
Files
- overload.cabal +2/−2
- src/Overload/General.hs +2/−2
- src/Overload/Normal.hs +2/−2
overload.cabal view
@@ -1,5 +1,5 @@ name: overload-version: 0.1.0.3+version: 0.1.0.4 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+ , simple-effects >= 0.9.0.0 , th-expand-syns default-language: Haskell2010 ghc-options: -Wall
src/Overload/General.hs view
@@ -10,7 +10,7 @@ type VariableMapping a b = [(a, TypeTree b)] -trySetVar :: (MonadEffectState (VariableMapping a b) m, Eq a, Eq b) => a -> TypeTree b -> m Bool +trySetVar :: (MonadEffect (State (VariableMapping a b)) m, Eq a, Eq b) => a -> TypeTree b -> m Bool trySetVar name typ = do mapping <- getState case lookup name mapping of @@ -24,7 +24,7 @@ isMoreGeneralThan t1 t2 = runIdentity (handleStateT ([] :: VariableMapping a b) (isMoreGeneralThan' t1 t2)) -isMoreGeneralThan' :: (MonadEffectState (VariableMapping a b) m, Eq a, Eq b) +isMoreGeneralThan' :: (MonadEffect (State (VariableMapping a b)) m, Eq a, Eq b) => TypeTree a -> TypeTree b -> m Bool isMoreGeneralThan' (Var n) t = trySetVar n t isMoreGeneralThan' (Concrete n1) (Concrete n2) | n1 == n2 = return True
src/Overload/Normal.hs view
@@ -12,7 +12,7 @@ type FreshSource a = ([(a, Normal)], Normal) -lookupName :: (MonadEffectState (FreshSource a) m, Eq a) => a -> m Normal +lookupName :: (MonadEffect (State (FreshSource a)) m, Eq a) => a -> m Normal lookupName name = do (table, Normal top) <- getState case lookup name table of @@ -21,7 +21,7 @@ return (Normal top) Just n -> return n -freshVar :: forall a m. MonadEffectState (FreshSource a) m => m Normal +freshVar :: forall a m. MonadEffect (State (FreshSource a)) m => m Normal freshVar = do (table, Normal top) :: FreshSource a <- getState setState (table, Normal (top + 1))