git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update comment & hlint
5860f1eGary Burgess
src/Language/PureScript/TypeChecker/Entailment.hs+6−6
@@ -1,6 +1,6 @@
1-----------------------------------------------------------------------------
1-----------------------------------------------------------------------------
2--
2--
3−-- Module : Language.PureScript.TypeChecker.Types
3+-- Module : Language.PureScript.TypeChecker.Entailment
4-- Copyright : (c) Phil Freeman 2013
4-- Copyright : (c) Phil Freeman 2013
5-- License : MIT
5-- License : MIT
6--
6--
@@ -9,7 +9,7 @@
9-- Portability :
9-- Portability :
10--
10--
11-- |
11-- |
12−-- This module implements the type checker
12+-- Type class entailment
13--
13--
14-----------------------------------------------------------------------------
14-----------------------------------------------------------------------------
15
15
@@ -101,7 +101,7 @@ entails env moduleName context = solve (sortedNubBy canonicalizeDictionary (filt
101 -- Make sure the types unify with the types in the superclass implication
101 -- Make sure the types unify with the types in the superclass implication
102 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
102 , subst <- maybeToList . (>>= verifySubstitution) . fmap concat $ zipWithM (typeHeadsAreEqual moduleName env) tys' suTyArgs
103 -- Finally, satisfy the subclass constraint
103 -- Finally, satisfy the subclass constraint
104− , args' <- maybeToList $ mapM (flip lookup subst) (map fst args)
104+ , args' <- maybeToList $ mapM ((`lookup` subst) . fst) args
105 , suDict <- go True subclassName args' ]
105 , suDict <- go True subclassName args' ]
106
106
107 -- Create dictionaries for subgoals which still need to be solved by calling go recursively
107 -- 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
174 overlapping (LocalDictionaryValue nm1) (LocalDictionaryValue nm2) | nm1 == nm2 = False
174 overlapping (LocalDictionaryValue nm1) (LocalDictionaryValue nm2) | nm1 == nm2 = False
175 overlapping (GlobalDictionaryValue nm1) (GlobalDictionaryValue nm2) | nm1 == nm2 = False
175 overlapping (GlobalDictionaryValue nm1) (GlobalDictionaryValue nm2) | nm1 == nm2 = False
176 overlapping (DependentDictionaryValue nm1 ds1) (DependentDictionaryValue nm2 ds2)
176 overlapping (DependentDictionaryValue nm1 ds1) (DependentDictionaryValue nm2 ds2)
177− | nm1 == nm2 = any id $ zipWith overlapping ds1 ds2
177+ | nm1 == nm2 = or $ zipWith overlapping ds1 ds2
178− overlapping (SubclassDictionaryValue _ _ _) _ = False
178+ overlapping SubclassDictionaryValue{} _ = False
179− overlapping _ (SubclassDictionaryValue _ _ _) = False
179+ overlapping _ SubclassDictionaryValue{} = False
180 overlapping _ _ = True
180 overlapping _ _ = True
181 -- |
181 -- |
182 -- Render a DictionaryValue fit for human consumption in error messages
182 -- Render a DictionaryValue fit for human consumption in error messages