@@ -1,6 +1,6 @@
11-----------------------------------------------------------------------------
22--
3−-- Module : Language.PureScript.TypeChecker.Types
3+-- Module : Language.PureScript.TypeChecker.Entailment
44-- Copyright : (c) Phil Freeman 2013
55-- License : MIT
66--
@@ -9,7 +9,7 @@
99-- Portability :
1010--
1111-- |
12−-- This module implements the type checker
12+-- Type class entailment
1313--
1414-----------------------------------------------------------------------------
1515
@@ -101,7 +101,7 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
101101 -- Make sure the types unify with the types in the superclass implication
102102 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
103103 -- Finally, satisfy the subclass constraint
104− , args' <- maybeToList $ mapM (flip lookup subst) (map fst args)
104+ , args' <- maybeToList $ mapM ((`lookup` subst) . fst) args
105105 , suDict <- go True subclassName args' ]
106106
107107 -- Create dictionaries for subgoals which still need to be solved by calling go recursively
@@ -174,9 +174,9 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
174174 overlapping (LocalDictionaryValue nm1) (LocalDictionaryValue nm2) | nm1 == nm2 = False
175175 overlapping (GlobalDictionaryValue nm1) (GlobalDictionaryValue nm2) | nm1 == nm2 = False
176176 overlapping (DependentDictionaryValue nm1 ds1) (DependentDictionaryValue nm2 ds2)
177− | nm1 == nm2 = any id $ zipWith overlapping ds1 ds2
178− overlapping (SubclassDictionaryValue _ _ _) _ = False
179− overlapping _ (SubclassDictionaryValue _ _ _) = False
177+ | nm1 == nm2 = or $ zipWith overlapping ds1 ds2
178+ overlapping SubclassDictionaryValue{} _ = False
179+ overlapping _ SubclassDictionaryValue{} = False
180180 overlapping _ _ = True
181181 -- |
182182 -- Render a DictionaryValue fit for human consumption in error messages