git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix compile warnings. Remove unnecessary function in entails.
commit56134df637782520bb19ff3b61e1e7e7feda0f1f authorPhil Freeman <paf31@cantab.net> dateThu 8 May 2014, 19:13 (12 years ago) parentd0ba6fd
2 files changed+1−9
src/Language/PureScript/Sugar/TypeClasses.hs−2 src/Language/PureScript/TypeChecker/Types.hs+1−7
src/Language/PureScript/Sugar/TypeClasses.hs−2
@@ -21,12 +21,10 @@ module Language.PureScript.Sugar.TypeClasses (
2121import Language.PureScript.Declarations
2222import Language.PureScript.Names
2323import Language.PureScript.Types
24−import Language.PureScript.CodeGen.JS.AST
2524import Language.PureScript.Sugar.CaseDeclarations
2625import Language.PureScript.Environment
2726import Language.PureScript.Errors
2827import Language.PureScript.Pretty.Types (prettyPrintTypeAtom)
29−import Language.PureScript.CodeGen.Common (identToJs)
3028
3129import qualified Language.PureScript.Constants as C
3230
src/Language/PureScript/TypeChecker/Types.hs+1−7
@@ -348,7 +348,7 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
348348 -- Make sure the types unify with the types in the superclass implication
349349 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
350350 -- Finally, satisfy the subclass constraint
351− , args' <- maybeToList $ mapM (applySubst subst . TypeVar) args
351+ , args' <- maybeToList $ mapM (flip lookup subst) args
352352 , suDict <- go True subclassName args' ]
353353
354354 -- 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
379379 let grps = groupBy ((==) `on` fst) subst
380380 guard (all (pairwise (unifiesWith env) . map snd) grps)
381381 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
388382 -- Choose the simplest DictionaryValues from a list of candidates
389383 -- The reason for this function is as follows:
390384 -- When considering overlapping instances, we don't want to consider the same dictionary