Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis: Test ghc 8.0.1 (and avoid some compiler warnings on 8.0.1) #120

Merged
merged 3 commits into from
Jun 18, 2016
Merged

travis: Test ghc 8.0.1 (and avoid some compiler warnings on 8.0.1) #120

merged 3 commits into from
Jun 18, 2016

Conversation

petertseng
Copy link
Member

It's a prerelease version, but it's likely to be good to start testing
against it now.

Two commits are needed to avoid compiler warnings on 8.0.1 (and thus errors since we use -Werror). The errors that would appear are noted in the commit message.

@petertseng petertseng changed the title travis: Test ghc 8.0.1 travis: Test ghc 8.0.1 (and avoid some compiler warnings on 8.0.1) Apr 7, 2016
@petertseng
Copy link
Member Author

The various Travis PRs #118 #120 and #128 will probably have merge conflicts with each other. I can deal with them as the PRs are merged one by one.

@petertseng
Copy link
Member Author

petertseng commented Jun 17, 2016

will rebase in next 24 hours. I can and should be prodded if not.

by the way 8.0.1 is no longer pre-release, so this becomes much more relevant.

@rbasso rbasso mentioned this pull request Jun 18, 2016
4 tasks
Note that this only affects the example, not the tests.

GHC 8.0.1 will give the error:

```
BST.hs:15:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Ord a
    • In the type signature for:
           singleton :: Ord a => a -> BST a
```

That makes sense, since you can make any value a singleton tree; it
doesn't necessarily have to be Ord. Of course, you'll find yourself
unable to add other values to the tree if it's not Ord, but that's not
`singleton`'s problem.
Note that this only affects the example, not the tests.

GHC 8.0.1 will give the error:

```
CustomSet.hs:30:10: warning: [-Wredundant-constraints]
    • Redundant constraint: Eq a
    • In the instance declaration for ‘Eq (CustomSet a)’

CustomSet.hs:50:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Ord a
    • In the type signature for:
           singleton :: Ord a => a -> CustomSet a

CustomSet.hs:56:1: warning: [-Wredundant-constraints]
    • Redundant constraint: Ord a
    • In the type signature for:
           empty :: Ord a => CustomSet a
```

The singleton redundancy makes sense, since you can make any value a
singleton set; it doesn't necessarily have to be Ord. Of course, you'll
find yourself unable to add other values to the set if it's not Ord, but
that's not `singleton`'s problem.

The empty redundancy makes sense as well, since an empty set can be a
set for any type, not necessarily ordered types. Ordering is only
required if the set may contain elements.

The `Eq` reduncancy is simply because `Ord` has already a constraint of
`Eq a => Ord a`.

This is true as of the current version:
https://hackage.haskell.org/package/base-4.8.2.0/docs/Data-Ord.html
and has been true since at least 4.0.0.0:
https://hackage.haskell.org/package/base-4.0.0.0/docs/Data-Ord.html
@petertseng
Copy link
Member Author

petertseng commented Jun 18, 2016

OK, 8.0.1 now (and commit message updated to indicate that it's been released, rather than pre-release as it was at the time I made this PR!)

@rbasso rbasso merged commit 4456d79 into exercism:master Jun 18, 2016
@petertseng petertseng deleted the travis-ghc-8-0 branch June 18, 2016 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants