-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add Explicit Args To Exercises - Part 3 #507
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
Merged
rbasso
merged 13 commits into
exercism:master
from
lpalma:add-explicit-args-to-exercises-p3
Mar 20, 2017
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d909c56
pov: add explicit args
lpalma 0049b07
queen-attack: add explicit args
lpalma a07bd4a
raindrops: declare type and add explicit args
lpalma 6bb762a
robot-name: add explicit args
lpalma 544f0b2
robot-simulator: add explicit args
lpalma 3f44912
roman-numerals: add explicit args
lpalma 1e8c23c
run-length-encoding: add explicit args
lpalma a107598
saddle-points: add explicit args
lpalma 76e1923
say: declare type and add explicit args
lpalma 0f87334
scrabble-score: add explicit args
lpalma 541c6d7
secret-handshake: add explicit args
lpalma 0a6952b
sgf-parsing: add explicit args
lpalma cb571e0
pythagorean-triplets: declare type and add explicit args
lpalma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
module Triplet (isPythagorean, mkTriplet, pythagoreanTriplets) where | ||
|
||
isPythagorean = error "You need to implement this function." | ||
isPythagorean :: (Int, Int, Int) -> Bool | ||
isPythagorean triplet = error "You need to implement this function." | ||
|
||
mkTriplet = error "You need to implement this function." | ||
mkTriplet :: Int -> Int -> Int -> (Int, Int, Int) | ||
mkTriplet a b c = error "You need to implement this function." | ||
|
||
pythagoreanTriplets = error "You need to implement this function." | ||
pythagoreanTriplets :: Int -> Int -> [(Int, Int, Int)] | ||
pythagoreanTriplets minFactor maxFactor = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module Raindrops (convert) where | ||
|
||
convert = error "You need to implement this function." | ||
convert :: Int -> String | ||
convert n = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module Roman (numerals) where | ||
|
||
numerals = error "You need to implement this function." | ||
numerals :: Integer -> Maybe String | ||
numerals n = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module RunLength (decode, encode) where | ||
|
||
decode :: String -> String | ||
decode = error "You need to implement this function." | ||
decode encodedText = error "You need to implement this function." | ||
|
||
encode :: String -> String | ||
encode = error "You need to implement this function." | ||
encode text = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
module Say (inEnglish) where | ||
|
||
inEnglish = error "You need to implement this function." | ||
inEnglish :: Integer -> Maybe String | ||
inEnglish n = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
module Scrabble (scoreLetter, scoreWord) where | ||
|
||
scoreLetter = error "You need to implement this function." | ||
scoreLetter :: Char -> Integer | ||
scoreLetter letter = error "You need to implement this function." | ||
|
||
scoreWord = error "You need to implement this function." | ||
scoreWord :: String -> Integer | ||
scoreWord word = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module SecretHandshake (handshake) where | ||
|
||
handshake :: Int -> [String] | ||
handshake = error "You need to implement this function." | ||
handshake n = error "You need to implement this function." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
if this is done, then the reasoning in https://github.com/exercism/xhaskell/blob/master/exercises/pythagorean-triplet/.meta/DONT-TEST-STUB for why the tests would fail to build is false, so if we do this please delete that file so that the stub gets tested.
If we choose the type of
mkTriplet
as(Int, Int, Int)
rather than letting the student choose,do we even needmkTriplet
? Shouldn't we just deletemkTriplet
then? I think the only point of it is to give the student the choice.Why did we give this choice, anyway?
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.
I didn't see explanation given in exercism/exercism#741. I guess we can see that
mkTriplet
is invariant to ordering of the three numbers, since it will always order them in a consistent way.So we still need
mkTriplet
.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.
I think we can consider redesigning this exercise without
mkTriplet
, @petertseng. The way it is now, I think it is over-specified.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.
Yeah, I left this exercise for last because I couldn't figure out a way to declare the types without over-specifying it :/
I was completely unaware of https://github.com/exercism/xhaskell/blob/master/exercises/pythagorean-triplet/.meta/DONT-TEST-STUB though
What about get rid of this commit so this exercise can get redesigned as suggested by @rbasso ?
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.
I don't think we should stop things here because of that. We don't have anything ready yet.
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.
cool. I've applied the feedback for the POV exercise, so I'm just waiting for the decision here.