Skip to content

Commit

Permalink
Address duplication in implementation of two-fer and fix file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
benreyn committed Oct 29, 2018
1 parent f700b16 commit 6365cc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
8 changes: 1 addition & 7 deletions exercises/two-fer/TwoFer.elm
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
module TwoFer exposing (twoFer)


twoFer : Maybe String -> String
twoFer name =
case name of
Just name_ ->
"One for " ++ name_ ++ ", one for me."

Nothing ->
"One for you, one for me."
Debug.todo "Please implement this function"
5 changes: 4 additions & 1 deletion exercises/two-fer/TwoFer.example.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module TwoFer exposing (twoFer)


twoFer : Maybe String -> String
twoFer name =
Debug.todo "Please implement this function"
"One for "
++ Maybe.withDefault "you" name
++ ", one for me."
4 changes: 0 additions & 4 deletions exercises/two-fer/tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ tests =
[ test "No name given" <|
\() ->
Expect.equal "One for you, one for me." (twoFer Nothing)

-- Once you get the first test passing, remove the
-- `skip <|` (just leave the comma) on the next two
-- lines to continue!
, skip <|
test "A name given" <|
\() ->
Expand Down

0 comments on commit 6365cc1

Please sign in to comment.