Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry
curry-frontend
Commits
4bccb87e
Commit
4bccb87e
authored
Apr 15, 2019
by
Kai-Oliver Prott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when deriving instances of Bounded type class
parent
9973ec9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
src/Checks/InstanceCheck.hs
src/Checks/InstanceCheck.hs
+1
-1
src/Transformations/Derive.hs
src/Transformations/Derive.hs
+2
-2
No files found.
CHANGELOG.md
View file @
4bccb87e
...
...
@@ -11,6 +11,7 @@ Version 1.0.4
=============
*
Fixed bug in type checking of instances
*
Fixed bugs in deriving of
`Bounded`
instances.
Version 1.0.3
=============
...
...
src/Checks/InstanceCheck.hs
View file @
4bccb87e
...
...
@@ -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
=
...
...
src/Transformations/Derive.hs
View file @
4bccb87e
...
...
@@ -274,8 +274,8 @@ enumFromThenExpr v1 v2 c1 c2 =
deriveBoundedMethods
::
Type
->
[
ConstrInfo
]
->
PredSet
->
DVM
[
Decl
PredType
]
deriveBoundedMethods
ty
cis
ps
=
sequence
[
deriveMaxOrMinBound
qM
ax
BoundId
ty
(
head
cis
)
ps
,
deriveMaxOrMinBound
qM
in
BoundId
ty
(
last
cis
)
ps
[
deriveMaxOrMinBound
qM
in
BoundId
ty
(
head
cis
)
ps
,
deriveMaxOrMinBound
qM
ax
BoundId
ty
(
last
cis
)
ps
]
deriveMaxOrMinBound
::
QualIdent
->
Type
->
ConstrInfo
->
PredSet
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment