git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix compile warnings. Remove unnecessary function in entails.
56134dfPhil Freeman
src/Language/PureScript/Sugar/TypeClasses.hs−2
@@ -21,12 +21,10 @@ module Language.PureScript.Sugar.TypeClasses (
21import Language.PureScript.Declarations
21import Language.PureScript.Declarations
22import Language.PureScript.Names
22import Language.PureScript.Names
23import Language.PureScript.Types
23import Language.PureScript.Types
24−import Language.PureScript.CodeGen.JS.AST
25import Language.PureScript.Sugar.CaseDeclarations
24import Language.PureScript.Sugar.CaseDeclarations
26import Language.PureScript.Environment
25import Language.PureScript.Environment
27import Language.PureScript.Errors
26import Language.PureScript.Errors
28import Language.PureScript.Pretty.Types (prettyPrintTypeAtom)
27import Language.PureScript.Pretty.Types (prettyPrintTypeAtom)
29−import Language.PureScript.CodeGen.Common (identToJs)
30
28
31import qualified Language.PureScript.Constants as C
29import qualified Language.PureScript.Constants as C
32
30
src/Language/PureScript/TypeChecker/Types.hs+1−7
@@ -348,7 +348,7 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
348 -- Make sure the types unify with the types in the superclass implication
348 -- Make sure the types unify with the types in the superclass implication
349 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
349 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
350 -- Finally, satisfy the subclass constraint
350 -- Finally, satisfy the subclass constraint
351− , args' <- maybeToList $ mapM (applySubst subst . TypeVar) args
351+ , args' <- maybeToList $ mapM (flip lookup subst) args
352 , suDict <- go True subclassName args' ]
352 , suDict <- go True subclassName args' ]
353
353
354 -- Create dictionaries for subgoals which still need to be solved by calling go recursively
354 -- Create dictionaries for subgoals which still need to be solved by calling go recursively
@@ -379,12 +379,6 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
379 let grps = groupBy ((==) `on` fst) subst
379 let grps = groupBy ((==) `on` fst) subst
380 guard (all (pairwise (unifiesWith env) . map snd) grps)
380 guard (all (pairwise (unifiesWith env) . map snd) grps)
381 return $ map head grps
381 return $ map head grps
382− -- Apply a substitution to a type
383− applySubst :: [(String, Type)] -> Type -> Maybe Type
384− applySubst subst = everywhereOnTypesM replace
385− where
386− replace (TypeVar v) = lookup v subst
387− replace other = Just other
388 -- Choose the simplest DictionaryValues from a list of candidates
382 -- Choose the simplest DictionaryValues from a list of candidates
389 -- The reason for this function is as follows:
383 -- The reason for this function is as follows:
390 -- When considering overlapping instances, we don't want to consider the same dictionary
384 -- When considering overlapping instances, we don't want to consider the same dictionary