Commit a15821f2 authored by Finn Teegen's avatar Finn Teegen

Fix bug when deriving instances of Bounded type class

parent f16590b2
...@@ -5,6 +5,7 @@ Version 1.0.4 ...@@ -5,6 +5,7 @@ Version 1.0.4
============= =============
* Fixed bug in type checking of instances * Fixed bug in type checking of instances
* Fixed bugs in deriving of `Bounded` instances.
Version 1.0.3 Version 1.0.3
============= =============
......
Name: curry-frontend Name: curry-frontend
Version: 1.0.3 Version: 1.0.4
Cabal-Version: >= 1.10 Cabal-Version: >= 1.10
Synopsis: Compile the functional logic language Curry to several Synopsis: Compile the functional logic language Curry to several
intermediate formats intermediate formats
......
...@@ -196,7 +196,7 @@ bindDerivedInstance clsEnv p tc pty tys cls = do ...@@ -196,7 +196,7 @@ bindDerivedInstance clsEnv p tc pty tys cls = do
, (fromEnumId, 1), (enumFromId, 1) , (fromEnumId, 1), (enumFromId, 1)
, (enumFromThenId, 2) , (enumFromThenId, 2)
] ]
| cls == qBoundedId = [(maxBoundId, 1), (minBoundId, 1)] | cls == qBoundedId = [(maxBoundId, 0), (minBoundId, 0)]
| cls == qReadId = [(readsPrecId, 2)] | cls == qReadId = [(readsPrecId, 2)]
| cls == qShowId = [(showsPrecId, 2)] | cls == qShowId = [(showsPrecId, 2)]
| otherwise = | otherwise =
......
...@@ -274,8 +274,8 @@ enumFromThenExpr v1 v2 c1 c2 = ...@@ -274,8 +274,8 @@ enumFromThenExpr v1 v2 c1 c2 =
deriveBoundedMethods :: Type -> [ConstrInfo] -> PredSet -> DVM [Decl PredType] deriveBoundedMethods :: Type -> [ConstrInfo] -> PredSet -> DVM [Decl PredType]
deriveBoundedMethods ty cis ps = sequence deriveBoundedMethods ty cis ps = sequence
[ deriveMaxOrMinBound qMaxBoundId ty (head cis) ps [ deriveMaxOrMinBound qMinBoundId ty (head cis) ps
, deriveMaxOrMinBound qMinBoundId ty (last cis) ps , deriveMaxOrMinBound qMaxBoundId ty (last cis) ps
] ]
deriveMaxOrMinBound :: QualIdent -> Type -> ConstrInfo -> PredSet deriveMaxOrMinBound :: QualIdent -> Type -> ConstrInfo -> PredSet
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment