-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add explicit args to Exercises - Part 1 #504
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
3a30f88
a257914
26e373c
799e824
0d262f2
82828cc
78ea086
460cb35
02f03f9
10d1906
81242d6
ce484fb
7993697
3c288b5
30cec37
3223c18
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module Atbash (decode, encode) where | ||
|
||
decode :: String -> String | ||
decode = error "You need to implement this function." | ||
decode phrase = error "You need to implement this function." | ||
|
||
encode :: String -> String | ||
encode = error "You need to implement this function." | ||
encode phrase = error "You need to implement this function." |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module Connect (Mark(..), winner) where | |
data Mark = Cross | Nought deriving (Eq, Show) | ||
|
||
winner :: [String] -> Maybe Mark | ||
winner = error "You need to implement this function." | ||
winner board = error "You need to implement this function." | ||
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.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module CryptoSquare (encode) where | ||
|
||
encode :: String -> String | ||
encode = error "You need to implement this function." | ||
encode xs = error "You need to implement this function." | ||
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. sorry that I know I'm contradicting #504 (comment) here, but it seemed a bit inconsistent here to use 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 agree! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
module Squares (difference, squareOfSums, sumOfSquares) where | ||
|
||
difference :: Integral a => a -> a | ||
difference = error "You need to implement this function." | ||
difference n = error "You need to implement this function." | ||
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.
|
||
|
||
squareOfSums :: Integral a => a -> a | ||
squareOfSums = error "You need to implement this function." | ||
squareOfSums n = error "You need to implement this function." | ||
|
||
sumOfSquares :: Integral a => a -> a | ||
sumOfSquares = error "You need to implement this function." | ||
sumOfSquares n = error "You need to implement this function." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Series (largestProduct) where | ||
|
||
largestProduct :: Int -> String -> Maybe Integer | ||
largestProduct = error "You need to implement this function." | ||
largestProduct series digits = error "You need to implement this function." | ||
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.
|
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 would normally go for
xs
for strings, or maybecipherText
for more something more descriptive. I'm not sure.Edit:
phrase
is also OK, of course.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 also prefer following the convention (
f
org
for functions,xs
ys
for generic lists, etc.) and I'm happy to change.The reason I choose
phrase
here instead, was to match the test suite, believing that it would be easier for the student to understand the test cases.I followed this same approach for other exercises, trying to match the test suite terms whenever possible, but I'm happy to change them as well.
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.
Please feel free to keep or to change the names you chose.