diff --git a/CHANGELOG.md b/CHANGELOG.md index b6ee336649f293d2a06bc8969bff478c43a9d7ab..971e9cee955940a33344bd10f4004cb4aeb857b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Version 1.0.4 ============= * Fixed bug in type checking of instances + * Fixed bugs in deriving of `Bounded` instances. Version 1.0.3 ============= diff --git a/curry-frontend.cabal b/curry-frontend.cabal index 99866a0410702484bcba93a09c72655ae5509ca9..9910359bad97b28b855ff0301a2fcf796e9efed8 100644 --- a/curry-frontend.cabal +++ b/curry-frontend.cabal @@ -1,5 +1,5 @@ Name: curry-frontend -Version: 1.0.3 +Version: 1.0.4 Cabal-Version: >= 1.10 Synopsis: Compile the functional logic language Curry to several intermediate formats diff --git a/src/Checks/InstanceCheck.hs b/src/Checks/InstanceCheck.hs index 957411ecb704eac1c69a88dbde3e5eaa5b3b7130..bad59d266f8cc8fc5d87edf0b8c51391e4793a45 100644 --- a/src/Checks/InstanceCheck.hs +++ b/src/Checks/InstanceCheck.hs @@ -196,7 +196,7 @@ bindDerivedInstance clsEnv p tc pty tys cls = do , (fromEnumId, 1), (enumFromId, 1) , (enumFromThenId, 2) ] - | cls == qBoundedId = [(maxBoundId, 1), (minBoundId, 1)] + | cls == qBoundedId = [(maxBoundId, 0), (minBoundId, 0)] | cls == qReadId = [(readsPrecId, 2)] | cls == qShowId = [(showsPrecId, 2)] | otherwise = diff --git a/src/Transformations/Derive.hs b/src/Transformations/Derive.hs index 8b73c40cd62e22fa0fc8733682fe7dd91b4f5c9f..b6f0d8347a93022fbd53f00b7882b0e1a20a1b95 100644 --- a/src/Transformations/Derive.hs +++ b/src/Transformations/Derive.hs @@ -274,8 +274,8 @@ enumFromThenExpr v1 v2 c1 c2 = deriveBoundedMethods :: Type -> [ConstrInfo] -> PredSet -> DVM [Decl PredType] deriveBoundedMethods ty cis ps = sequence - [ deriveMaxOrMinBound qMaxBoundId ty (head cis) ps - , deriveMaxOrMinBound qMinBoundId ty (last cis) ps + [ deriveMaxOrMinBound qMinBoundId ty (head cis) ps + , deriveMaxOrMinBound qMaxBoundId ty (last cis) ps ] deriveMaxOrMinBound :: QualIdent -> Type -> ConstrInfo -> PredSet