-
-
Notifications
You must be signed in to change notification settings - Fork 195
travis: Build all stubs, and test all stubs except for untestable ones #464
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
Changes from all commits
73f42a3
4c12735
342b932
4a9b488
5c17705
053164e
f684559
7d76947
2299b7c
34d4039
97624b6
60e23bf
3622396
1d91ceb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
We would have to export all the allergens in the stub; let students figure that out. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ with `Eq` and `Show` instances, and implement the following functions: | |
- `allergies` | ||
- `isAllergicTo` | ||
|
||
Your can use the provided signatures if you are unsure about the types, but | ||
don't let them restrict your creativity. | ||
You will find a dummy data declaration and type signatures already in place, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is too different from the original ("Don't let them restrict your creativity"), please help me to combine the two in a sensible manner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is great the way it is. 👍 |
||
but it is up to you to define the functions and create a meaningful data type, | ||
newtype or type synonym. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
We ask for the Clock to be an instance of Num; let students figure this out. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ The function `fromInteger`, from `Num`, must convert minutes | |
to 24 hour clock time. It is not necessary to have a sensible | ||
implementation of `abs` or `signum`. | ||
|
||
Your can use the provided signatures if you are unsure about the types, but | ||
don't let them restrict your creativity. | ||
You will find a dummy data declaration and type signatures already in place, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is too different from the original ("Don't let them restrict your creativity"), please help me to combine the two in a sensible manner. |
||
but it is up to you to define the functions and create a meaningful data type, | ||
newtype or type synonym. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
No type signatures on functions (TODO: Should we have them?), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you believe we should have them, I will gladly add them and remove this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see no reason to not have them. 👍 |
||
and this makes it impossible to ensure that the result of `grade` is `Eq`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module School (School, add, empty, grade, sorted) where | ||
|
||
data School = Dummy | ||
|
||
add = undefined | ||
|
||
empty = undefined | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module Series (largestProduct) where | ||
|
||
largestProduct :: Int -> String -> Maybe Integer | ||
largestProduct = undefined |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Can't build because the parameters of meetupDay are unused | ||
Would also have to export all the individual days of the week in stub; let students figure that out. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
No function signatures, since we give students the freedom to define mkTriplet how they want | ||
But this means we can't make sure that the result of `mkTriplet` is `Eq` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
No signature, so students can figure out accepting strings and ints. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
We would have to export all the planets in the stub; let students figure that out. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
## Hints | ||
|
||
To complete this exercise, you need to create the data type `Sublist`, | ||
with `Eq` and `Show` instances, and implement the `sublist` function. | ||
To complete this exercise, you need to implement the `sublist` function. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module Sublist (Sublist(..), sublist) where | ||
|
||
data Sublist = Equal | Sublist | Superlist | Unequal deriving (Eq, Show) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potentially controversial. If we don't do this though, we have to compare to:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed! I'm usually in favor of anything to avoid the students having to read the test file. Haskell is already hard enough to learn, and it is better to allow the students to see a lot of data declarations until they get used to it than let them stuck reading the test suites. |
||
|
||
sublist :: [a] -> [a] -> Sublist | ||
sublist = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these lines (stub-testing code) have very high duplication with the example-testing code below. I'm not sure if it's desirable that we deduplicate that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine for me. If we change our mind we can rewrite it later. 👍