summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2014-04-04 06:52:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-04-04 06:52:00 (GMT)
commit3b37a19639785ed27756b1c4c7e750aff97da963 (patch)
tree13c163ced37e750a2e0f2ab81534b543201231a7
parent079627cc268d7b88a75f4a4c71575c1d223f8a2d (diff)
version 0.4.15.10.4.15.1
-rw-r--r--purescript.cabal2
-rw-r--r--src/Language/PureScript/TypeChecker/Types.hs4
2 files changed, 3 insertions, 3 deletions
diff --git a/purescript.cabal b/purescript.cabal
index a995ee2..6ad4336 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.4.15
+version: 0.4.15.1
cabal-version: >=1.8
build-type: Custom
license: MIT
diff --git a/src/Language/PureScript/TypeChecker/Types.hs b/src/Language/PureScript/TypeChecker/Types.hs
index a2cbf6a..b0dd3b9 100644
--- a/src/Language/PureScript/TypeChecker/Types.hs
+++ b/src/Language/PureScript/TypeChecker/Types.hs
@@ -291,14 +291,14 @@ data DictionaryValue
--
entails :: Environment -> ModuleName -> [TypeClassDictionaryInScope] -> (Qualified ProperName, [Type]) -> Check Value
entails env moduleName context goal@(className, tys) = do
- case nub (go goal) of
+ case go goal of
[] -> throwError . strMsg $ "No instance found for " ++ show className ++ " " ++ unwords (map prettyPrintTypeAtom tys)
[dict] -> return (dictionaryValueToValue dict)
_ -> throwError . strMsg $ "Overlapping instances found for " ++ show className ++ " " ++ unwords (map prettyPrintTypeAtom tys)
where
go (className', tys') =
[ mkDictionary (canonicalizeDictionary tcd) args
- | tcd <- context
+ | tcd <- nubBy ((==) `on` canonicalizeDictionary) context
-- Choose type class dictionaries in scope in the current module
, filterModule tcd
-- Make sure the type class name matches the one we are trying to satisfy